How can I do it?
#1

Hello,

I wan to know how do I make an order you can do it every 10 minutes even if He comes and goes.

sorry on my bad english.
Reply
#2

You can do it with a timer and a global variable, something like this:
pawn Код:
new CanDoOrder[MAX_PLAYERS]; //On top of your script
public OrderCompletedCallback(playerid) // Think of this of the callback or code where the order is completed
{
    CanDoOrder[playerid] = 0;
    SetTimerEx("CanDoOrderAgain",600000,0,"i",playerid);
}
public CanDoOrderAgain(playerid) //This is the callback which will enable the orders again
{
    CanDoOrder[playerid] = 1;
}
Then just check before the player attempts to do the order if the CanDoOrder variable is 1, if it isn't, send a message to the player that he has to wait.
If you're using the idea from above, be sure to add CanDoOrder[playerid] = 1; under OnPlayerConnect.
Also, please note that timers are slightly out of sync, to fix this, czech the fixes2 plugin.
Reply
#3

Quote:
Originally Posted by Jstylezzz
Посмотреть сообщение
You can do it with a timer and a global variable, something like this:
pawn Код:
new CanDoOrder[MAX_PLAYERS]; //On top of your script
public OrderCompletedCallback(playerid) // Think of this of the callback or code where the order is completed
{
    CanDoOrder[playerid] = 0;
    SetTimerEx("CanDoOrderAgain",600000,0,"i",playerid);
}
public CanDoOrderAgain(playerid) //This is the callback which will enable the orders again
{
    CanDoOrder[playerid] = 1;
}
Then just check before the player attempts to do the order if the CanDoOrder variable is 1, if it isn't, send a message to the player that he has to wait.
If you're using the idea from above, be sure to add CanDoOrder[playerid] = 1; under OnPlayerConnect.
Also, please note that timers are slightly out of sync, to fix this, czech the fixes2 plugin.
Thanks, but look what I had write, I wanna this turn on when he comes and goes (dini,DOF2....)
Reply
#4

Comes and goes like, how? Going offline and online?
Reply
#5

Yes, sorry on my bad English..
Reply
#6

Please help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)