04.01.2013, 15:59
Tengo un problema en este cуdigo:
Resulta que estoy yo sуlo en el servidor y aparezco en las cinco posiciones del top.
Imagen:
Код:
// This is a comment // uncomment the line below if you want to write a filterscript #define FILTERSCRIPT #include <a_samp> #if defined FILTERSCRIPT new score[MAX_PLAYERS]; new scoreid[MAX_PLAYERS]; new Textdraw0; enum PlayerInfo { pKills, pDeaths, } new pInfo[MAX_PLAYERS][PlayerInfo]; #define DIALOG_TOP 1 public OnFilterScriptInit() { Textdraw0 = TextDrawCreate(168.000000, 312.000000, ""); TextDrawBackgroundColor(Textdraw0, 255); TextDrawFont(Textdraw0, 2); TextDrawLetterSize(Textdraw0, 0.210000, 1.200000); TextDrawColor(Textdraw0, -1); TextDrawSetOutline(Textdraw0, 1); TextDrawSetProportional(Textdraw0, 1); for(new i=0;i<MAX_PLAYERS;++i) score[i] = 0; return 1; } #endif public OnPlayerSpawn(playerid) { new temp; for(new i = 0;i<MAX_PLAYERS;++i) { for(new j = i;j<MAX_PLAYERS;++j) { if(score[j] > score[i]) { temp = score[i]; score[i] = score[j]; score[j] = temp; temp = scoreid[i]; scoreid[i] = scoreid[j]; scoreid[j] = temp; } } } new string[5][200]; new rango[400]; if((pInfo[playerid][pKills]>= 0 && pInfo[playerid][pKills] <= 150)) { rango = "NEWBIE SHOOTER"; } else if((pInfo[playerid][pKills]>= 151 && pInfo[playerid][pKills] <= 300 )) { rango = "DEDICATED SHOOTER"; } else if((pInfo[playerid][pKills]>= 301 && pInfo[playerid][pKills] <= 550)) { rango = "THE REAL SHOOTER"; } else if((pInfo[playerid][pKills]>= 551 && pInfo[playerid][pKills] <= 700)) { rango = "IGI SHOOTER"; } else if((pInfo[playerid][pKills]>= 701 && pInfo[playerid][pKills] <= 1000)) { rango = "INSANE SHOOTER"; } else if((pInfo[playerid][pKills]>= 1000 && pInfo[playerid][pKills] <= 1500)) { rango = "PROFESSIONAL SHOOTER"; } for(new i =0;i<5;++i) { new name[MAX_PLAYER_NAME]; GetPlayerName(scoreid[i],name,sizeof(name)); format(string[i],200,"%d. %s - %s - %d",i+1,name,rango,score[i]); } new fstring[300]; format(fstring,300,"%s~n~%s~n~%s~n~%s~n~%s",string[0],string[1],string[2],string[3],string[4]); for(new i=0;i<MAX_PLAYERS;++i) { if(IsPlayerConnected(i)) { TextDrawShowForPlayer(i, Textdraw0); TextDrawSetString(i, fstring); } } return 1; } public OnPlayerDeath(playerid, killerid, reason) { score[killerid]++; return 1; }
Imagen:
