Spamming Message
#1

Код:
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;
}
Quote:

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?

Reply
#2

use onplayertakedeath instead

http://pastebin.com/rxxYvygW

+rep if i helped
Reply
#3

Quote:
Originally Posted by chrism11
Посмотреть сообщение
use onplayertakedeath instead

http://pastebin.com/rxxYvygW

+rep if i helped
Animation dosent apply.
Reply
#4

because you have the script under OPU which gets called a lot, you need to store a variable like...

pawn Код:
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;
}
and then unset it when they get healed or die ect.
Reply
#5

Understand now Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)