// C:\Users\User\Desktop\comp\scripting\SnowballDropFix.sp(5) : error 001: expected token: "-identifier-", but found ","
// C:\Users\User\Desktop\comp\scripting\SnowballDropFix.sp(25) : error 001: expected token: ")", but found "{"
// C:\Users\User\Desktop\comp\scripting\SnowballDropFix.sp(30) : warning 217: loose indentation
// C:\Users\User\Desktop\comp\scripting\SnowballDropFix.sp(35) : error 017: undefined symbol "SZF"
// C:\Users\User\Desktop\comp\scripting\SnowballDropFix.sp(38) : error 017: undefined symbol "AcceptEntityInput"
PHP:
#include <sdktools_entinput>
#define SZF(%0) %0, sizeof(%0)
Handle hTimer;
int iWeapon;
public void OnPluginStart()
{
iWeapon = FindSendPropInfo("CBaseCombatWeapon", "m_hOwnerEntity");
}
public void OnMapStart()
{
hTimer = CreateTimer(30.0, timer_del_snow, _, TIMER_REPEAT);
}
public void OnMapEnd()
{
delete hTimer;
}
Action timer_del_snow(Handle timer)
{
int iMaxEntities = GetMaxEntities();
char sWeapon[64];
for(int i = MaxClients; i < iMaxEntities; i++)
{
if(IsValidEdict(i) && IsValidEntity(i))
{
GetEdictClassname(i, sWeapon, sizeof sWeapon);
if((StrContains(sWeapon, "weapon_snowball") != -1) && GetEntDataEnt2(i, iWeapon) == -1)
{
RemoveEdict(i);
}
}
}
return Plugin_Continue;
}
public Action CS_OnCSWeaponDrop(int iClient, int iWeapon)
{
char sWeapon[32]; GetEdictClassname(iWeapon, SZF(sWeapon));
if(StrEqual(sWeapon, "weapon_snowball"))
{
AcceptEntityInput(iWeapon, "Kill");
}
return Plugin_Continue;
}
Последнее редактирование: