12.08.2013, 14:02
Hello, i found big bug in my gm when i was played,some guy joined and hes automaticaly owner level 5.So its an bug but i dont understand where is it.A few days ago i saw against the guys was owners lol,lets see code.
I hope you got any idea whats the problem.
I hope you got any idea whats the problem.
Код:
CMD:admins(playerid,params[]) { if(IsPlayerConnected(playerid)) { new bool:IsAnyAdminConnected = false,bigstring[700]; for(new i; i<MAX_PLAYERS; i++) { if(ISP(i) && IsPlayerSpawned(i) && GetPVarInt(i, "Spawned") == 1) { if(!IsPlayerNPC(i)) { if(IsPlayerAdmin(i) && pInfo[i][Admin] == 0) { format(g_string, sizeof(g_string), ""D"%s (%d) - "R"Owner\n",PlayerName(i),i); strcat(bigstring, g_string); SPD(playerid,D_ADMINS,0,"Administrators online",bigstring,"Close",""); IsAnyAdminConnected = true; } else if(pInfo[i][Admin] >= 1 && !IsPlayerAdmin(i)) { format(g_string, sizeof(g_string), ""D"%s (%d) - %s\n",PlayerName(i),i,Level()); strcat(bigstring, g_string); SPD(playerid,D_ADMINS,0,"Administrators online",bigstring,"Close",""); IsAnyAdminConnected = true; } else if(IsPlayerAdmin(i) && pInfo[i][Admin] >= 1) { format(g_string, sizeof(g_string), ""D"%s (%d) - "R"Owner\n",PlayerName(i),i); strcat(bigstring, g_string); SPD(playerid,D_ADMINS,0,"Administrators online",bigstring,"Close",""); IsAnyAdminConnected = true; } } } } if(IsAnyAdminConnected == false) SPD(playerid,D_ADMINS,0,"Administrators",""D"No administrators online right.","Close",""); } return 1; } Level() { new level[40]; for(new a; a<MAX_PLAYERS; a++) { if(ISP(a) && IsPlayerSpawned(a) && GetPVarInt(a, "Spawned") == 1) { if(!IsPlayerAdmin(a) && pInfo[a][Admin] >= 1) { switch(pInfo[a][Admin]) { case 1: level = "{FFB500}Moderator Level 1"; case 2: level = ""B"Administrator Level 2"; case 3: level = ""G"Head Admin Level 3"; case 4: level = ""R"Co-Owner Level 4"; case 5: level = ""R"Owner Level 5"; } } } } return level; }