public OnPlayerUpdate(playerid)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 20.0)
{
ApplyAnimationEx(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid, COLOR_GREY, " You are on auto-crack mode type /suicide or Wait for EMS");
}
return 1;
}
|
Its keep spamming the SendClientMessage(playerid, COLOR_GREY, " You are on auto-crack mode type /suicide or Wait for EMS"); How can i fix that? |
public OnPlayerUpdate(playerid)
{
if(!playersOnCrack[playerid])
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 20.0)
{
ApplyAnimationEx(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid, COLOR_GREY, " You are on auto-crack mode type /suicide or Wait for EMS");
playersOnCrack[playerid] = 1;
}
}
return 1;
}