01.12.2014, 07:26
Hi again,
I am making a mute command, I was wondering how I can transfer the time the admin types in to the actual timer itself.Like for example, admin types /mute 0 30 test, it sets a specific timer for that player and it sets the timer time to what the admin typed.
My code.
How would I do that? Any suggestions are always helpful!
I am making a mute command, I was wondering how I can transfer the time the admin types in to the actual timer itself.Like for example, admin types /mute 0 30 test, it sets a specific timer for that player and it sets the timer time to what the admin typed.
My code.
pawn Код:
CMD:mute(playerid, params[])
{
new target;
new reason;
new time;
if(PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid,-1,"You are not allowed to use this command");
if(sscanf(params, "uds[256]",target, time,reason)) return SendClientMessage(playerid, -1,"Usage: /mute [playerid] [time] [reason]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "This player is not connected!");
new name[MAX_PLAYER_NAME];
new targetname[MAX_PLAYER_NAME];
GetPlayerName(playerid, name,sizeof(name));
GetPlayerName(target, targetname,sizeof(targetname));
new str35[200];
format(str35,sizeof(str35), "%s %s has muted %s for %d seconds. Reason:%s",AdminLevel(playerid),name,targetname,time,reason);
SetTimerEx("UnMute",false,"d","i",time,targetid);
return 1;
}
