LastHealth & LastArmour; Problems?
#1

Enum:
pawn Код:
enum _PINFO {
    //Blah, blah, blah...
    Float:LastArmour,
    Float:LastHealth
}
Restart Command:
pawn Код:
GetPlayerHealth(playerid, PVar[playerid][LastHealth]);
GetPlayerArmour(playerid, PVar[playerid][LastArmour]);
djSetFloat      (File, "LastArmour", PVar[playerid][LastArmour]);
djSetFloat      (File, "LastHealth", PVar[playerid][LastHealth]);
OnPlayerDisconnect (Where everything in my player data saves, which works -- Except this (i'm assuming?)
pawn Код:
GetPlayerHealth(playerid, PVar[playerid][LastHealth]);
GetPlayerArmour(playerid, PVar[playerid][LastArmour]);
djSetFloat      (File, "LastArmour", PVar[playerid][LastArmour]);
djSetFloat      (File, "LastHealth", PVar[playerid][LastHealth]);
printf("[Debug] Health: %f, Armour: %f", PVar[playerid][LastHealth], PVar[playerid][LastArmour]);
printf("[save] %s has been saved.", GetTheirName(playerid));
According to my debug print, this is working fine.. but it's not.

OnPlayerSpawn:
pawn Код:
SetPlayerHealth(playerid, PVar[playerid][LastHealth]);
SetPlayerArmour(playerid, PVar[playerid][LastArmour]);
OnPlayerDeath:
pawn Код:
PVar[playerid][LastHealth] = 100.0;
PVar[playerid][LastArmour] = 0.0;
Reply
#2

I'm confused, what's the issue?
Reply
#3

I spawn, and it kills me instantly - Sorry, I didn't make it exactly clear.
Reply
#4

Is it loading properly after reconnection?
Reply
#5

I'm assuming so.
Reply
#6

Under your login code:

pawn Код:
djFloat(File, "LastHealth");
djFloat(File, "LastArmour");
Reply
#7

Quote:
Originally Posted by 69Playa
Посмотреть сообщение
Under your login code:

pawn Код:
djFloat(File, "LastHealth");
djFloat(File, "LastArmour");
Right, thank you; It must have slipped my mind.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)