YINI Problem :/ - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: YINI Problem :/ (
/showthread.php?tid=514833)
YINI Problem :/ -
Youssef214 - 23.05.2014
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;
}
Re: YINI Problem :/ -
Youssef214 - 23.05.2014
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;
}
Re: YINI Problem :/ -
Youssef214 - 23.05.2014
lol i didn't notice that..
Re: YINI Problem :/ -
AroseKhanNiazi - 23.05.2014
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
Re: YINI Problem :/ -
Youssef214 - 23.05.2014
Still,when i use /gotoplace1,i automatticly be teleported to blueberry
Re: YINI Problem :/ -
AroseKhanNiazi - 23.05.2014
idk what's wrong there