Getting time left help
#1

I created a mute command now i want to show time left to the player till he can be unmuted,how can i do this,i tried searching but didn't find good results and some of them are confusing for me..

if you could help me,i would be thankful to you
Reply
#2

You can use unix timestamps.

For example,
pawn Код:
PlayerInfo[playerid][pMutedTime] = gettime()+minutes*60; // Setting the time based on a minute variable
pawn Код:
if(PlayerInfo[playerid][pMuteTime] >= gettime())
{
       PlayerInfo[playerid][pMuted] = 0;
}
But if a user logs off they can manipulate the system so you'd need to store the minutes left somewhere if you use timestamps.
Reply
#3

I would suggest to use gettime as Abagail did and if you mute player for example 5 min and player leave after some mins,you can stop timer and save mins remaining and when player come back online to start timer with remaining mins.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)