Dini Not Loaded - HELP
#1

i got Pos load and saving system, the saving are good, but the Position cannot loaded,
CODE: (LOAD)
pawn Код:
new filet[100], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
format(filet, sizeof(filet), "Pos/%s.ini",name);
    if(!dini_Exists(filet)) dini_Create(filet);
    PosInfo[playerid][rPos_X] = dini_Float(filet, "rPos_X");
    PosInfo[playerid][rPos_Y] = dini_Float(filet, "rPos_Y");
    PosInfo[playerid][rPos_Z] = dini_Float(filet, "rPos_Z");
    PosInfo[playerid][rPos_A] = dini_Float(filet, "rPos_A");
    PosInfo[playerid][rInterior] = dini_Int(filet, "rInt");
    PosInfo[playerid][rWorld] = dini_Int(filet, "rWo");
    PosInfo[playerid][pClassid] = dini_Int(filet, "rClassid");
    PosInfo[playerid][pSkinid] = dini_Int(filet, "rSkinid");
CODE: (SAVE)
pawn Код:
new filet[100], name[MAX_PLAYER_NAME];
    format(filet, sizeof(filet), "Pos/%s.ini",name);
    if(!dini_Exists(filet)) dini_Create(filet);
    dini_FloatSet(filet, "rPos_X", PosInfo[playerid][rPos_X]);
    dini_FloatSet(filet, "rPos_Y", PosInfo[playerid][rPos_Y]);
    dini_FloatSet(filet, "rPos_Z", PosInfo[playerid][rPos_Z]);
    dini_FloatSet(filet, "rPos_A", PosInfo[playerid][rPos_A]);
    dini_IntSet(filet, "rInt", PosInfo[playerid][rInterior]);
    dini_IntSet(filet, "rWo", PosInfo[playerid][rWorld]);
    dini_IntSet(filet, "rClassid", PosInfo[playerid][pClassid]);
    dini_IntSet(filet, "rSkin", PosInfo[playerid][pSkinid]);
Reply
#2

Try compiling in the script and dont forget to define it
Reply
#3

Have you set player position after load the data ?
Reply
#4

Quote:
Originally Posted by Kiyozi_Mu
Посмотреть сообщение
Have you set player position after load the data ?
Yep

on login dialog

pawn Код:
SpawnPlayer(playerid);
                        SetPlayerPosEx(playerid, PosInfo[playerid][rPos_X], PosInfo[playerid][rPos_Y], PosInfo[playerid][rPos_Z]);
                        SetPlayerFacingAngle(playerid, PosInfo[playerid][rPos_A]);
                        SetPlayerInterior(playerid, PosInfo[playerid][rInterior]);
                        SetPlayerVirtualWorld(playerid, PosInfo[playerid][rWorld]);
                        ProjectPData[playerid][PlayerClass] = PosInfo[playerid][pClassid];
                        SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), PosInfo[playerid][rPos_X], PosInfo[playerid][rPos_Y], PosInfo[playerid][rPos_Z], PosInfo[playerid][rPos_A], 0, 0, 0, 0, 0, 0);
                        PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
                        PlayerPlaySound(playerid,1186 ,0, 0, 0);
                        SetPlayerSkin(playerid, PosInfo[playerid][pSkinid]);
                        StopAudioStreamForPlayer(playerid);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)