Hey meine Leader & Admin Liste Updaten erst den Rank wenn ich z.B. 2000 habe steht bei /admins Projektleitung: dann muss ich erst rlg damit der angezeigt wird und wenn ich mir dann Rank 1 gebe auch wieder rlg damit nicht mehr Projektleitung steht sondern z.B. Admin (1)
Warum?
stock GetAdmin(frak){
new aName[20]="Unbekannt";
switch(frak){
case 1: aName="AdminLevel (1)";
case 2: aName="AdminLevel (2)";
case 3: aName="AdminLevel (3)";
case 4: aName="AdminLevel (4)";
case 5: aName="AdminLevel (5)";
case 1338: aName="Full-Admin";
case 2000: aName="Projektleitung";
}
return aName;
}
stock GetFraktion(frak){
new fName[20]="Unbekannt";
switch(frak){
case 1: fName="N.S.A";
case 2: fName="Parkhouse Drifer";
case 3: fName="Feuerwehr";
case 4: fName="Medic";
case 5: fName="La Cosa Nostra";
case 6: fName="Yakuza";
case 7: fName="F.B.I";
case 8: fName="Hitman";
case 9: fName="News Reporter";
case 10: fName="Wheelman";
case 11: fName="Fahrschule";
case 12: fName="Regierung";
case 13: fName="Ordnungsamt";
case 14: fName="SAPD";
case 15: fName="Hells Angels";
case 16: fName="Nichts";
case 17: fName="Russen Mafia";
case 18: fName="Aztecas";
case 19: fName="Grove Street";
case 20: fName="Ballas";
case 21: fName="WCC";
case 22: fName="Triaden";
case 23: fName="Red Soliders";
case 24: fName="L.S Vagos";
case 25: fName="Guerilla";
case 26: fName="Cali Kartell";
}
return fName;
}
stock OnlineByName(string[])
{
for(new i; i < MAX_PLAYERS ; ++i) if(IsPlayerConnected(i) && !strcmp(string,pName(i),false)) return 1;
return 0;
}
stock pName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
if(strcmp("/leader", cmd, true) == 0)
{
new data[128],fName,sName[MAX_PLAYER_NAME],showList[1200];
mysql_query("SELECT `Name`, `Leader` FROM `users` WHERE `Leader` > 0");
mysql_store_result();
while(mysql_fetch_row_format(data)){
format(data, sizeof(data), "%s|", data);
printf("data: %s", data);
sscanf(data,"p<|>s[20]d",sName,fName);
printf("sName: %s | fName: %d | return: %s", sName, fName, GetFraktion(fName));
format(showList,sizeof(showList),"%s{FFFFFF}%s Leader: %s (%s{FFFFFF})\n",showList,GetFraktion(fName),sName,((!OnlineByName(sName))?("{F6000F}Offline"):("{00EE14}Online")));
}
mysql_free_result();
ShowPlayerDialog(playerid,DIALOG_VOGELLEADER,DIALOG_STYLE_MSGBOX,"Leaders",showList,"Bestätigen","");
return 1;
}
if(strcmp("/admins", cmd, true) == 0)
{
new data[128],aName,sName[MAX_PLAYER_NAME],ShowList[1200];
mysql_query("SELECT `Name`, `Adminlevel` FROM `users` WHERE `Adminlevel` > 0");
mysql_store_result();
while(mysql_fetch_row_format(data)){
sscanf(data,"p<|>s[20]d",sName,aName);
format(data,128,"{FFFFFF}%s: %s (%s{FFFFFF})\n",GetAdmin(aName),sName,((!OnlineByName(sName))?("{F6000F}Offline"):("{00EE14}Online")));
strcat(ShowList,data);
}
mysql_free_result();
ShowPlayerDialog(playerid,DIALOG_VOGELADMIN,DIALOG_STYLE_MSGBOX,"Admin Team",ShowList,"Schließen","");
return 1;
}
Makeleader Befehl:
if(strcmp("/makeleader", cmd, true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_BENUTZETEXT,"/makeleader [Spieler ID] [Fraktionsid]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new level = strval(tmp);
if(level > 26 || level < -1) { SendClientMessage(playerid, COLOR_ERRORTEXT, " Es gibt nur 26 Fraktionen/Gangs, bitte wähle zwischen 1-26!"); return 1; }
if(PlayerInfo[playerid][pAdmin] >= 1338)
{
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[giveplayerid][pMember] > 0)
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Dieser Spieler ist ein Member einer Gang/Fraktion!");
return 1;
}
new ftext[20];
if(level == -1) { ftext = "Zivilisten"; }
else if(level == 2) { ftext = "Drift Access"; }
else if(level == 3) { ftext = "Brigada"; }
else if(level == 4) { ftext = "Medic"; }
else if(level == 5) { ftext = "La Cosa Nostra"; }
else if(level == 6) { ftext = "Yakuza"; }
else if(level == 7) { ftext = "FBI"; }
else if(level == 8) { ftext = "Hitman Agency"; }
else if(level == 9) { ftext = "News Reporter"; }
else if(level == 10) { ftext = "Wheelman Agency"; }
else if(level == 11) { ftext = "Fahrschule"; }
else if(level == 12) { ftext = "Regierung"; }
else if(level == 13) { ftext = "Ordnungsamt"; }
else if(level == 14) { ftext = "LS-PD"; }
else if(level == 15) { ftext = "Biker Boys"; }
else if(level == 16) { ftext = "SF-PD"; }
else if(level == 17) { ftext = "Camorra"; }
else if(level == 18) { ftext = "V.L.Atztecas"; }
else if(level == 19) { ftext = "Grove Street"; }
else if(level == 20) { ftext = "Ballas"; }
else if(level == 21) { ftext = "West Coast Customs"; }
else if(level == 22) { ftext = "Triaden"; }
else if(level == 23) { ftext = "Red Soldiers"; }
else if(level == 24) { ftext = "L.S.Vagos"; }
else if(level == 25) { ftext = "Irish Crime Familys"; }
else if(level == 26) { ftext = "Cali Kartell"; }
else if(level == 1) { ftext = "SF Rifa"; }
else { return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[giveplayerid][pLeader] = level;
PlayerInfo[giveplayerid][pTeam] = level;
PlayerInfo[giveplayerid][pRank] = 12;
PlayerInfo[giveplayerid][pGehalt] = 0;
format(string, sizeof(string), " Du wurdest vom Admin %s zum Leader der/den %s gemacht.", sendername, ftext);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Du hast %s zum Leader der/den %s gemacht.", giveplayer,ftext);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SetPVarInt(playerid, "PVTeam", PlayerInfo[playerid][pLeader]);
printf("Admin %s hat %s einen Leaderinvite für %s gegeben.", sendername, giveplayer, ftext);
format(string,sizeof(string),"Admin %s hat %s zum Leader der/den %s gemacht!", sendername,giveplayer,ftext);
EnterToLog("Leader",string);
if(level != -1)
{
new Tage = 7;
new wielange = (Tage*24*60*60);
new Zeit = wielange+Time();
PlayerInfo[giveplayerid][pInviteSperre] = Zeit;
format(string, sizeof(string), "UPDATE `users` SET `InviteDatum`='%d' WHERE `Name`='%s'", Time(), giveplayer);
self_mysql_queryEx(string);
}
Kleidungsshop[giveplayerid] = 1;
PlayerInfo[giveplayerid][pJob] = 0;
JoinSkinAuswahl(giveplayerid);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, "* Wähle einen Skin aus mit den Pfeiltasten. Bestätigen mit Umschalt.");
SetPVarInt(giveplayerid, "PVTeam", level);
}
}
else
{
SendClientMessage(playerid, COLOR_KEINADMIN, "*** INFO: Dies ist ein Adminbefehl, du bist kein Admin.");
}
}
return 1;
}
Make Admin befehl:
if(strcmp("/makeadmin", cmd, true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /makeadmin [SpielerName/ID] [Admin Level]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /makeadmin [SpielerName/ID] [Admin Level]");
return 1;
}
new level = strval(tmp);
if(PlayerInfo[playerid][pSQLID] == 1 || PlayerInfo[playerid][pSQLID] == 2)
{
if(IsPlayerConnected(giveplayerid))
{
if(level > 2000)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Da du ein Ungültigen Admin Rank eingegeben hast, wirst du aus Sicherheitsgründen gekickt!");
SetTimerEx("ConnectKick", 10,0,"i",playerid);
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername)) ;
PlayerInfo[giveplayerid][pAdmin] = level;
printf("AdmCmd: %s hat %s zum Adminlevel %d gemacht.", sendername, giveplayer, level);
format(string, sizeof(string), " Du wurdest zum Admin Level %d gemacht von %s", level, sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Du hast %s zum Admin Level %d gemacht.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "AdmCmd: %s hat %s zum Admin Level %d gemacht.", sendername, giveplayer,level);
SendAdminMessage(COLOR_YELLOW, 1, string);
SetPVarInt(giveplayerid, "PVAdmin", level);
format(string,sizeof(string),"AdmCmd: %s hat %s zum Admin Level %d gemacht.", sendername,giveplayer,level);
EnterToLog("Makeadmin",string);
if(level >= 1)
{
if(level > 1338)
{
TextDrawHideForPlayer(giveplayerid,TicketsTextdraw);
}
else{TextDrawShowForPlayer(giveplayerid,TicketsTextdraw);}
}
else{
TextDrawHideForPlayer(giveplayerid,TicketsTextdraw);
}
}
}
else
{
SendClientMessage(playerid, COLOR_KEINADMIN, "*** INFO: Dies ist ein Adminbefehl, du bist kein Admin.");
}
}
return 1;
}