need help with this timer
#1

okay so i have made a /mute command which works perfectly but i want to change it so i dont have to /unmute
i want to put a timer on it for 10 minutes, ive got the timer set up but how do i link it so at the end of the timer my thing

PlayerInfo[Muted] gets set back to 0 and he can talk again, i have it so it gets set to 1 when i type /mute but i want it at the end of the 10 minutes it to be set back to 0, anyone get what i mean?

how would i do that
Reply
#2

pawn Код:
forward NAMETIMER();
 
public OnPlayerCommandText()
{
    THE /MUTE COMMAND
    SetTimer("NAMETIMER",60000,false);
}
 
public NAMETIMER()
{
    CODE TO SET IT MUTE BACK TO 0
}
Untested but it should work
Reply
#3

it needs to unmute the player that i muted so in my mute thing on the timer so your saying it would be like this

Код:
public MuteTimer();
{
    PlayerInfo[playerid][muted] = 0
    return 1;
}
?? wouldnt i have to write something else in the playerid thing instead of playerid, like getplayername or something
Reply
#4

Yeah, because your not using settimerex your not passing any variables/arrays through. Plus on the /mute command make it mute and on the time make it unmute.
Reply
#5

pawn Код:
SetTimerEx("MuteTimer", 60000, false, "i", playerid);
//Put this in your mute command and change the playerid, with the name you use to mute someone, example "otherid"
pawn Код:
//Change the MuteTimer with this one
public MuteTimer(playerid);
{
    PlayerInfo[playerid][muted] = 0;
    return 1;
}
Reply
#6

It compiles fine but when i tested it out i waited 1 minute and it didn't unmute me or send me a message saying "You have been unmuted
Reply
#7

The timer is set on 60.000 MS, so its 10 minutes not one..
Reply
#8

well if 1000 milliseconds is 1 second that means that 60000 is 1 minute
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)