CMD:o(playerid, params[])
{
new sendername[MAX_PLAYER_NAME], string[160];
if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SendClientMessage(playerid, COLOR_NOAUTH, "You are not authorized to use this command.");
if(isnull(params)) return SendClientMessage(playerid, COLOR_NOAUTH,"USAGE: /o [chat]");
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "The OOC channel has been disabled by an administrator.");
return 1;
}
GetPlayerName(playerid,sendername,sizeof(sendername));
sendername[strfind(sendername,"_")] = ' ';
format(string,160,"[OOC]: %s: %s", sendername, params);
printf("%s", string);
OOCOff(COLOR_OOC,string);
return 1;
}
CMD:noooc(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1 && (!noooc))
{
noooc = 1;
SendClientMessageToAll(COLOR_GRAD2, "The OOC chat has been disabled by an admin.");
}
else if (PlayerInfo[playerid][pAdmin] >= 1 && (noooc))
{
noooc = 0;
SendClientMessageToAll(COLOR_GRAD2, "The OOC chat has been enabled by an admin.");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
}
return 1;
}
public OOCOff(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(!gOoc[i])
{
SendClientMessage(i, color, string);
}
}
}
}
error 035: argument type mismatch (argument 2)
error 035: argument type mismatch (argument 2)
if(sscanf(params,"uz",id,reason)) return SendClientMessage(playerid, COLOR_GREY,"USAGE: /kick [playerid/partofname] [reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY,"Invalid player id");
CMD:kick(playerid,params[])
{
new id,name1[MAX_PLAYER_NAME], reason[35],name2[MAX_PLAYER_NAME], string[128];
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_NOAUTH,"You are not authorized to use this command.");
if(sscanf(params,"uz",id,reason)) return SendClientMessage(playerid, COLOR_GREY,"USAGE: /kick [playerid/partofname] [reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY,"Invalid player id");
else
{
GetPlayerName(playerid,name1,sizeof(name1));
GetPlayerName(id,name2,sizeof(name2));
format(string, sizeof(string),"AdmCmd: %s was kicked by %s, reason: %s",name2,name1,reason);
SendClientMessageToAll(COLOR_LIGHTRED,string);
Kick(id);
}
return 1;
}
if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SendClientMessage(playerid, COLOR_NOAUTH, "You are not authorized to use this command.");
pawn Код:
not >= 1 is 0 or less. That is why normal players can't use /o. |
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "The OOC channel has been disabled by an administrator.");
return 1;
}
Forgot you have this in the code?
pawn Код:
|
if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid, COLOR_GREY,"USAGE: /kick [playerid/partofname] [reason]");
Try s instead of z
pawn Код:
|