How i can make mute cmd with reason - 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)
+--- Thread: How i can make mute cmd with reason (
/showthread.php?tid=395115)
How i can make mute cmd with reason -
Hugoca - 25.11.2012
I wanna to make my cmd /mute with reason and then when i mute Player to get message "Nick was muted by [KOD]MrTinder for 20 minutes,Reason:Test".Thanks
pawn Код:
if(strcmp(cmd, "/mute", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /mute [Playerid/PartOfName] [time] [reason]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new time = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(PlayerInfo[playa][pAdmin] > PlayerInfo[playerid][pAdmin])
{
SendClientMessage(playerid, COLOR_GREY, "You can't mute higher admin level!");
return 1;
}
if(playa != INVALID_PLAYER_ID)
{
PlayerInfo[playa][ptMuted] = time*60;
PlayerInfo[playa][pMuted] = 1;
format(string, sizeof(string), "ADMIN: %s was muted by %s for %d minutes",PlayerName(playa), PlayerName(playerid), time);
SendClientMessageToAll(COLOR_LIGHTRED,string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You didn't have admin access!");
}
}
return 1;
}
Re: How i can make mute cmd with reason -
GoldZoroGrab - 25.11.2012
public OnPlayerText(playerid, text[])
{
if[playa][pMuted]>=1
SendClientMessage(playerid, RED, "You Are Muted, So You Can't Chat");
return 0;
}