rank redosljed

Započeo Carera, Mart 22, 2019, 17:40:39 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): zanima me kako da napravim da kad kucam /clanovi da ide od najveceg ranka pa do najmanjeg
Dio skripte: [ pawn ]vaš odgovor[ /pawn ]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]vaš odgovor[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): link slike


U Foreachu podesavas to evo ti primer

[pawn]if(PlayerInfo[pLider] == org) format(string, sizeof(string), ""CRVENA"- Lider | "BELA"%s",GetName(i));
if(PlayerInfo[pClan] == org && PlayerInfo[pClan] == 5) format(string, sizeof(string), ""CRVENA"- CLAN | "BELA"%s",GetName(i));
[/pawn]

new rank_playerids[MAX_PLAYERS/MAX_RANKS][MAX_RANKS] = INVALID_PLAYER_ID,
count[MAX_RANKS],
buffer[64],
factionid = playerData[playerid][pMember],
rank;

foreach(new i : Player) {
if (playerData[i][pMember] != factionid) continue;

if (playerData[i][pLeader]) {
GetPlayerName(i, buffer, MAX_PLAYER_NAME + 1);

format(buffer, sizeof buffer, "Lider: %s [%d]", buffer, i);
SendClientMessage(playerid, -1, buffer);
}
else {
rank = playerData[i][pRank];
rank_playerids[count[rank - 1] ++][rank - 1] = i;
}
}

for(new i = 0; i < MAX_PLAYERS/MAX_RANKS; i ++) {
for(new k = 0; k < MAX_RANKS; k ++) {
if (rank_playerids[i][k] != INVALID_PLAYER_ID) {
new id = rank_playerids[i][k];

GetPlayerName(id, buffer, MAX_PLAYER_NAME + 1);

format(buffer, sizeof buffer, "Rank %d: %s [%d]", k + 1, buffer, id);
SendClientMessage(playerid, -1, buffer);
}
}
}