04.09.2011, 17:19
Hi , i want to know how to Creat like a text in the Top of the Screen say that :
Health : TheHealthOfPlayer
thanx
Health : TheHealthOfPlayer
thanx
new Text:Textdraw;
//under OnGameModeInit
SetTimer("UpdateHealth",3000,true);//setting up the timer that will call the function
//Your textdraw create code here..
//under OnPlayerSpawn
TextDrawShowForPlayer(playerid,Textdraw);
//anywhere in your gamemode(not in any callback)
forward UpdateHealth(playerid);
public UpdateHealth(playerid)
{
new Float:health, string[20];
GetPlayerHealth(playerid,health);
format(string,sizeof(string),"Health: %03f",health);
TextDrawSetString(Textdraw,string);
return 1;
}
Use GetPlayerHealth:
https://sampwiki.blast.hk/wiki/GetPlayerHealth Then, create a textdraw, create a public function where you will set the textdraw's string, finally do a timer that will call that function Example: pawn Код:
|