23.02.2013, 18:16
(
Последний раз редактировалось NathNathii; 07.03.2013 в 18:48.
)
// FIXED!
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(7) : warning 202: number of arguments does not match definition
Код:
C:\Users\\Documents\GT Testing\pawno\include\PlayerCommands.inc(7) : warning 202: number of arguments does not match definition |
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF000000, "You must be an admin to use this command!");
Hello again.
Thanks to the guy who scripted this command for me, but when i try to use it in-game it says SERVER: Unknown Command(and makes space in the chat) Код:
CMD:ban(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF000000); new pID, reason[128], playerName[MAX_PLAYER_NAME], adminName[MAX_PLAYER_NAME]; if(sscanf(params, "rs[128]", pID, reason)) return SendClientMessage(playerid, 0xFF000000, "USAGE: /ban [id] [reason]"); if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, 0xFF000000, "This player is not connected."); if(pID == playerid) return SendClientMessage(playerid, 0xFF000000, "You cannot ban yourself."); new string[128]; SendClientMessage(pID, 0xFF000000, "You have been banned from this server!"); format(string, sizeof string, "Reason: %s", reason); SendClientMessage(pID, 0xFF000000, string); GetPlayerName(playerid, adminName, sizeof adminName); format(string, sizeof string, "Admin: %s", adminName); SendClientMessage(pID, 0xFF000000, string); SendClientMessage(pID, 0xFF000000, "If you think this is an unfair ban, create ban appeal at www.GranTrucking.com"); BanEx(pID, reason); GetPlayerName(playerid, playerName, sizeof playerName); format(string, sizeof string, "Admin %s has banned %s. (Reason: %s)", adminName, playerName, reason); SendClientMessageToAll(0xFF0000AA, string); return 1; } |
CMD:ban(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_GREY, "* You need to be admin!");
new id, reason[128], rcmsg[128], pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME], string[128];
if(sscanf(params, "is[128]", id,reason)) return SCM(playerid, COLOR_GREY, "USAGE: /ban [id] [reason]");
if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY, "This player is not connected.");
if(id == playerid) return SCM(playerid, COLOR_GREY, "You cannot ban yourself.");
SendClientMessage(id, COLOR_WHITE, "You have been banned from this server!");
format(string, sizeof string, "Reason: %s", reason);
SendClientMessage(id, COLOR_WHITE, string);
GetPlayerName(playerid, aName, sizeof aName);
format(string, sizeof string, "Admin: %s", aName);
SCM(id, COLOR_WHITE, string);
SCM(id, COLOR_WHITE, "If you think this is an unfair ban, create ban appeal at www.GranTrucking.com");
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof string, "Admin %s has banned %s. (Reason: %s)", aName, pName, reason);
SCMAll(COLOR_WHITE, string);
format(rcmsg, sizeof(rcmsg), "ban %s", id);
SendRconCommand(rcmsg);
Kick(id);
return 1;
}
pawn Код:
|
CMD:ban(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF000000, "You must be an admin to use this command!"); new pID, reason[128], playerName[MAX_PLAYER_NAME], adminName[MAX_PLAYER_NAME]; if(sscanf(params, "rs[128]", pID, reason)) return SendClientMessage(playerid, 0xFF000000, "USAGE: /ban (nick/id) (reason)"); if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, 0xFF000000, "This player is not connected."); if(pID == playerid) return SendClientMessage(playerid, 0xFF000000, "You cannot ban yourself."); new string[128]; SendClientMessage(pID, 0xFF000000, "You have been banned from this server!"); format(string, sizeof string, "Reason: %s", reason); SendClientMessage(pID, 0xFF000000, string); GetPlayerName(playerid, adminName, sizeof adminName); format(string, sizeof string, "Admin: %s", adminName); SendClientMessage(pID, 0xFF000000, string); SendClientMessage(pID, 0xFF000000, "If you think this is an unfair ban, create ban appeal at www.GranTrucking.com"); BanEx(pID, reason); GetPlayerName(playerid, playerName, sizeof playerName); format(string, sizeof string, "Admin %s has banned %s. (Reason: %s)", adminName, playerName, reason); SendClientMessageToAll(0xFF0000AA, string); return 1; }
Thats because of,
if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_GREY, "* You need to be admin!"); Remove that. |