GetMyHp Commands - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetMyHp Commands (
/showthread.php?tid=91856)
GetMyHp Commands -
Smiths - 17.08.2009
I got this codes:
if(strcmp(cmd, "/myhp", true) == 0) // Reboot the server
{
SendClientMessage(playerid,COLOR_YELLOW, GetPlayerHealth);
}
But i got an error in SendClientMessage(playerid,COLOR_YELLOW, GetPlayerHealth);
Why?
Re: GetMyHp Commands -
Programie - 17.08.2009
Try that:
Код:
new Float:health;
GetPlayerHealth(playerid,health);
Re: GetMyHp Commands -
Smiths - 17.08.2009
i got a error
SendClientMessage(playerid,COLOR_YELLOW, GetPlayerHealth(playerid);
Re: GetMyHp Commands -
Programie - 17.08.2009
Quote:
Originally Posted by Smiths
i got a error
SendClientMessage(playerid,COLOR_YELLOW, GetPlayerHealth(playerid);
|
Look again at my post.
Re: GetMyHp Commands -
Joe Staff - 17.08.2009
You need to make a new string and
format that string to had the player's health in it with the
float escape code. Wiki.sa-mp.com can tell you what you need on those functions.
Re: GetMyHp Commands -
Programie - 17.08.2009
You mean something like this?
Код:
new string[256];
new Float:health;
GetPlayerHealth(playerid,health);
format(string,sizeof(string),"Your health: %f",health);
SendClientMessage(playerid,COLOR_YELLOW,string);
Re: GetMyHp Commands -
Sergei - 17.08.2009
Quote:
Originally Posted by Programie
You mean something like this?
Код:
new string[256];
new Float:health;
GetPlayerHealth(playerid,health);
format(string,sizeof(string),"Your health: %f",health);
SendClientMessage(playerid,COLOR_YELLOW,string);
|
Lol ...
http://forum.sa-mp.com/index.php?top...7347#msg507347
He needs string with MAXIMUM 25 cells and you would sell him string with 256
pawn Код:
new string[25];
new Float:health;
GetPlayerHealth(playerid,health);
format(string,sizeof(string),"Your health: %f",health);
SendClientMessage(playerid,COLOR_YELLOW,string);
Re: GetMyHp Commands -
Criss_Angel - 17.08.2009
try this:
Код:
if(strcmp(cmd, "/myhp", true) == 0) // Reboot the server
{
SendClientMessage(playerid,COLOR_YELLOW, "GetPlayerHealth");
}
Re: GetMyHp Commands -
Viktor_Burns - 17.08.2009
Quote:
Originally Posted by Criss_Angel
try this:
Код:
if(strcmp(cmd, "/myhp", true) == 0) // Reboot the server
{
SendClientMessage(playerid,COLOR_YELLOW, "GetPlayerHealth");
}
|
LOL
Re: GetMyHp Commands -
Jakku - 17.08.2009
So you want to get your health?