CMD:mute(playerid, params[])
{
new
targetid,
reason[128],
string[200],
string2[200];
if (!IsPlayerAdmin(playerid) && AccInfo[playerid][aLevel] < 3)
return SendClientMessage(playerid, orange, " - Only "cgreen"Level 3+"corange" can perform this command - ");
if(sscanf(params,"us[128]", targetid, reason))
return SendClientMessage(playerid, orange," - Usage: "cblue"\"/MUTE [playerid] [Reason]\" "corange" - Will prevent a player from chatting -");
if(targetid == INVALID_PLAYER_ID)
return SendClientMessage(playerid, orange, " - - - - - Player was not found online / Wrong name/id - - - - - -");
if(targetid==playerid)
return SendClientMessage(playerid, red," - Sorry, you can't mute yourself! - ");
if(AccInfo[targetid][aLevel] > 1)
return SendClientMessage(playerid, red, " - It is not possible to mute Administrators -");
if(GetPVarInt(targetid, "muted") == 1)
return SendClientMessage(playerid, blue, " - Selected Player is already muted -");
SetPVarInt(targetid, "muted", 1);
format(string, sizeof(string), " - Administrator "cwhite"%s "corange"Muted You! "cgrey"||"cblue" (Reason: "cwhite"%s"cblue")", PlayerName(playerid), reason);
SendClientMessage(targetid, orange, string);
format(string2,sizeof(string2),"You have muted "cwhite"%s "cblue"Successfully! He will be unmuted automatically", PlayerName(targetid));
SendClientMessage(playerid, blue , string2);
SetTimerEx("UnMute", 1000*UNMUTETIME, false, "i", targetid);
return 1;
}
Is the first post of the sscanf topic, with extensive documentation on all the specifiers, somehow not clear? If so I would be happy to fix up the parts you find confusing if you point them out:
https://sampforum.blast.hk/showthread.php?tid=120356 |