/mute and /unmute - 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: /mute and /unmute (
/showthread.php?tid=418356)
/mute and /unmute -
mittukuttan - 24.02.2013
with sscanf+zcmd plz.
Re: /mute and /unmute -
jiwan - 24.02.2013
better move this to script request thread.
Re: /mute and /unmute -
GoldZoroGrab - 24.02.2013
pawn Код:
new mute[MAX_PLAYERS];
command(mute, playerid, params[])
{
new ID;
if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /mute [id]");
else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, ROJO, "Player is not connected");
else
{
if(mute[ID]==0)
{
mute[ID]=1;
SendClientMessage(ID, 0xFF0000AA, "You have been muted.");
}
else SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player already muted.");
}
return 1;
}
pawn Код:
command(unmute, playerid, params[])
{
new ID;
if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /mute [id]");
else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, ROJO, "Player is not connected");
else
{
if(mute[ID]==1)
{
SendClientMessage(ID, 0xFF0000AA, "You have been unmuted.");
mute[ID]=0;
}
else SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player isn't muted.");
}
return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
if(mute[playerid]==1)
{
SendClientMessage(playerid, 0xC0C0C0FF, "You are muted and cannot talk.");
return 0;
}
return 1;
}
Re: /mute and /unmute -
mittukuttan - 25.02.2013
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1375) : error 017: undefined symbol "reason"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1375) : error 017: undefined symbol "BLANCO"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1376) : error 017: undefined symbol "ROJO"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1391) : error 017: undefined symbol "reason"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1391) : error 017: undefined symbol "BLANCO"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1392) : error 017: undefined symbol "ROJO"
Re: /mute and /unmute -
Blaeks - 25.02.2013
Код:
CMD:mute(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new Msg[128], Name[24], OtherPlayer;
if (sscanf(params, "u", OtherPlayer)) return SCM(playerid, CRVENA, "usage: /mute [playerid");
GetPlayerName(OtherPlayer, Name, sizeof(Name));
SetPVarInt(OtherPlayer,"Muted",1);
format(Msg, 128, "player %s is muted.", Name);
SCMTA(-1, Msg);
}
else SCM(playerid, -1, "you arent admin !");
return 1;
}