Need help making a timer.
#1

Quote:

else if(IsPlayerInRangeOfPoint(playerid, 10.0, SFX, SFY, SFZ) && PLANESTAGE[playerid] == SFA)
{
new string[64];
format(string, sizeof(string), "Your Passengers Are Boarding The plane(I want to add a 30 second timer ) ",);
SendClientMessage(playerid, COLOR_ORANGE, string);
PLANESTAGE[playerid] = LVB;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -1370.4148, -224.8594, 13.8710, 10.0);
GivePlayerMoney(playerid, MONEY_EARNT);
}

if someone could help make a timer itd be much appreciated, Also if you could make a random timer say from 20-50 seconds thatd be even better,

Thanks in advance
Reply
#2

Код:
if(IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z) &&  PLANESTAGE[playerid] == SFA)
{
new string[64], disable;
format(string, sizeof(string), "Your Passengers Are Boarding The plane(I want to add a 30 second timer ) ",);
SendClientMessage(playerid, COLOR_ORANGE, string);
PLANESTAGE[playerid] = LVB;
SetTimer("disable",20000,20000,true); // 20 second for stop ; Will restart after 20 seconds again; Disable checks after 20sec and re-enable after 20seg, and so over and over.
disable = DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -1370.4148, -224.8594, 13.8710, 10.0);
GivePlayerMoney(playerid, MONEY_EARNT);
}
Reply
#3

Setting 20,000 in the bool:repeat argument of the function won't work.
Reply
#4

Код:
if(IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z) &&  PLANESTAGE[playerid] == SFA)
{
new string[64], dxx, exx;
format(string, sizeof(string), "Your Passengers Are Boarding The plane(I want to add a 30 second timer ) ",);
SendClientMessage(playerid, COLOR_ORANGE, string);
PLANESTAGE[playerid] = LVB;
dxx =  DisablePlayerCheckpoint(playerid);
exx = SetPlayerCheckpoint(playerid, -1370.4148, -224.8594, 13.8710, 10.0);
GivePlayerMoney(playerid, MONEY_EARNT);
}
Код:
forward enable(); // top
Код:
forward disable(); // top
Код:
public enable()
{
SetPlayerCheckpoint(playerid, -1370.4148, -224.8594, 13.8710, 10.0);
SetTimer("disable",20000,true);
return 1;
}
public disable()
{
DisablePlayerCheckpoint(playerid, exx);
SetTimer("enable",20000,true);
return 1;
}
If not it I dont know, sorry
Reply
#5

Quote:
Originally Posted by felipex
Посмотреть сообщение
Код:
if(IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z) &&  PLANESTAGE[playerid] == SFA)
{
new string[64], disable;
format(string, sizeof(string), "Your Passengers Are Boarding The plane(I want to add a 30 second timer ) ",);
SendClientMessage(playerid, COLOR_ORANGE, string);
PLANESTAGE[playerid] = LVB;
SetTimer("disable",20000,20000,true); // 20 second for stop ; Will restart after 20 seconds again; Disable checks after 20sec and re-enable after 20seg, and so over and over.
disable = DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -1370.4148, -224.8594, 13.8710, 10.0);
GivePlayerMoney(playerid, MONEY_EARNT);
}
They both just crash my pawn
Reply
#6

Quote:
Originally Posted by Hayden_Bruin
Посмотреть сообщение
This just crashes my pawn.
Crash for adding a script? Hm.
Reply
#7

Quote:
Originally Posted by Nimnix
Посмотреть сообщение
Crash for adding a script? Hm.
Yeh i try compile it, and it just crashes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)