Time based commands?
#1

I'm planning to make a cop suspension command, for a certain amount of days/weeks. Now I'm wondering, what's the most efficient way to do it.

I already have weapon licenses with a time system (they're valid one month) and I store day, month and year in a player variable and player's user file (I use gettime() ).

Is there a more efficient way to do this, so I don't have to use 3 variables just for one thing?
Reply
#2

i think this is the fastest way.. i can't think of another way than the gettime() way..
Reply
#3

you could do it like this, i do it like this, don't know if it's faster tho:

pawn Код:
new second, minute, hour, time[10];
gettime(hour, minute, second);
format(time, sizeof(time), "%i:%i:%i", hour, minute, second);
//save this variable (time)
//then to split it up you use sscanf

//othe function
new second, minute, hour;
sscanf(/*your saved variable here*/,"p<:>ddd",hour,minute,second);

//then you can use the different variables again but you only need to save one variable (but it's a string)
Hope i helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)