So ich habe mich schon lange gefragt, was daran falsch ist oO.
dcmd_ban(playerid,params[]) {
if(ISADMIN[playerid] == 1) {
if(!strlen(params)) return SendClientMessage(playerid,red,"Syntax Error: \"/BAN <NICK OR ID> (<REASON>)\".");
new tmp[256],Index; tmp = strtok(params,Index);
new id; if(!IsNumeric(tmp)) id = ReturnPlayerID(tmp); else id = strval(tmp);
if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID && id != playerid) {
SendCommandMessageToRconAdmins(playerid,"BAN");
new string[256],name[24],ActionName[24]; GetPlayerName(playerid,name,24); GetPlayerName(id,ActionName,24);
if(!strlen(params[strlen(tmp)+1])) format(string,256,"\"%s\" hat \"%s\" gebannt!.",ActionName,name);
else format(string,256,"\"%s\" hat \"%s\"gebannt. (Grund: %s)",ActionName,name,params[strlen(tmp)+1]);
SendClientMessageToAll(yellow,string);
return Ban(id); new ip[128]; new string2[256]; GetPlayerIp(id,ip,128); format(string2,256,"banip %d",ip); SendRconCommand(string2); //ZEILE 10243
} else return SendClientMessage(playerid,red,"ERROR: You can not ban yourself or a disconnected player.");
} else return SendClientMessage(playerid,COLOR_RED,"Du bist kein Admin!");
}//ZEILE 10246
Errors:
....GM.pwn(10243) : warning 225: unreachable code
....GM.pwn(10243) : function "dcmd_ban" should return a value
Hoffe ein Scripter kann mir mal sagen was daran falsch ist.Ich kann eigentlich gut Scripten nur das Problem bei dcmd funktionierte bei mir nie
MFG,Cedi