[Open]
[Close]
我想問下doubleitems.SP既源碼問題..PLZ
問題就係幾行係改藥包數量?
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdktools_functions>
#include <adminmenu>
#define PLUGIN_VERSION "3.0.0"
#define CVAR_FLAGS FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY
new Handle:sm_l8d_doubleitems = INVALID_HANDLE;
public Plugin:myinfo =
{
name = "doubleitems",
author = "Mad_Dugan & DDR Khat & Wind",
description = "l4d2 doubleitems",
version = PLUGIN_VERSION,
url = "http://forums.alliedmods.net/showthread.php?t=89422"
};
public OnPluginStart()
{
/*
new host;
host = GetConVarInt(FindConVar("hostip"));
// 977119173 是深圳服务器
// -1062731419 是本地笔记本服务器
// -1062731420 台式机的
// -1062700088 网吧的
// 群里小猪IP -1062731775
// 游侠会员 xianshibao -1062731512
// 游侠会员 xfmmlove -1062731775
// 游侠会员 mighty 1039434310
// 清风MM 2030784975
// if(host == 977119173 || host == -1062731419 || host == -1062731420 || host == -1062700088)
if(host == 977119173 || host == -1062731419 || host == -1062731420 || host == -1062700088 || host == 2030784975)
{
*/
LogAction(0, -1, "验证通过,欢迎使用LxD插件,反馈信息请联系QQ:264590.");
SetConVarInt(FindConVar("sv_steamgroup"), 1096818);
sm_l8d_doubleitems = CreateConVar("sm_l8d_doubleitems", "1", "双重补给", FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);
HookEvent("round_start", Event_RoundStart);
LoadTranslations("common.phrases");
return;
/*
}
else
{
LogAction(0, -1, "验证失败,内侧插件不外放.");
return;
}
*/
}
public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
CreateTimer(1.0, UpdateCounts);
return Plugin_Continue;
}
public Action:UpdateCounts(Handle:timer)
//public UpdateCounts()
{
// LogAction(0, -1, "DEBUG:updatecounts 段落");
new bool:bDoubleItemCounts = (GetConVarInt(sm_l8d_doubleitems) == 1);
if(bDoubleItemCounts)
{
PrintToChatAll("\x05[SM] LeftXDead2 多重补给品加载完毕.");
// update fixed item spawn counts to handle 8 players
// These only update item spawns found in starting area/saferooms
UpdateEntCount("weapon_pumpshotgun_spawn","17"); // defaults 4/5
UpdateEntCount("weapon_smg_spawn", "17"); // defaults 4/5
UpdateEntCount("weapon_rifle_spawn", "17"); // defaults 4/5
UpdateEntCount("weapon_hunting_rifle_spawn", "17"); // default 4/5
UpdateEntCount("weapon_autoshotgun_spawn", "17"); // default 4/5
UpdateEntCount("weapon_first_aid_kit_spawn", "8"); // default 1
// 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
}
else
{
ResetConVar(FindConVar("director_pain_pill_density"));
}
}
public UpdateEntCount(const String:entname[], const String:count[])
{
// LogAction(0, -1, "DEBUG:updateentcount 段落");
new edict_index = FindEntityByClassname(-1, entname);
while(edict_index != -1)
{
DispatchKeyValue(edict_index, "count", count);
edict_index = FindEntityByClassname(edict_index, entname);
}
}