gettime question - 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: gettime question (
/showthread.php?tid=575639)
gettime question -
Dubya - 28.05.2015
Hello, I am working on a temp-ban system and a better way to determine if it is time to be unmuted/unjailed.
I was wondering if I could just use gettime and set it as a string, for example...
pawn Код:
YCMD:mute(playerid,params[],help) {
blablabla, sscanf
SetPVarInt(playa, "Muted", 1);
SetPVarInt(playa, "MuteTime", gettime()+(hours*3600)); // Would this work?
}
// later on
timer MuteJailTimer[60 * 1000]() {
foreach(Player, i) {
if(GetPVarInt(i, "Muted") > 0) {
new time = GetPVarString(i, "MuteTime");
if(gettime() > time) SetPVarInt(i, "Muted", 0);
}
}
}
Surely this is wrong, how would I do this?
Re: gettime question -
Konstantinos - 28.05.2015
I'd use SetTimerEx for that (of course on disconnecting of a player, I'd kill the timer).