Show Race Rank List [+REP]
#1

Hi guys so i created a race system but i have a problem , i want to show the players ranking [i mean 1st,2st and 3rd] during the race [not after race] with a textdraw , show which player is 1st ! can you give an exp? i want to the textdraw update after a plyer entered the race checkpoint
Reply
#2

I think I have an idea for doing that. You have to create a variable for every checkpoint like:
PHP код:
new places[THE NUMBER OF YOUR CHECKPOINTS]; 
And when the player enters checkpont (OnPlayerEnterCheckpoint) the variable for the checkpoint increases by one!
After that check if the variable equals 0 (noone entered it) than the player is on first place etc.
Reply
#3

yeah i tried something like that , can you help me with changing the places? i mean when another plyr beat the old 1st plyr it will replace with him and his name will be on 1st but how can i put old 1st on 2st? its a little hard for me as a amateur
Reply
#4

new names[30],strings[128],bestid=-1,best=racep[0];
if(bestid == -1) PlayerTextDrawSetString(i, RaceTD, "~w~First:~r~Nobody");
foreach(new x : Player)
{
if(InRace[x] == 1)
{
if(RacePos[x] < best)
{
best = RacePos[x];
bestid = x;
}
}
}
if(bestid != -1)
{
GetPlayerName(bestid, names, sizeof(names));
format(strings, sizeof(strings), "First: ~r~%s", names);
PlayerTextDrawSetString(i, RaceTD, strings);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)