[HELP] zone and timers
#1

i make this code

public provazone(playerid)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X >= 1331.278 && X <= 2207.118 && Y >= -2755.979 && Y <= -2125.373)
{
SendClientMessage(playerid,COLOR_RED,"sei nella stunt zone");
print("stunt zone!");
}
return 1;
}

and this code show a SendClientMessage(playerid,COLOR_RED,"sei nella stunt zone"); when u are in stunt zone but it show every one second XD how to show this 1 times ? with the timer to 1 sec
Reply
#2

Finally someone who has the same problem as me! I need help with timers also
Reply
#3

no one plz i need it
Reply
#4

Make a variable. Set it to 1 if he's in the zone already, if he is in the zone already, don't send the message.
Reply
#5

this make some lag set 1000000 times to 1 ?
Reply
#6

Can you give the code when you use the provazone(playerid)
Reply
#7

i dont understand what u want
Reply
#8

Код:
new IsInZone[MAX_PLAYERS];
forward provazone(playerid);
public provazone(playerid)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X >= 1331.278 && X <= 2207.118 && Y >= -2755.979 && Y <= -2125.373 && IsInZone[playerid] == 0)
{
IsInZone[playerid] = 1;
SendClientMessage(playerid,COLOR_RED,"Welcome to the stunt zone!");
}
return 1;
}
should work also add a check to see if the player isnt in the zone sos you could set IsInZone to 0 again
Reply
#9

this set 100000000000 times to 1 and send 1000000000 times the message lol
Reply
#10

Nope it dosn't cause it checks if player already is in zone, if he is the code sends a message. if message already sent it won't send.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)