24.01.2014, 22:58
Thank you, I tried it, but it doesn't work. What's wrong with this please :
For every printf I still have 0 as life/armor.
Could you help me with this please ?
Thank you.
Код:
public OnAccountLoad(playerid) { pInfo[playerid][Vie] = cache_get_row_float(0, 18); pInfo[playerid][Armure] = cache_get_row_float(0, 19); printf("%f %f", pInfo[playerid][Vie], pInfo[playerid][Armure]); return 1; }
Код:
public OnPlayerSpawn(playerid) { SetPlayerHealth(playerid, pInfo[playerid][Vie]); SetPlayerArmour(playerid, pInfo[playerid][Armure]); return 1; }
Код:
public OnPlayerDisconnect(playerid, reason) { new query[512]; new Float:vie, Float:armure; GetPlayerHealth(playerid, vie); GetPlayerArmour(playerid, armure); mysql_format(mysql, query, sizeof(query), "UPDATE `joueurs` SET `Vie`=%f, `Armure`=%f WHERE `ID`=%d", vie, armure, pInfo[playerid][ID]); mysql_tquery(mysql, query, "", ""); printf("%f %f", vie, armure); return 1; }
Could you help me with this please ?
Thank you.