//at top of script
#include <zcmd>
forward UnmutePlayer(playerid);
new Muted[MAX_PLAYERS];
zcmd(mute, playerid, params[]) //with time in minutes
{
if(IsPlayerAdmin(playerid))
{
new mplayer, time, reason[96];
if(!sscanf(params, "uis", mplayer, time, reason))
{
Muted[mplayer] = 1;
SetTimerEx("UnmutePlayer", false, 60000*time, "i", playerid);
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "You were muted by %s for %d minutes. Reason: %s", name, time, reason);
SendClientMessage(mplayer, 0xFF3300FF, string);
return 1;
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /mute [id/partname] [time in minutes] [reason]);
}
else return SendClientMessage(playerid, 0xFF3300FF, "ERROR: You are not an admin and may not use this command!");
}
public UnmutePlayer(playerid)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You have been unmuted.");
Muted[playerid] = 0;
}
public OnPlayerText(playerid, text[])
{
if(Muted[playerid]) SendClientMessage(playerid, 0xFF3300FF, "SERVER: You are muted and may not speak!"), return 0;
else return 1;
}
if (strcmp("/Mute",cmdtext,true) == 0);
|
No he Said Strcmp
So change it to pawn Код:
|
if (strcmp("/Mute",cmdtext,true) == 0)
...C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23087) : error 037: invalid string (possibly non-terminated string) C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23092) : error 017: undefined symbol "params" C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23096) : warning 219: local variable "string" shadows a variable at a preceding level C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23102) : error 037: invalid string (possibly non-terminated string) C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23102) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23102) : error 017: undefined symbol "mute" C:\Documents and Settings\Administrator\Desktop\The Godfather GM\gamemodes\gf.pwn(23102) : fatal error 107: too many error messages on one line