SetTimerEx-Crashes server, what bit is wrong?
#1

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;
}
Reply
#2

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)