Help with Saving/Loading Player Positions. EASY
#2

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new name[24];
    GetPlayerName(playerid,name,24);
    format(file,sizeof(file),"RicAdmin/users/%s.ini",name);
    if(dini_Exists(file))
    {
        new Float:x, Float:y, Float:z, Float:a;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, a);
        dini_IntSet(file,"Cash",GetPlayerMoney(playerid));
        dini_IntSet(file,"Score",GetPlayerScore(playerid));
        dini_IntSet(file,"Color",GetPlayerColor(playerid));
        dini_IntSet(file,"AdminLevel",PlayerInfo[playerid][AdminLevel]);
        dini_IntSet(file,"Job",PlayerInfo[playerid][Job]);
        dini_IntSet(file,"Vw",GetPlayerVirtualWorld(playerid));
        dini_IntSet(file,"Int",GetPlayerInterior(playerid));
        dini_IntSet(file,"Warns",PlayerInfo[playerid][Warns]);
        dini_IntSet(file,"Fleader",PlayerInfo[playerid][Fleader]);
        dini_IntSet(file,"Fmember",PlayerInfo[playerid][Fmember]);
        dini_IntSet(file,"Bank",PlayerInfo[playerid][Bank]);
        dini_IntSet(file,"Prods",PlayerInfo[playerid][Prods]);
        dini_IntSet(file,"Skin",GetPlayerSkin(playerid));
        dini_IntSet(file,"RepairOffer",PlayerInfo[playerid][RepairOffer]);
        dini_IntSet(file,"Credit",PlayerInfo[playerid][Credit]);
        dini_IntSet(file,"x", x);
        dini_IntSet(file,"y", y);
        dini_IntSet(file,"z", z);
        dini_IntSet(file,"a", a);
        IsLogged[playerid] = 0;
        return 1;
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerPos(playerid,dini_Int(file, "x"), dini_Int(file, "y", dini_Int(file, "z"));
    SetPlayerFacingAngle(playerid, dini_IntSet(file, "a"));
    return 1;
}
This should work
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)