SA-MP Forums Archive
problem with getplayerhealth - 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)
+--- Thread: problem with getplayerhealth (/showthread.php?tid=657817)



problem with getplayerhealth - severance - 15.08.2018

PHP Code:
    new string[250], Float:health;
    
GetPlayerHealth(playerid,health);
     
format(string,sizeof(string), "{c3c3c3}%s left [with %d health remaining]",PlayerName[playerid], health);
    
SendClientMessageToAll(-1string); 
Looks done good, but once I test it with someone it says "root left [with 12381723 health remaining]
Where im wrong?

EDIT: Also, whats wrong there

PHP Code:
if(pInfo[playerid][Admin] > 0){
format(str2,sizeof(str2), "{4d79ff}(auth) You successfully authed as %s! (level: %d)",PlayerName[playerid], pInfo[playerid][Admin]);
SendClientMessage(playerid, -1str2);
}else{
format(str2,sizeof(str2), "{4d79ff}(auth) You successfully authed as %s!",PlayerName[playerid]);
SendClientMessage(playerid, -1str2);} 
What the hell is going on, even with admin level 1, it doesn't show "You successfully authed as %s! (level: %d)", but it shows "(auth) You successfully authed as %s!" ...


Re: problem with getplayerhealth - NeXTGoD - 15.08.2018

Code:
new string[250], Float:health,pName[24]; 
GetPlayerHealth(playerid,health); 
GetPlayerName(playerid,pName,sizeof pName);
format(string,sizeof(string), "{c3c3c3}%s left [with %.0f health remaining]",pName, health); 
SendClientMessageToAll(-1, string);



Re: problem with getplayerhealth - severance - 15.08.2018

works thanks, what about the admin part? any ideas?