Server Sided Health/Armour Functions.

Started by SA:MP, May 05, 2023, 05:45 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

SA:MP

Server Sided Health/Armour Functions.

So I am making my own Server Sided Health / Armour in Textdraws, which is complete.



Just looking to upgrade my script a little bit.



in a bonestock standard Script, using GetPlayerHealth(playerid, Player[playerid][Health]);

would get the players Health, and in return save the value into the float specified.

how can I create a function myself like this.. here's what I am doing so far.






PHP Code:




GetPlayerHealthEx(playerid, &Float:HpAmountHpAmount Player[playerid][Health];

GetPlayerArmorEx(playerid, &Float:ArmorAmountArmorAmount Player[playerid][Armor];

SetPlayerHealthEx(playeridFloat:HpAmountPlayer[playerid][Health] = HpAmount;

SetPlayerArmorEx(playeridFloat:ArmorAmountPlayer[playerid][Armor] = ArmorAmount






Note I am moving right away from the whole standard Get/Set PlayerHealth standard CMDS as they are now useless, because every players HP will be infinite in that value.

Source: Server Sided Health/Armour Functions.