AykinDalike

|
分享:
▲
▼
3. 模式设置 让survivor在任何模式都能出现(multi_infection为例) 加入 蓝色字体部分,其他不用理他,全放上来目的让你看清楚它的位置,请看... { // Multi Infection Mode g_lastmode = MODE_MULTI // iMaxZombies is rounded up, in case there aren't enough players iMaxZombies = floatround(iPlayersnum*get_pcvar_float(cvar_multiratio), floatround_ceil) iZombies = 0
// Turn someone into a Survivor id = fnGetRandomAlive(random_num(1, iPlayersnum)) humanme(id, 1)
// Randomly turn iMaxZombies players into zombies while (iZombies < iMaxZombies) { // Keep looping through all players if (id++ > g_maxplayers) id = 1
// Dead or already a zombie if (!is_user_alive(id) || g_zombie[id]) continue;
// Random chance if (random_num(0, 1)) { // Turn into a zombie zombieme(id, 0, 0, 1) iZombies++ } }
// Turn the rest of players into humans for (id = 1; id <= g_maxplayers; id++) { // Only those of them who aren't zombies or survivor if (!is_user_alive(id) || g_zombie[id] || g_survivor[id]) continue
// Remove previous tasks remove_task(id+TASK_TEAM)
// Switch to CT if (fm_get_user_team(id) != CS_TEAM_CT) // need to change team? { fm_set_user_team(id, CS_TEAM_CT) set_task(0.1+g_teams_i, "fm_set_user_team_msg", id+TASK_TEAM) g_teams_i += 0.1; // increase teams task counter } }
// Play multi infection sound PlaySound(sound_multi[random_num(0, sizeof sound_multi -1)]);
// Show Multi Infection HUD notice set_hudmessage(200, 50, 0, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1) ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "NOTICE_MULTI")
// Round start forward ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_MULTI, 0); } 4. 属性设置 让survivor在任何模式下都不会被感染 这项不加的话,survivor是会被攻击变成僵尸的 如果想看他变僵尸的话,这段别理他 做法: ctrl+f 键入human is killed 找到以下这段...加入 g_survivor[victim] // Last human or swarm round or plague round if (g_swarmround || g_plagueround || fnGetHumans() == 1 || g_survivor[victim]) return HAM_IGNORED; // human is killed 5. 武器设置 5-1 丢枪 把survivor不能丢武器的 蓝色部分指令换成nemesis 换言之,把不能丢武器的行为主体改成nemesis (他本来就没有武器所以没差) // Weapon Drop public clcmd_drop(id) { // Survivor should stick with M249 if (g_survivor[id]) return PLUGIN_HANDLED; return PLUGIN_CONTINUE; } 5-2 捡枪 把survivor不能捡枪的指令改为zombie 前项为一般玩家,后项则改为限制给bot ( 蓝色部分) // Ham Weapon Touch Forward public fw_TouchWeapon(weapon, id) { // Not a player if (!is_user_connected(id)) return HAM_IGNORED; // Dont pickup weapons if zombie or survivor if (g_zombie[id] || (g_survivor[id] && !is_user_bot(id))) return HAM_SUPERCEDE; return HAM_IGNORED; } 5-3 给枪 给予survivor什么枪? 蓝色部分是举例,当然你可以换成任何CS内建的武器 请看... // Strip survivor from weapons and give M249 fm_strip_user_weapons(id) fm_give_item(id, "weapon_knife") fm_give_item(id, "weapon_hegrenade") fm_give_item(id, "weapon_p228") fm_give_item(id, "weapon_mp5navy") fm_give_item(id, "ammo_9mm") fm_give_item(id, "ammo_9mm") fm_give_item(id, "ammo_9mm") fm_give_item(id, "ammo_9mm") fm_give_item(id, "ammo_357sig") fm_give_item(id, "ammo_357sig") fm_give_item(id, "ammo_357sig") fm_give_item(id, "ammo_357sig") fm_give_item(id, "ammo_357sig") 5-4 bpammo 这是为什么surv 的后备子弹无限的原因了( 蓝色) 你要哪把枪无限在这边调整即可 也可以全部都无限或都有限(有在这加入的武器前项5-3的 "ammo_xxx" 就不需要了) // Unlimited BPAmmo? if ((infammo && MAXBPAMMO[weapon] > 2) || (g_survivor[msg_entity] && weapon == CSW_M249)) { if (fm_get_user_bpammo(msg_entity, weapon) < MAXBPAMMO[weapon]) fm_set_user_bpammo(msg_entity, weapon, MAXBPAMMO[weapon]) } 5-5 clip ammo 这是为什么surv 膛上子弹无限的原因( 蓝色) // Unlimited Clip Ammo? if ((infammo > 1 && MAXCLIP[weapon] > 0) || (g_survivor[msg_entity] && weapon == CSW_M249)) { // HUD should show full clip all the time set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // Refill when clip is nearly empty if (clip < 3) fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon]) } 5-6 extra items 让surv 可以进入选单购买特殊武器 删掉以下三处... (1) // 2. Extra items if (!g_survivor[id] && !g_nemesis[id] && get_pcvar_num(cvar_extraitems) && is_user_alive(id)) len += formatex(menu[len], sizeof menu - 1 - len, "\r2.\w %L^n", id, "MENU_EXTRABUY") (2) // Extra items enabled? if (get_pcvar_num(cvar_extraitems)) { // Check whether the player is able to buy anything if (is_user_alive(id) && !g_survivor[id] && !g_nemesis[id]) show_menu_extras(id) else zp_colored_print(id, "^x04[ZP]^x01 %L", id ,"CMD_NOT") } (3) // Extra Items Menu public menu_extras(id, key) { // Nemesis or Survivor shouldnt get extra items if (g_survivor[id] || g_nemesis[id] || !is_user_alive(id)) { zp_colored_print(id, "^x04[ZP]^x01 %L", id, "CMD_NOT") return PLUGIN_HANDLED; } 乎~ 基本上这样已经差不多了 [ 补充]: 1. 武器看你要设几个(随你高兴),可以把CS内键的24把枪、小刀和手榴弹都独立给survivor 但请注意!!!...超过10个模组的话可能会出错 必须在设定上面做点调整 以下 蓝色部分就是它的上限值... // Dynamic Stuff Limiters (increase if needed) const MAX_EXTRA_ITEMS = 30 const MAX_ZOMBIE_CLASSSES = 20 const MAX_CSDM_SPAWNS = 128 const MAX_STATS_SAVED = 64 const MAX_MODELS_NEMESIS = 10 const MAX_MODELS_SURVIVOR = 10 const MAX_MODELS_HUMAN = 20 const MAX_MODELS_ADM_HUMAN = 10 const MAX_MODELS_ADM_ZOMBIE = 10 2. 同样的,声音档看你要放几个来源都行 3. 把survivor 移到哪个模式出现也都看个人,方法雷同 swarm模式要特别留意,有需要再跟大家说 4. 和 5.就是可有可无了,自个儿斟酌啰 [ 补充2]: // Single Infection Mode g_lastmode = MODE_INFECTION
if (fnGetHumans() > 1) { // Turn player into the first zombie zombieme(id, 0, 0, 0) }
if (fnGetHumans() >= 1) { // Turn someone into a Survivor (if not a zombie) while (g_zombie[id]) id = fnGetRandomAlive(random_num(1, iPlayersnum)); humanme(id, 1) }
// Randomly turn iMaxZombies players into zombies while (iZombies < iMaxZombies) { // Keep looping through all players if (id++ > g_maxplayers) id = 1 // Dead or already a zombie or survivor if (!is_user_alive(id) || g_zombie[id] || g_survivor[id]) continue; // Random chance if (random_num(0, 1)) { // Turn into a zombie zombieme(id, 0, 0, 1) iZombies++ } } ... ....... // First zombie/nemesis or survivor if (!is_user_alive(id) || g_zombie[id] || g_survivor[id])
说明:如果要把surv改到一般模式出现需注意 (略有不同) 原因:若不定义『当有一位僵尸出现后的这个僵尸不会变幸存者』的话 是会有可能没僵尸的喔,因为surv定义在僵尸出现后的下一秒发生 所以要排除掉可能僵尸和幸存者都随机选到同一人的bug 一般模式加入surv 修正后只剩下一个地方怪怪的,就是当游戏室只有adm
一人的时候可能会有问题,不过应该没有人开僵尸自己玩的吧?跟谁玩? 解:这点也解决了!! 做了点调整后不会有任何问题 !! [ 补充3]: 本来不想加的 但是这样应该会更有说服力 若想要你的1.6更趋近CSO 当然不能只有一个女角嘛 意思是...你可以创多个幸存者 告诉大家 ...加在[ 补充2] 以下...( 蓝色) // Single Infection Mode g_lastmode = MODE_INFECTION
if (fnGetHumans() > 1) { // Turn player into the first zombie zombieme(id, 0, 0, 0) } if (fnGetHumans() >= 1) { // Turn someone into a Survivor(if ont a zombie) while (g_zombie[id]) id = fnGetRandomAlive(random_num(1, iPlayersnum)); humanme(id, 1) } if (fnGetHumans() >= 5) { while (g_survivor[id] || g_zombie[id]) id = fnGetRandomAlive(random_num(1, iPlayersnum)); humanme(id, 1) } if (fnGetHumans() >= 9) { while (g_survivor[id] || g_zombie[id]) id = fnGetRandomAlive(random_num(1, iPlayersnum)); humanme(id, 1) }
以上修改客体为补充2的single infection mode 设置成当游戏室人数达5人以上(包含5)会出现2个幸存者、9人以上(包含9)会出现3个幸存者... 以此类推...改在任何模式都随己意!!有兴趣者可自行修改单局幸存者数量与人数条件...或采半数为幸存者亦可... 顺道一提... 武器设置的部分你有三个选择... 1. 前面教过的 5-3 2. 差件区的『幸存者选择武器插件』 3. 此最为理想...做法: 5-3只给刀、且把fm_strip_user_weapons(id) 删除 这样就会延用僵尸出现前人类选的武器,直接换到女角手上的意思 当然模组也跟着你的设定随之换成女手!! [ 补充4] 作用:使得幸存者可开启手电筒照明 删除以下 红色部分 // Block it for zombies, survivor (and override it for humans when custom flashlight is on) if (g_zombie[id] || g_survivor[id] || (!g_zombie[id] && get_pcvar_num(cvar_cflash))) { // Human's custom flashlight should be turned on instead if (!g_zombie[id] && !g_survivor[id] && get_gametime() - g_lastflashtime[id] > 1.1) // Strip survivor from weapons and give M249 fm_strip_user_weapons(id) fm_give_item(id, "weapon_knife") fm_give_item(id, "weapon_m249") // Turn off his flashlight turn_off_flashlight(id) 还有让身为bot的surv在需要时买备用弹 红色部分删除,否则bot用完弹就只会拿刀啰 // Bots automatically buy ammo when needed if (!g_zombie[msg_entity] && !g_survivor[msg_entity] && g_ammopacks[msg_entity] > 0 && MAXBPAMMO[weapon] > 2 && is_user_bot(msg_entity) && fm_get_user_bpammo(msg_entity, weapon) <= BUYAMMO[weapon]) clcmd_buyammo(msg_entity); 以上修改了几点要件: survivor(幸存者)武器、音效被独立出来(与一般人类和僵尸分开) 而他又可以捡枪丢枪、子弹有限、可以买特殊武器、又出现在任何模式 血量就看你打算给他多少 基本上她已经变成一般人了 当然可以把她设成女角 结果是... 当然就 可以男女混打啦!! 系统会在各种模式下等待僵尸出现后 随机选一人(或一人以上)当女角
其他的都还是男生 就看这些男生要不要保护她了 测试结果大概90分,出现唯一的缺点是 伺服器人数要在>=5才会正常运行 不然会有回合出现没僵尸的状况 上述问题已解决 要1vs1也行 跟伺服器人数多寡无关 总之人类那一方都会有一人(或数人)被随机选为女角 如果是1打1的话 就变成1僵尸1女角 2打1的话就1僵尸1女角1男角 以此类推 如果也加入补充3的话 那就看你是定义有几个女角了 个人测试满意度上升到97%
个人测试满意度上升至99% 所以制作前请先 "备份" 但基本上玩僵尸也很少1对1的吧 (扬言pk那种除外) 因为图大,人太少没甚么看头 都给你跑就好了 还有radio目前还没研究出怎么独立给survivor用 我看那要是po上来也是一大篇幅 这篇单是打在word就10页了 目前已找到解决办法处理无线电的问题了 测试结果非常成功 更兴奋的是连僵尸无线电也能一起改出来 (男角、女角以及僵尸的z、x、c语音完整呈现) 而且重点是不会占用系统512mb资源 因为并非新增音效来源 而是用id 判断玩家身分后取代音效 例如身为女角,使用无线电呼叫时 声音会直接被取代成女角的无线电语音 还剩下一点点小bug排除中 (近期考虑发表在插件区) 好啦 希望各位喜欢!!
[ 此文章被AykinDalike在2010-05-18 14:10重新编辑 ]
|