21.05.2010, 19:31
Hi all,
I have a little problem I puted my miniadminscript into my gamemode but now i get some problems if i use the admincommands. The commands work all in the server but i alway get the message in the chat that the command which I used dosen't extesised here are my parts
sample command ban
in the onplayercommandtext public
somewere in the gamemode
and this is the error message which comes if a player use a wrong servercommand
it stands at the and of onplayercommandtext
so if I now use ban i get the message that i used the command succesfully + the command errormessage
i hope that someone could help me
I have a little problem I puted my miniadminscript into my gamemode but now i get some problems if i use the admincommands. The commands work all in the server but i alway get the message in the chat that the command which I used dosen't extesised here are my parts
sample command ban
in the onplayercommandtext public
Код:
dcmd(ban,3,cmdtext);//level 2
Код:
dcmd_ban(playerid,params[])
{
new pID;
new Grund[256];
if(sscanf(params, "us", pID, Grund))
{
return LSendClientMessage(playerid,dunkelrot,"Benutze: /ban [Playerid] [Grund]","use: /ban [Playerid] [ground]");
}
if(!IsPlayerConnected(pID))
{
return LSendClientMessage(playerid,rot,"ID is nicht Online","ID isnґt online");
}
if(IsPlayerAdmin[playerid][alvl]<2)
{
return LSendClientMessage(playerid,rot,"Du bist kein Level 2 Admin","You arnґt a Level 2 Admin");
}
else
{
if(IsPlayerAdmin[playerid][alvl]<IsPlayerAdmin[pID][alvl])
{
return LSendClientMessage(playerid,rot,"Du kannst diesen Befehl nicht an hцherrangigen Admins ausfьhren!","You canґt use this command for a higher admin!");
}
else
{
new name[MAX_PLAYER_NAME], string1[256],string2[256];
GetPlayerName(pID, name, sizeof(name));
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, sizeof(aname));
format(string1, sizeof(string1), "%s wurde von %s gebannt. Grund: %s ", name, aname, Grund);
format(string2, sizeof(string2), "%s was banned by %s because: %s ", name, aname, Grund);
LSendClientMessageToAll(dunkelrot, string1,string2);
Ban(pID);
}
}
return 1;
}
Код:
LSendClientMessage(playerid, COLOR_WHITE,"Unbekannter Befehl, alle Befehle findest du unter /commands.","Unknown command Type /commands to find the servercommands"); LSendClientMessage(playerid, COLOR_WHITE,"Fals du Fragen zum Server haben solltest wende dich bitte an einen Admin /admins.","If you need halp you can find all Admins with /admins"); return 1; }
so if I now use ban i get the message that i used the command succesfully + the command errormessage
i hope that someone could help me

