求生之路2多重物品、多个补给插件 Multiple_Supply 插件源码 Multiple_Supply.sp Multiple_Supply.smx。
求生之路2,l4d,l4d2,SourceMOD 插件源码。
求生之路2多重物品插件 (Multiple Supply),自动设置游戏补给物品为多重,多人的时候要用到。
之前自己有需要,写的一东西,不复杂,设置游戏补给物品数量即可。
/* 求生之路2多重物品插件 (Multiple Supply) Time: 2012-1-10 12:32:52 By: Nuclear'Atk */ #include <sourcemod> #include <sdktools> public Plugin:myinfo = { name = "求生之路2多重物品插件 (Multiple Supply)", author = "Nuclear'Atk", description = "求生之路2多重物品插件 (Multiple Supply),自动设置游戏补给物品为多重,多人的时候要用到。", version = "1.0", url = "https://lcx.cc/" } public OnPluginStart() { HookEvent("round_start", Event_RoundStart); //勾住回合开始事件 } public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast) { CreateTimer(3.0, UpdateCounts, 0); //每3秒执行一次设置物品函数 } public Action:UpdateCounts(Handle:timer) //设置物品数量 { //发现在安全室只产生这些物品 UpdateEntCount("weapon_autoshotgun_spawn","17"); UpdateEntCount("weapon_hunting_rifle_spawn","17"); UpdateEntCount("weapon_pistol_spawn","17"); UpdateEntCount("weapon_pistol_magnum_spawn","17"); UpdateEntCount("weapon_pumpshotgun_spawn","17"); UpdateEntCount("weapon_rifle_spawn","17"); UpdateEntCount("weapon_rifle_ak47_spawn","17"); UpdateEntCount("weapon_rifle_desert_spawn","17"); UpdateEntCount("weapon_rifle_sg552_spawn","17"); UpdateEntCount("weapon_shotgun_chrome_spawn","17"); UpdateEntCount("weapon_shotgun_spas_spawn","17"); UpdateEntCount("weapon_smg_spawn","17"); UpdateEntCount("weapon_smg_mp5_spawn","17"); UpdateEntCount("weapon_smg_silenced_spawn","17"); UpdateEntCount("weapon_sniper_awp_spawn","17"); UpdateEntCount("weapon_sniper_military_spawn","17"); UpdateEntCount("weapon_sniper_scout_spawn","17"); UpdateEntCount("weapon_grenade_launcher_spawn", "17"); UpdateEntCount("weapon_spawn", "17"); //random new l4d2 weapon UpdateEntCount("weapon_chainsaw_spawn", "4"); UpdateEntCount("weapon_defibrillator_spawn", "4"); UpdateEntCount("weapon_first_aid_kit_spawn", "4"); UpdateEntCount("weapon_melee_spawn", "4"); //pistol spawns come in two flavors stacks of 5, or multiple singles props UpdateEntCount("weapon_pistol_spawn", "16"); //defaults 1/4/5 //StripAndChangeServerConVarInt("director_pain_pill_density", 12); //default 6 return Plugin_Handled; } public UpdateEntCount(const String:entname[], const String:count[]) //设置指定物品数量 { new edict_index = FindEntityByClassname(-1, entname); while(edict_index != -1) { DispatchKeyValue(edict_index, "count", count); edict_index = FindEntityByClassname(edict_index, entname); } }