Save Player Point on Logoff
#1

Well , I Wanted that when the Player logoff his Location Saves - And i am using Y_ini - So i did the Following :


Under OnPlayerDisconnect

PHP код:
    INI_WriteInt(File,"Health",PlayerInfo[playerid][pHealth]);
    
INI_WriteInt(File,"Armor",PlayerInfo[playerid][pArmor]);
    
INI_WriteInt(File,"SPos_x",PlayerInfo[playerid][pSPos_x]);
    
INI_WriteInt(File,"SPos_y",PlayerInfo[playerid][pSPos_y]);
    
INI_WriteInt(File,"SPos_z",PlayerInfo[playerid][pSPos_z]);
    
INI_WriteInt(File,"SPos_r",PlayerInfo[playerid][pSPos_r]);
    
INI_WriteInt(File,"Int",PlayerInfo[playerid][pInt]); 
And under LoadUser_data :

PHP код:
        INI_Int("Health",PlayerInfo[playerid][pHealth]);
        
INI_Int("Armor",PlayerInfo[playerid][pArmor]);
        
INI_Int("Int",PlayerInfo[playerid][pInt]);
        
INI_Int("SPos_x",PlayerInfo[playerid][pSPos_x]);
        
INI_Int("SPos_y",PlayerInfo[playerid][pSPos_y]);
        
INI_Int("SPos_z",PlayerInfo[playerid][pSPos_z]);
        
INI_Int("SPos_r",PlayerInfo[playerid][pSPos_r]); 
And..

PHP код:
public SetPlayerSpawn(playerid)
{
    
SetPlayerHealth(playeridPlayerInfo[playerid][pHealth]);
    
SetPlayerArmour(playeridPlayerInfo[playerid][pArmor]);
    
SetPlayerInterior(playeridPlayerInfo[playerid][pInt]);
    
SetPlayerPos(playeridPlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
    
SetPlayerFacingAngle(playeridPlayerInfo[playerid][pSPos_r]);
    
SetCameraBehindPlayer(playerid);
    return 
1;

But it don't save - Any Solutions ?
Reply
#2

I think you should use floatround to save floats
Or load as float not as int
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)