hallo brotfischer wenn ich /makeleader eingebe stürzt der Server ab warum?
//EDIT hier der Befehl:
if(strcmp(cmd, "/makeleader", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "BENUTZUNG: /makeleader [playerid/Name] [Nummer(1-24)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level > 24 || level < 0) { SendClientMessage(playerid, COLOR_GREY, " Geh nicht tiefer als Nummer 0, oder höher als Nummer 24!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Player ist bereits/noch in einer Fraktion!");
return 1;
}
if(PlayerInfo[para1][pFrakSperre] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler hat FraktionsSperre!");
return 1;
}
new ftext[32];
if(level == 0) { ftext = "Zivilisten"; } else { ftext = Fracs[(level-1)]; }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), " Du hast %s die Leaderrechte der Fraktion %s gegeben.", giveplayer,ftext);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Server: %s wurde von %s zu einem Leader gemacht",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,4);
format(string, sizeof(string), " Admin %s hat dich zum Leader von der Fraktion %s ernannt.", sendername,ftext);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
SendClientMessage(para1, COLOR_GRAD5, " Du kannst mit /help deine neuen Fraktionsbefehle betrachten");
SendClientMessage(para1, COLOR_GRAD5, " Du hast die Verantwortung für deine Member, also pass auf was sie tuhen");
SendClientMessage(para1, COLOR_GRAD5, " Wenn du vor Ablauf der Frist rausgeworfen wirst, musst du die Rest der Zeit Zivilist bleiben.");
gTeam[para1] = 0;
PlayerInfo[para1][pTeam] = 0;
PlayerInfo[para1][pRank] = 6;
PlayerInfo[para1][pLeader] = level;
new iyear, imonth,iday;
getdate(iyear, imonth, iday);
format(string, sizeof(string), "%s[Level:%d] wurde von %s Als Leader der Fraktion %s eingeladen (%d-%d-%d)", giveplayer,PlayerInfo[para1][pLevel],sendername,ftext,imonth,iday,iyear);
LeaderLog(string);
if(level == 0)
{
gTeam[para1] = 3;
PlayerInfo[para1][pTeam] = 3;
PlayerInfo[para1][pMember] = 0;
PlayerInfo[para1][pRank] = 0;
PlayerInfo[para1][pChar] = 0;
new rand = random(sizeof(CIV));
SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerInfo[para1][pModel] = CIV[rand];
MedicBill[para1] = 0;
SpawnPlayer(para1);
}
else if(level == 1) { PlayerInfo[para1][pChar] = 228; gTeam[para1] = 2; PlayerInfo[para1][pTeam] = 2; } // LOS SANTOS POLICE
else if(level == 2) { PlayerInfo[para1][pChar] = 288; gTeam[para1] = 2; PlayerInfo[para1][pTeam] = 2; } // SAN FIERRO POLICE
else if(level == 3) { PlayerInfo[para1][pChar] = 287; gTeam[para1] = 2; PlayerInfo[para1][pTeam] = 2; } // Bundeswehr
else if(level == 4) { PlayerInfo[para1][pChar] = 275; gTeam[para1] = 4; PlayerInfo[para1][pTeam] = 4; } // Medic
else if(level == 5) { PlayerInfo[para1][pChar] = 113; } // La Cosa Nostra
else if(level == 6) { PlayerInfo[para1][pChar] = 120; } // Yakuza
else if(level == 7) { PlayerInfo[para1][pChar] = 147; } // Mayor
else if(level == 8) { PlayerInfo[para1][pChar] = 294; } // Hitmans
else if(level == 9) { PlayerInfo[para1][pChar] = 187; } // NewsReporter
else if(level == 10) { PlayerInfo[para1][pChar] = 17; } // Taxi Cab Company
else if(level == 11) { PlayerInfo[para1][pChar] = 240; } // Driving/Flying School
else if(level == 12) { PlayerInfo[para1][pChar] = 248; } // Biker Boys
else if(level == 13) { PlayerInfo[para1][pChar] = 270; } // Grove Street
else if(level == 14) { PlayerInfo[para1][pChar] = 296; } // Ballas
else if(level == 15) { PlayerInfo[para1][pChar] = 185; } // 2Fast2Furios
else if(level == 16) { PlayerInfo[para1][pChar] = 108; } // Los Santos Vagos
else if(level == 17) { PlayerInfo[para1][pChar] = 115; } // Varios Los Aztecas
else if(level == 18) { PlayerInfo[para1][pChar] = 173; } // San Fierro Rifa
else if(level == 19) { PlayerInfo[para1][pChar] = 189; } // West Coast Customs
else if(level == 20) { PlayerInfo[para1][pChar] = 220; } // Terroristen
else if(level == 21) { PlayerInfo[para1][pChar] = 286; gTeam[para1] = 2; PlayerInfo[para1][pTeam] = 2; } //FBI
else if(level == 22) { PlayerInfo[para1][pChar] = 164; } // Feuerwehr
else if(level == 23) { PlayerInfo[para1][pChar] = 126; } // russenmafia
else if(level == 24) { PlayerInfo[para1][pChar] = 71; } // Ordnungsamt
SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " ** INFO: Das ist ein Adminbefehl, du bist kein Admin!");
}
}
return 1;
}