SA-MP Forums Archive
problem with onplayerdisconnect - 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 onplayerdisconnect (/showthread.php?tid=650370)



problem with onplayerdisconnect - wallen - 26.02.2018

PHP код:
    new str[128], name[MAX_PLAYER_NAME];
    new 
Float:hp;
    
GetPlayerName(playeridnamesizeof(name));
    
format(str,sizeof(str), "{c3c3c3}(INFO) %s ( %d ) has left the game (with %s hp left)",PlayerName[playerid], playeridhp);
    
SendClientMessageToAll(-1,str); 
It's like the health hp of the player when disconnecting is not whowing, whats causing it lol.


EDIT:

nvm forgot to add
PHP код:
new Float:hp GetPlayerHealth(playeridhp); 



Re: problem with onplayerdisconnect - Dayrion - 26.02.2018

Quote:
Originally Posted by wallen
Посмотреть сообщение
...
PHP код:
new Float:hp GetPlayerHealth(playeridhp); 
Hell no, that's not how you use this function. GetPlayerHealth RETURNS 1 on success and 0 on failure.

PHP код:
new Float:player_hp;
GetPlayerHealth(playeridplayer_hp); 



Re: problem with onplayerdisconnect - wallen - 26.02.2018

Oh, appreciated lol.