What's wrong with this code?
#1

This code does not display the MAX SCORERS properly

pawn Код:
forward checkplayerscore();
public checkplayerscore(){
new /*strx[256],*/string[456],string2[456],tname[256],count;
for(new p;p<MAX_PLAYERS;p++){
if(IsPlayerConnected(p)){
GetPlayerName(p,"tname",sizeof(tname));
string2 = string;
//format(strx,sizeof(strx),"%s with %d Score" ,tname,GetPlayerScore(p));
if(GetPlayerScore(p) < count){ //see
format(string ,sizeof(string),"%s\n%s %d Score",string2,tname,GetPlayerScore(p));
}
else{
count = GetPlayerScore(p);
format(string ,sizeof(string),"%s %d Score\n%s", tname,GetPlayerScore(p),string2);
}
}
}
for(new p2;p2<MAX_PLAYERS;p2++){
ShowPlayerDialog(p2, 706, DIALOG_STYLE_MSGBOX, "HIGHEST SCORE", string, "OK", "ClOSE");
}
}
Reply
#2

I'd make something like this:

pawn Код:
new Highest = -1, HighestID;
for(new p = 0; p < MAX_PLAYERS; p ++)
{
     if(IsPlayerConnected(p))
     {
          if(GetPlayerScore(p) > Highest)
          {
               Highest = GetPlayerScore(p);
               HighestID = p;
          }
     }
}
new name[MAX_PLAYER_NAME];
GetPlayerName(Highest, name, sizeof(name));
printf("Highest score: %s(%d), %d", name, HighestID, Highest);
Reply
#3

how will i fix my one?
Reply
#4

What is the problem with it
Reply
#5

it does not properly appear on the Dialog. Something like this happens

erper 12312323$$$$$$

where it shud be

Reaper 12312323
Stano 12311111
Reply
#6

bump!!! I need help it's urgent
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)