need help with this timer - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: need help with this timer (
/showthread.php?tid=169329)
need help with this timer -
mrcoolballs - 19.08.2010
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
Re: need help with this timer -
playbox12 - 19.08.2010
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
Re: need help with this timer -
mrcoolballs - 19.08.2010
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
Re: need help with this timer -
vital2k - 19.08.2010
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.
Re: need help with this timer -
Dark_Kostas - 19.08.2010
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;
}
Re: need help with this timer -
mrcoolballs - 19.08.2010
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
Re: need help with this timer -
playbox12 - 19.08.2010
The timer is set on 60.000 MS, so its 10 minutes not one..
Re: need help with this timer -
mrcoolballs - 19.08.2010
well if 1000 milliseconds is 1 second that means that 60000 is 1 minute