problem with getplayerhealth
#1

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!" ...
Reply
#2

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);
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)