[HELP] The health of all players
#1


Player 1
Player 2
Player 3
Player 4
Player 5


How can it be done?
Reply
#2

What are you trying to do?
Reply
#3

textdraw that shows the health of each player's like on the screenshot
Reply
#4

I tried something like this before with GetPlayerHealth and SetTextDrawSize, I did not got it to work properly
Reply
#5

Its eazy but it might take time to make. You can create multiple textdraws acording to the players health then on OnPlayerUpdate or on a Timer you get the players health and at the certain amount of health show the textdraw, and hide the rest textdraws.
Reply
#6

As it approximately will appear in the source code?
Reply
#7

It's kinda bit easy.

For the textdraw use this Zamaroht's Textdraw Editor

Place the textdraw in designated place you like for the kills,deaths,ratio etc.. you are going to use OnPlayerUpdate.

E.G..

Код:
public OnPlayerUpdate(playerid)
{
    new string[30], string2[30], string3[30], string4[30], string5[30], string6[30];
    format(string, sizeof (string), "Kills: ~g~%d", pStats[playerid][Kills]);
    format(string2, sizeof (string2), "Deaths: ~g~%d", pStats[playerid][Deaths]);
    format(string3, sizeof (string3), "Total Rapes: ~g~%d", pStats[playerid][Rapes]);
    format(string4, sizeof (string4), "Drugs Taken: ~g~%d", pStats[playerid][DrugsTaken]);
    format(string5, sizeof (string5), "~g~%d ~b~Game Days", pStats[playerid][DaysPlayed]);
    format(string6, sizeof (string6), "Score: ~g~%d", pStats[playerid][Score]);
//  pStats[playerid][Score] = GetPlayerScore(playerid);
//  pStats[playerid][Money] = GetPlayerMoney(playerid);
    return 1;
}
Above is only a sample. Note: This is not a textdraw but a string. And this is for OnPlayerUpdate.
Reply
#8

want to say for 20 people to create an indicator, it is necessary to create 60 textdraw?
Reply
#9

Create a box, then you must destroy your box and create new in new position and size(Use timer). But you must make
mathematical formula which will calculate new coordinates of your box.

Or you can you can use include <ProgressBar>

https://sampforum.blast.hk/showthread.php?tid=113443
Reply
#10

Try to find some released A/D gamemodes, they have this function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)