09.08.2011, 16:19
(
Последний раз редактировалось wups; 09.08.2011 в 17:01.
)
Heh, i don't know how will you check in my server how much progress bars i have created.(also check j_fades, it also uses 1 textdraw)
Here's the secret:
You can create 1 textdraw(a box) and show it for all players yes? Okay, then: if you change the BOX SIZE, nothing will happen to any players. But when you reshow it for the player it does(thats how UpdateProgressBar works). So the point is: You can change the Bars value(the box size), and Update it ONLY FOR ONE PLAYER.
Here's my code:
You ask me why i studied this? Imagine a server with 500 slots.As we both know - 1 Progress bar = 3 text draws. Therefore 1 Progress Bar For Each Player 3*500 = 1500 TEXTDRAWS. That's insane.
Other than that:
bench_power[ playerid ]
bench_reps[ playerid ]
Is also not needed for every player, since it contains a constant string.
Here's the secret:
You can create 1 textdraw(a box) and show it for all players yes? Okay, then: if you change the BOX SIZE, nothing will happen to any players. But when you reshow it for the player it does(thats how UpdateProgressBar works). So the point is: You can change the Bars value(the box size), and Update it ONLY FOR ONE PLAYER.
Here's my code:
pawn Код:
SetProgressBarValue(HealthBar, VehicleHealth);
UpdateProgressBar(HealthBar, playerid);
Other than that:
bench_power[ playerid ]
bench_reps[ playerid ]
Is also not needed for every player, since it contains a constant string.