SendClientMessage Help, man!
#1

So i'm trying to make my own turf script, and if i fail to stay in point for 30 secs it should send a message "Noob Failed" And it does but it spams me this text 15 times!
Код:
/////Above this i have a function that calls this timer if player entered defined point////////
forward SAMSITEcheck(playerid);
public SAMSITEcheck(playerid)
{
	new timer1;
	SAMSITECheckDelay += 2;
	timer1 = SetTimerEx("SAMSITEcheck", 2000, false, "d", playerid);
	if(SAMSITECheckDelay == 30)
	{
	    GangZoneStopFlashForAll(SAMSITE);
	    if(gTeam[playerid] == EA)
	    {
	        SAMSITEO = 1;
	        SAMSITECheckDelay = 0;
		}
  		if(gTeam[playerid] == AE)
	    {
	        SAMSITEO = 2;
	        SAMSITECheckDelay = 0;
		}
		if(gTeam[playerid] == USA)
	    {
	        SAMSITEO = 3;
	        SAMSITECheckDelay = 0;
		}
		if(gTeam[playerid] == SA)
	    {
	        SAMSITEO = 4;
	        SAMSITECheckDelay = 0;
		}
	}
	if(!IsPlayerInRangeOfPoint(playerid, 3.0, -782.4177, 2417.32, 15))
	{
 	    KillTimer(timer1);
	    SendClientMessage(playerid, COLOR_RED, "Noob :D Failed");///I get this MSG spamed.
	}
}
Reply
#2

Return 1;?
A few of my scripts have spammed some shit or
have not worked at all due to a return not being there...
Reply
#3

Код:
	if(!IsPlayerInRangeOfPoint(playerid, 3.0, -782.4177, 2417.32, 15))
	{
 	    KillTimer(timer1);
	    SendClientMessage(playerid, COLOR_RED, "Noob :D Failed");///I get this MSG spamed.
	}
         return 1;
}
Even with return it spams
Reply
#4

Because player isnt in range of point
Quote:

'' !IsPlayerInRangeOfPoint ''

Timer checks that, and if your not in range of point it will spam that text..
Reply
#5

pawn Код:
forward SAMSITEcheck(playerid);
new RecievedFailMessage[MAX_PLAYERS];
public SAMSITEcheck(playerid)
{
    new timer1;
    SAMSITECheckDelay += 2;
    timer1 = SetTimerEx("SAMSITEcheck", 2000, false, "d", playerid);
    if(SAMSITECheckDelay == 30) {
        GangZoneStopFlashForAll(SAMSITE);
        if(gTeam[playerid] == EA) {
            SAMSITEO = 1;
            SAMSITECheckDelay = 0;
            return 1;
        }
        if(gTeam[playerid] == AE) {
            SAMSITEO = 2;
            SAMSITECheckDelay = 0;
            return 1;
        }
        if(gTeam[playerid] == USA) {
            SAMSITEO = 3;
            SAMSITECheckDelay = 0;
            return 1;
        }
        if(gTeam[playerid] == SA) {
            SAMSITEO = 4;
            SAMSITECheckDelay = 0;
            return 1;
        }
    }
    if(!IsPlayerInRangeOfPoint(playerid, 3.0, -782.4177, 2417.32, 15) && !RecievedFailMessage[playerid]) {
        KillTimer(timer1);
        SendClientMessage(playerid, COLOR_RED, "Noob :D Failed");
        RecievedFailMessage[playerid] = 1;
        return 1;
    } else RecievedFailMessage[playerid] = 0;
}
Reply
#6

maybe your timer makes it spam?
Reply
#7

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
maybe your timer makes it spam?
Of course it is. I fixed it for him in my previous post. Checking a variable, doing some code and changing the variable stops the spam of code. Then changing it back if the conditions are different.
Reply
#8

It still spams me this text....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)