Quote:
Originally Posted by Abagail
I don't know why that would cause lag, how-ever it may spam messages if they shoot over, and over with no lag. Maybe add something like this?
pawn Код:
new g_ShotMessage[MAX_PLAYERS];
if(GetPlayerAmmo(playerid) == 0 && g_ShotMessage[playerid] == 0) { ProxDetector(30.0, playerid, "* CLINK *", COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE); SendClientMessage(playerid, COLOUR_GREY, "You are out of ammo for this weapon. You need to load more into it, before you can use it again."); g_ShotMessage[playerid] = 1; } else if(GetPlayerAmmo(playerid) != 0 && g_ShotMessage[playerid] == 1) { g_ShotMessage[playerid] = 0; } return 1;
|
Hmm? When the gun is out of ammo, the gun is automatically removed so it won't spam any messages.