Posts: 239
Threads: 100
Joined: Jun 2016
Reputation:
0
How to save and load health and armour using y_ini?
Posts: 1,219
Threads: 51
Joined: Jul 2012
This is not a tutorial / request section. Just lookup an y_ini tutorial / check the documentation and use the wiki
Posts: 55
Threads: 6
Joined: Apr 2013
Reputation:
0
You could use for loading:
- INI_Float("Health", playerInfo[playerid][Health]);
- INI_Float("Armour", playerInfo[playerid][Armour]);
- SetPlayerHealth(playerid, playerInfo[playerid][Health]);
- SetPlayerArmour(playerid, playerInfo[playerid][Armour]);
And for save the info:
- GetPlayerHealth(playerid, playerInfo[playerid][Health]);
- GetPlayerArmour(playerid, playerInfo[playerid][Armour]);
- INI_WriteFloat(File, "Health", playerInfo[playerid][Health]);
- INI_WriteFloat(File, "Armour", playerInfo[playerid][Armour]);
The "playerInfo" must be replaced with your own enums