How do I make an order you can do it every 10 minutes - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How do I make an order you can do it every 10 minutes (
/showthread.php?tid=374312)
How do I make an order you can do it every 10 minutes -
GuyYahood1 - 02.09.2012
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.
Re: How do I make an order you can do it every 10 minutes -
mamorunl - 02.09.2012
You can set a variable with getTickCount (which stores the current time) or you can set a timer of 10 minutes and then reset your variable.
Respuesta: How do I make an order you can do it every 10 minutes -
GuyYahood1 - 02.09.2012
Can you give me exmaple? I want use dini for that's
Re: How do I make an order you can do it every 10 minutes -
mamorunl - 02.09.2012
"Comes and goes" is entering and leaving the server?
then you can do something like this:
pawn Код:
OnConnect() {
noOrder[playerid] = dini_Int("noOrder");
if(noOrder[playerid] != 0) {
timer = SetTimerEx("wait", noOrder[playerid] * 10000, "i", playerid); // mins * 10000 (because timer is in millisecs)
print("You still had time left");
}
}
OnCommand() {
CMD:order() {
// I order now:
noOrder[playerid]=10;
timer = SetTimerEx("wait", 60000, 1, "i", playerid);
print("Wait 10 mins now");
}
}
forward wait(playerid);
public wait(playerid) {
if(noOrder != 0){
noOrder -= 1; // every minute subtract 1 min
} else {
DestroyTimer(timer);
}
}
OnDisconnect() {
// use dini to save the variable
dini_setInt("noOrder", noOrder[playerid]);
if(timer) {
DestroyTimer(timer);
}
// and your other saving stuff
}
Something like that xD It is far from complete and it doesnt look like anything even worthy of using, but I hope you catch the hint XD
Names from callbacks are shortened and the command is just where you order. Can be anything but you have to implement something like that.
Respuesta: How do I make an order you can do it every 10 minutes -
GuyYahood1 - 02.09.2012
thank you very much!
(sorry on my bad english)