SA-MP Forums Archive
SetTimerEx-Crashes server, what bit is wrong? - 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: SetTimerEx-Crashes server, what bit is wrong? (/showthread.php?tid=72167)



SetTimerEx-Crashes server, what bit is wrong? - Badger(new) - 06.04.2009

I have a mute command that uses SetTimerEx so i can make sure the right player is unmuted.

here it is:
Код:
forward MuteTimer(playerid);

//Function: Mute
public Mute(playerid, admin[], reason[], time)
{
	new MTime[32];
	new Admin=strval(admin);
	new Reason=strval(reason);
	PINFO[playerid][Muted]=1;
 	new string[84];
 	GetPlayerName(playerid,PNAME,sizeof(PNAME));
 	format(string,sizeof(string),"Mute: Admin:%s: %s has been Muted for %s: %s seconds",Admin,PNAME,Reason,time);
 	SendClientMessageToAll(RED,string);
 	SendClientMessage(playerid,RED,"///Punishment: You have been muted! Please read (/rules) so it wont happen again.");
 	format(MTime,sizeof(MTime),"%s",time);
 	SetTimerEx("MuteTimer", 5000, false,"s",playerid);
	return 1;
}
Код:
//Function: Mute Timer
public MuteTimer(playerid)
{
	PINFO[playerid][Muted]=0;
	SendClientMessage(playerid,RED,"You have finished your Mute time. Please make sure that you follow the (/rules) so it wont happpen again!");
	return 1;
}



Re: SetTimerEx-Crashes server, what bit is wrong? - Nubotron - 06.04.2009

playerid is a integer not a string (and same for time)


Re: SetTimerEx-Crashes server, what bit is wrong? - Badger(new) - 06.04.2009

ahh i see. silly mistake :P. thanks very much it's working perfectly now.