Hello! I have a problem with my code.
I'm trying to write a plugin, which gives a flshband and additional 10HP at start of round. It didn't work without timer, so i decided to add it. But then occurred that error: "error 100: function prototypes do not match".
Could you look at my code, and help me, what am I doing wrong?
PHP Code:
public void OnPluginStart()
{
HookEvent("player_spawn", PlayerSpawn);
}
int offsetFlash;
public void OnMapStart()
{
int entindex;
entindex = CreateEntityByName("weapon_flashbang");
DispatchSpawn(entindex);
offsetFlash = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
AcceptEntityInput(entindex, "Kill");
}
public Action PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
if(!IsPlayerVIP(client)) return;
vipid = client;
CreateTimer(1.0, VipSpawn, client);
//SetEntityHealth(client, 110);
//for(int x = 0; x < 1; x++)
// if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetFlash) < 1) GivePlayerItem(client, "weapon_flashbang");
}
public void VipSpawn(int client)
{
SetEntityHealth(client, 110);
for(int x = 0; x < 1; x++)
if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetFlash) < 1) GivePlayerItem(client, "weapon_flashbang");
}
stock bool IsPlayerVIP(int client)
{
if(GetUserFlagBits(client) & ADMFLAG_CUSTOM5)
return true;
return false;
}