13.04.2015, 14:50
Timestamps.
Make sure you clear the variable upon connection:
This will only send the warning every 60 seconds a player is shooting. Change "60" to your time.
pawn Код:
new g_FiredTime[MAX_PLAYERS];
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if ((gettime() - g_FiredTime[playerid]) > 60)
{
// alert cops
g_FiredTime[playerid] = gettime();
}
return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
g_FiredTime[playerid] = 0;
}
