y_ini
#5

You want to save his pos & skin? sure.
pawn Код:
// On top of your script:
#define PATH "/Users/%s.ini"
new PlayerLeaveSkin[MAX_PLAYERS];
new Float:lastX;
new Float:lastY;
new Float:lastZ;
new Float:lastA;

stock UserPath(playerid)
{
    new string[128],pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),PATH,pName);
    return string;
}

stock SaveAccount(playerid)
{
    GetPlayerPos(playerid, lastX, lastY, lastZ);
    GetPlayerFacingAngle(playerid, lastA);
    PlayerLeaveSkin[playerid] = GetPlayerSkin(playerid);
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteFloat(File,"LastX",lastX);
    INI_WriteFloat(File,"LastY",lastY);
    INI_WriteFloat(File,"LastZ",lastZ);
    INI_WriteFloat(File,"LastA",lastA);
    INI_WriteInt(File,"Skin",PlayerLeaveSkin[playerid]);
    INI_Close(File);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
      SaveAccount(playerid);
      return 1;
}
Reply


Messages In This Thread
y_ini - by BigGroter - 16.08.2012, 17:15
Re: y_ini - by Avi57 - 16.08.2012, 18:05
Re: y_ini - by BigGroter - 16.08.2012, 18:29
Re: y_ini - by ThePhenix - 16.08.2012, 18:36
Re: y_ini - by Sandiel - 16.08.2012, 19:20
Re: y_ini - by BigGroter - 16.08.2012, 22:18

Forum Jump:


Users browsing this thread: 1 Guest(s)