public OnPlayerText(playerid, text[]) { //===============MUTED================================= muted[playerid] = 1; return SendClientMessage(playerid, COLOR_ORANGE, "SERVER: You are muted"); //===============Normal Chat=========================== new string1[128], PName[MAX_PLAYER_NAME]; //Line 1423 GetPlayerName(playerid, PName, sizeof(PName)); format(string1,sizeof(string1),"{40E0D0}{%06x}%s(%d): {FFFFFF}%s",GetPlayerColor(playerid) >>> 8, PName, playerid, text); SendClientMessageToAll(-1, string1); return 0; }
if(muted[playerid] == 1) return SendClientMessage(playerid, COLOR_ORANGE, "SERVER: You are muted");
Код:
if(muted[playerid] == 1) return SendClientMessage(playerid, COLOR_ORANGE, "SERVER: You are muted"); |
new muted[MAX_PLAYERS]; public OnPlayerText(playerid, text[]) { if(muted[playerid] == 1) return SendClientMessage(playerid, COLOR_ORANGE, "SERVER: You are muted"); return 0; } CMD:mute(playerid, params[]) { if(eUser[playerid][e_USER_ADMIN_LEVEL] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You are not a administrator!"); if(eUser[playerid][e_USER_ADMIN_LEVEL] >= 1) { new string[128], id, reason[128]; if(muted[id]) { muted[id] = 1; if(sscanf(params, "uS[128]", id, reason)) return SendClientMessage(playerid, COLOR_ERROR, "USAGE: /mute [playerid] [reason]"); format(string, sizeof(string), "SERVER: %s has been muted by an admin (Reason: %s)", pName(id), reason); SendClientMessageToAll(COLOR_ORANGE, string); } } return 1; }
public OnPlayerText(playerid, text[]) { if(muted[playerid] == 1) return SendClientMessage(playerid, COLOR_ORANGE, "SERVER: You are muted"); new string1[128], PName[MAX_PLAYER_NAME]; //Line 1423 GetPlayerName(playerid, PName, sizeof(PName)); format(string1,sizeof(string1),"{40E0D0}{%06x}%s(%d): {FFFFFF}%s",GetPlayerColor(playerid) >>> 8, PName, playerid, text); SendClientMessageToAll(-1, string1); return 0; }
Код:
public OnPlayerText(playerid, text[]) { if(muted[playerid] == 1) return SendClientMessage(playerid, COLOR_ORANGE, "SERVER: You are muted"); new string1[128], PName[MAX_PLAYER_NAME]; //Line 1423 GetPlayerName(playerid, PName, sizeof(PName)); format(string1,sizeof(string1),"{40E0D0}{%06x}%s(%d): {FFFFFF}%s",GetPlayerColor(playerid) >>> 8, PName, playerid, text); SendClientMessageToAll(-1, string1); return 0; } |
public OnPlayerText(playerid, text[])
{
if(muted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_ORANGE, "SERVER: You are muted");
return 0;//see this
}
new string1[128], PName[MAX_PLAYER_NAME]; //Line 1423
GetPlayerName(playerid, PName, sizeof(PName));
format(string1,sizeof(string1),"{40E0D0}{%06x}%s(%d): {FFFFFF}%s",GetPlayerColor(playerid) >>> 8, PName, playerid, text);
SendClientMessageToAll(-1, string1);
return 0;
}
That doesn't solve my problem nor did I want it to tie into my main chat format.
|
CMD:mute(playerid, params[])
{
if(eUser[playerid][e_USER_ADMIN_LEVEL] >= 1)
{
new string[128], id, reason[128];
if(sscanf(params, "uS[128]", id, reason)) return SendClientMessage(playerid, COLOR_ERROR, "USAGE: /mute [playerid] [reason]");
if(mute[id] == 0)
{
muted[id] = 1;
format(string, sizeof(string), "SERVER: %s has been muted by an admin (Reason: %s)", pName(id), reason);
SendClientMessageToAll(-1, string);
}
else return SendClientMessage(playerid,COLOR_ERROR,"The specified player is already muted.");
}
else return SendClientMessage(playerid, -1, "You are not a administrator!");
return 1;
}
scm will not return 0 lol here's what you actually need to do
PHP код:
|
This fixed it, thank you I repped you & everyone else that tried to help.
|
if(eUser[playerid][e_USER_ADMIN_LEVEL] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You are not a administrator!");
if(eUser[playerid][e_USER_ADMIN_LEVEL] >= 1)
{
hang on you made a mistake on your CMD, first of all if you did this:
PHP код:
PHP код:
|