[Help] Skin saving problem.
#3

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
Why save the skin as float? And when you try to load it, you save it again.

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new file[128], pname[MAX_PLAYER_NAME];
    new Float:x, Float:y, Float:z;
    new Float:health;
    new Float:armour;

    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "USERFILES/%s.ini", pname);

    if(dini_Exists(file))
    {
        GetPlayerPos(playerid, x, y, z);
        GetPlayerHealth(playerid, health);
        GetPlayerArmour(playerid, armour);
        dini_FloatSet(file, "CoordinateX", x);
        dini_FloatSet(file, "CoordinateY", y);
        dini_FloatSet(file, "CoordinateZ", z);
        dini_FloatSet(file, "Health", health);
        dini_FloatSet(file, "Armour", armour);
        dini_IntSet(file, "Skin", GetPlayerSkin(playerid));
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new file[128], pname[MAX_PLAYER_NAME];
    new Float:x, Float:y, Float:z;
    new Float:health;
    new Float:armour;
    new playerskin;

    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "USERFILES/%s.ini", pname);

    if(!dini_Exists(file))
    {
        dini_Create(file);
    }
    else
    {
        x = dini_Float(file, "CoordinateX");
        y = dini_Float(file, "CoordinateY");
        z = dini_Float(file, "CoordinateZ");
        health = dini_Float(file, "Health");
        armour = dini_Float(file, "Armour");
        playerskin = dini_Int(file, "Skin");
        SetPlayerPos(playerid, x, y, z);
        SetPlayerHealth(playerid, health);
        SetPlayerArmour(playerid, armour);
        SetPlayerSkin(playerid, playerskin);
    }
    return 1;
}
Agree with ]Rafaellos[, im sorry i was wrong, because it is dini_Int not Float.
Reply


Messages In This Thread
[Help] Skin saving problem. - by BornHuman - 28.10.2013, 03:31
Re: [Help] Skin saving problem. - by ]Rafaellos[ - 28.10.2013, 04:28
Re: [Help] Skin saving problem. - by SAMProductions - 28.10.2013, 05:29
Re: [Help] Skin saving problem. - by RowdyrideR - 28.10.2013, 06:10
Re: [Help] Skin saving problem. - by Pottus - 28.10.2013, 06:25
Re: [Help] Skin saving problem. - by BornHuman - 28.10.2013, 19:41

Forum Jump:


Users browsing this thread: 3 Guest(s)