Would this cause lag issues?
#3

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;
Using this, the message is only sent once per ammo outage. Just make sure the variable is also reset on disconnect /connect.
Reply


Messages In This Thread
Would this cause lag issues? - by Dokins - 27.11.2014, 20:29
Re: Would this cause lag issues? - by Patrick - 27.11.2014, 20:34
Re: Would this cause lag issues? - by Abagail - 27.11.2014, 20:34
Re: Would this cause lag issues? - by Patrick - 27.11.2014, 20:36
Re: Would this cause lag issues? - by Dokins - 27.11.2014, 20:40
Re: Would this cause lag issues? - by Abagail - 27.11.2014, 20:46
Re: Would this cause lag issues? - by Patrick - 27.11.2014, 20:47
Re: Would this cause lag issues? - by Dokins - 27.11.2014, 20:48

Forum Jump:


Users browsing this thread: 3 Guest(s)