Unknown command with ZCMD - 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: Unknown command with ZCMD (
/showthread.php?tid=409051)
Unknown command with ZCMD -
Sellize - 20.01.2013
What am i doing wrong here? It keeps saying unknown command when im using /mute
http://pastebin.com/Hq93waQc
Re: Unknown command with ZCMD -
zde5 - 20.01.2013
Код:
COMMAND:mute(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
//place your mute code here
}
else SendClientMessage(playerid, COLOR_RED, "You can not use this command!");
return 1;// if you return 0 you will get "unknown command" text
}
Re: Unknown command with ZCMD -
Devilxz97 - 20.01.2013
pawn Код:
CMD:mute(playerid, params[])
{
new id;
new reason[128];
new str[256];
new AdminName[MAX_PLAYER_NAME];
new Target[MAX_PLAYER_NAME];
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't authorized to use this command!");
if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, grey, "Usage:/mute (playerid/partofname) (reason)");
else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!");
else
{
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(id, Target, sizeof(Target));
format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has muted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s. {FF6347}Reason; {B4B5B7}%s .", AdminName, Target, reason);
SendClientMessageToAll(lightred, str);
PlayerInfo[id][isMuted] = 1;
}
return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
if(PlayerInfo[playerid][isMuted] >= 1)
{
SendClientMessage(playerid, lightred, "[INFO]: {B4B5B7}You were muted by an Admin!");
return 0;
}
return 1;
}
pawn Код:
enum pInfo
{
isMuted,
isJailed
}
new PlayerInfo[MAX_PLAYERS][pInfo];