gettime question
#1

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?
Reply
#2

I'd use SetTimerEx for that (of course on disconnecting of a player, I'd kill the timer).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)