Guten Tag...
ich habe Error und ich weiß leider nicht, wie ich die behebe:
fatal error 107: too many error messages on one line
error 029: invalid expression, assumed zero
error 001: expected token: ";", but found "]"
warning 215: expression has no effect
error 033: array must be indexed (variable "Playername")
error 033: array must be indexed (variable "Playername")
Die Zeile:
CMD:ban(playerid, params[])
{
if(PlayerInfo[playerid][pKMA] >= 2) {
new PID; //define the playerid we wanna ban
new reason[64]; //the reason, put into a string
new str[128]; //a new message string
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
GetPlayerName(PID, Playername, sizeof(Playername));
if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_GREY, "Benutz: /ban [playerid] [Grund]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
return SendClientMessage(playerid, COLOR_GREY, "Spieler nicht Online!");
PlayerInfo[Playername][pBanned] = 1;
PlayerInfo[Playername][pBannedBy[24]] = reason;
PlayerInfo[Playername][pMutedTimes[24]] = Adminname;
format(str, sizeof(str), "%s wurde von %s gebannt. Grund: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
SendClientMessageToAll(COLOR_RED, str); //send that message to all
Ban(PID); //Ban the playerid we've defined
}
else //if he has not got the permissions
{
SendClientMessage(playerid, COLOR_GREY, "Du musst AdminLevel 2 besitzen um diesen befehl benutzen zu können!"); //return this message
}
return 1;
}
WIe kann ich das beheben?