Posts: 210
Threads: 68
Joined: Aug 2018
Reputation:
0
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
Posts: 3
Threads: 1
Joined: Jul 2018
Reputation:
0
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);
}