YINI Problem :/
#1

Hello Guys,I Am Having A Problem,When I Save The Position And When I Rejoin To My Server When I Do /gotoplace1 It Teleports Me To The Saved Position,But When Restarting The Server,It Teleports Me To The Default Position (Blueberry):

Codes Of The Command /gotoplace1:
pawn Код:
COMMAND:gotoplace1(playerid, params[])
{
    if(!fexist(user_ini_file(playerid)))
    {
    SendClientMessage(playerid, COLOR_RED, "You Have Not Saved Your Place Number 1, Yet! Use /saveplace1 To Save Your Current Place To Number 1");
    }
    else if(fexist(user_ini_file(playerid)))
    {
    INI_ParseFile(user_ini_file(playerid), "load_user_%s", .bExtra = true, .extra = playerid);
    SetPlayerPos(playerid, YPosInfo[playerid][PosX], YPosInfo[playerid][PosY], YPosInfo[playerid][PosZ]);
    SetPlayerFacingAngle(playerid, YPosInfo[playerid][Angle]);
    SetPlayerInterior(playerid, YPosInfo[playerid][Interior]);
    SetPlayerVirtualWorld(playerid, YPosInfo[playerid][VirtualWorld]);
    SendClientMessage(playerid, COLOR_ORANGE, "Successfully Teleported To Your Place Number 1.");
    }
    return 1;
}
Reply
#2

Here:

pawn Код:
forward @load_user_position(playerid, name[], value[]);

@load_user_position(playerid, name[], value[])
{
    INI_Float("PositionX", YPosInfo[playerid][PosX]);
    INI_Float("PositionY", YPosInfo[playerid][PosY]);
    INI_Float("PositionZ", YPosInfo[playerid][PosZ]);
    INI_Float("Angle", YPosInfo[playerid][Angle]);
    INI_Int("Interior", YPosInfo[playerid][Interior]);
    INI_Int("VirtualWorld", YPosInfo[playerid][VirtualWorld]);
    return 1;
}
Reply
#3

lol i didn't notice that..
Reply
#4

pawn Код:
#define YPos_Path "YPOS/%s.ini" /*Will define user's account path*/
stock user_ini_file(playerid) //Will create a new stock so we can easily use it later to load/save user's data in user's path
{
    new str[128],user_name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,user_name,sizeof(user_name));

    for(new d,len = strlen(user_name); d != len; d++)
        user_name[d] = tolower(user_name[d]);

    format(str,sizeof(str),YPos_Path,user_name);
    return str;
}
Try this
Reply
#5

Still,when i use /gotoplace1,i automatticly be teleported to blueberry
Reply
#6

idk what's wrong there
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)