11.02.2013, 23:17
look at script when civil can shoot a plaayer or cop so they spam i want make it they don't spam
i added timer system but didn;t worked. "shotsfired{playerid} = SetTimerEx("shotsfired", 100000, true, "d", i);"
and pls make it they dnt spamming after 3 shoot and then see that msg to player
PHP код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(GetTeam{playerid} == CLASS_CIV && IsPlayerHoldingAGun(playerid) == 1)
{
foreach(Player, i)
{
shotsfired[playerid] += 2;
if(shotsfired[playerid] == 1 && shotsfired[playerid] != 1)
{
new current_zone, string[150];
current_zone = Player_Zone[playerid];
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 3);
format(string, sizeof(string), "Crime in progress! %s (%d) has assaulted %s (%d) with a deadly weapon - Location: %s", GetName(playerid), playerid, GetName(damagedid), damagedid, ZoneNames[current_zone][zone_name]);
CopRadio(LIGHTBLUE, string);
format(fstr, sizeof(fstr), "Committed A Crime: Assault With A Deadly Weapon - Wanted Level %d - Ticketable", GetPlayerWantedLevel(playerid));
SendClientMessage(playerid, YELLOW, string);
shotsfired[playerid] = 1;
shotsfired{playerid} = SetTimerEx("shotsfired", 100000, true, "d", i);
}
else
{
new current_zone, string[150];
current_zone = Player_Zone[playerid];
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 6);
format(string, sizeof(string), "Crime in progress! %s (%d) has assaulted %s (%d) with a deadly weapon - Location: %s", GetName(playerid), playerid, GetName(damagedid), damagedid, ZoneNames[current_zone][zone_name]);
CopRadio(LIGHTBLUE, string);
format(fstr, sizeof(fstr), "Committed A Crime: Assault With A Deadly Weapon - Wanted Level %d - Arrestable", GetPlayerWantedLevel(playerid));
SendClientMessage(playerid, RED, fstr);
shotsfired[playerid] = 1;
shotsfired{playerid} = SetTimerEx("shotsfired", 100000, true, "d", i);
}
}
}
return 1;
}
and pls make it they dnt spamming after 3 shoot and then see that msg to player