30.12.2011, 16:09
Hello everyone,
I use ZCMD, sscanf and Diler's MultiLanguage include.
When I try to use /kick command without being an admin, first MultiLanguage language returns both !success message and SERVER: Unknown command.
Here is the command:
When this
is used, it returns me 3 messages:
You can't use this command!
There is no such command. Type /cmds for commands list.
SERVER: Unknown command.
Here is my OnPlayerCommandPerformed callback:
I'm out of ideas. Don't know what to do. Could it be MultiLanguage's fault?
I use ZCMD, sscanf and Diler's MultiLanguage include.
When I try to use /kick command without being an admin, first MultiLanguage language returns both !success message and SERVER: Unknown command.
Here is the command:
Code:
COMMAND:kick(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) return 0; //LanguageMessage(playerid, COLOR_RED, LANGUAGE_EN, "You can't use this command!", LANGUAGE_LT, "Negali naudoti рios komandos!"); new pid, reason[105]; if(sscanf(params, "uS(No Reason Given)[128]", pid, reason)) return LanguageMessage(playerid, COLOR_RED, LANGUAGE_EN, ""GREEN"Usage: "WHITE"/kick [playerid/name] [reason].", LANGUAGE_LT, ""WHITE"Naudojimas:"GREEN" /kick [id/vardas] [prieюastis]"); if(IsPlayerConnected(pid) && pid != INVALID_PLAYER_ID && pid != playerid) { new adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], string[180], ltstring[180]; GetPlayerName(pid, paramname, sizeof(paramname)); GetPlayerName(playerid, adminname, sizeof(adminname)); format(string, sizeof(string), "%s has been kicked by %s for: %s", paramname, adminname, reason); format(ltstring, sizeof(ltstring), "%s iрkickino %s uю: %s", adminname, paramname, reason); LanguageMessageToAll(COLOR_LIME, LANGUAGE_EN, string, LANGUAGE_LT, ltstring); Kick(pid); } else return LanguageMessage(playerid, COLOR_RED, LANGUAGE_EN, "You can't kick yourself or player that is not connected!", LANGUAGE_LT, "Negali iрkickinti savжs ar юaidлjo kuris neprisijungжs!"); return 1; }
Code:
if(PlayerInfo[playerid][pAdmin] >= 3) return 0; //LanguageMessage(playerid, COLOR_RED, LANGUAGE_EN, "You can't use this command!", LANGUAGE_LT, "Negali naudoti рios komandos!");
You can't use this command!
There is no such command. Type /cmds for commands list.
SERVER: Unknown command.
Here is my OnPlayerCommandPerformed callback:
Code:
public OnPlayerCommandPerformed(playerid, cmdtext[], success) { if(!success) return LanguageMessage(playerid, 0xFF0000FF, LANGUAGE_EN, "{FFFFFF}[LFR]: {FF0000}There is no such command. Type /cmds for commands list.", LANGUAGE_LT, "{FFFFFF}[LFR]: {FF0000}Tokios komandos nлra! Raрykite /komandos, kad pamatytumлte komandш saraра."); return 1; }