Wer hat den fehler ???
dcmd_makeleader(playerid,params[])
{
new pID;
new frakid;
new string[256];
new string2[256];
if (sscanf(params, "ui", pID, frakid)) SendClientMessage(playerid, COLOR_GREY, "Info: /makeleader [SpielerID] [FraktionID]");
else if (pID == INVALID_PLAYER_ID IsPlayerNPC(pID)) SendClientMessage(playerid, COLOR_GREY, "*:: Dieser Spieler kann nicht erreicht werden. ::*");
else if (frakid < 1 frakid > 6) SendClientMessage(playerid, COLOR_GREY, "Die FraktionID muss zwischen 1 und 6 sein!");
else
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(PlayerInfo[playerid][pAdmin] == 1337)
{
if(frakid == 1) { PlayerInfo[pID][pFSkin] = 0; PlayerInfo[pID][pTeam] = 1; PlayerInfo[pID][pLeader] = 0; PlayerInfo[pID][pRank] = 0; SetPlayerSkin(pID, PlayerInfo[pID][pSkin]); PlayerInfo[pID][pDuty] = 0;} // Zivilist
if(frakid == 2) { PlayerInfo[pID][pFSkin] = 280; PlayerInfo[pID][pTeam] = 2; PlayerInfo[pID][pLeader] = 2; PlayerInfo[pID][pRank] = 6; SetPlayerSkin(pID, PlayerInfo[pID][pFSkin]); PlayerInfo[pID][pDuty] = 1; } // LSPD
if(frakid == 3) { PlayerInfo[pID][pFSkin] = 286; PlayerInfo[pID][pTeam] = 3; PlayerInfo[pID][pLeader] = 3; PlayerInfo[pID][pRank] = 6; SetPlayerSkin(pID, PlayerInfo[pID][pFSkin]); PlayerInfo[pID][pDuty] = 1; } // FBI
if(frakid == 4) { PlayerInfo[pID][pFSkin] = 274; PlayerInfo[pID][pTeam] = 4; PlayerInfo[pID][pLeader] = 4; PlayerInfo[pID][pRank] = 6; SetPlayerSkin(pID, PlayerInfo[pID][pFSkin]); PlayerInfo[pID][pDuty] = 1; } // Sanitäter
if(frakid == 5) { PlayerInfo[pID][pFSkin] = 59; PlayerInfo[pID][pTeam] = 5; PlayerInfo[pID][pLeader] = 5; PlayerInfo[pID][pRank] = 6; SetPlayerSkin(pID, PlayerInfo[pID][pFSkin]); PlayerInfo[pID][pDuty] = 1; } // Fahrlehrer
if(frakid == 6) { PlayerInfo[pID][pFSkin] = 294; PlayerInfo[pID][pTeam] = 6; PlayerInfo[pID][pLeader] = 6; PlayerInfo[pID][pRank] = 6; SetPlayerSkin(pID, PlayerInfo[pID][pFSkin]); PlayerInfo[pID][pDuty] = 1; } // Hitman
ResetPlayerWeapons(playerid);
format(string, sizeof(string),"[AdminCmd] Du hast ein Spieler(ID: %d) zum Leader der Fraktion(ID: %d) gemacht.",pID,frakid);
format(string2, sizeof(string2),"[AdminCmd] Du wurdest vom Admin %s zum Leader der Fraktion(ID: %d) gemacht worden.",name, frakid);
SendClientMessage(pID, COLOR_GREEN, string2);
SendClientMessage(playerid, COLOR_GREEN, string);
ServerLog(string2);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du bist kein Admin");
}
}
return 1;
}