[INI]Need Car Save and Load Code - 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: [INI]Need Car Save and Load Code (
/showthread.php?tid=372395)
[INI]Need Car Save and Load Code -
Admigo - 26.08.2012
Heey all,
Can someone please give me a Car Save and Load Code ?
So when you enter a command like /parkcar the position of vehicle will be saved and when server restart the vehicle will be there.
I tried housecar from GarHouse but dont work.
Its saves good but it dont load.
Thanks Admigo
Re: [INI]Need Car Save and Load Code -
Dan. - 26.08.2012
http://forum.sa-mp.com/forumdisplay.php?f=70
Look at some tutorials, how to make saving systems, how to make car & house system, you will learn how to make it. But well, what file saving system are you using currently?
Re: [INI]Need Car Save and Load Code - HuSs3n - 26.08.2012
maybe this
https://sampforum.blast.hk/showthread.php?tid=166714
Re: [INI]Need Car Save and Load Code -
Admigo - 26.08.2012
Why my vehicles dont load?
It saved good but dont load.
Код:
//load user data
INI_Int("Vehicle Model ID",PlayerInfo[playerid][vModelID]);
INI_Float("Vehicle PosX",PlayerInfo[playerid][vPosX]);
INI_Float("Vehicle PosY",PlayerInfo[playerid][vPosY]);
INI_Float("Vehicle PosZ",PlayerInfo[playerid][vPosZ]);
INI_Float("Vehicle PosA",PlayerInfo[playerid][vPosA]);
//park command
if (strcmp("/park", cmdtext, true, 10) == 0)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
new iVehicleID = GetPlayerVehicleID(playerid);
new Float:x, Float:y, Float:z, Float:a;
GetVehiclePos(iVehicleID, x, y, z);
GetVehicleZAngle(iVehicleID, a);
INI_WriteInt(File,"Vehicle Model ID",PlayerInfo[playerid][vModelID]=GetVehicleModel(iVehicleID));
INI_WriteFloat(File,"Vehicle PosX",PlayerInfo[playerid][vPosX]=x);
INI_WriteFloat(File,"Vehicle PosY",PlayerInfo[playerid][vPosY]=y);
INI_WriteFloat(File,"Vehicle PosZ",PlayerInfo[playerid][vPosZ]=z);
INI_WriteFloat(File,"Vehicle PosA",PlayerInfo[playerid][vPosA]=a);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Vehicle Pos Saved!");
INI_Close(File);
return 1;
}
//when login
AddStaticVehicleEx(PlayerInfo[playerid][vModelID],PlayerInfo[playerid][vPosX],PlayerInfo[playerid][vPosY],PlayerInfo[playerid][vPosZ],PlayerInfo[playerid][vPosA],0,0,9999999);
How to fix this?
Re: [INI]Need Car Save and Load Code -
Nirzor - 26.08.2012
your using Dini i guess you can use better things than dini
Re: [INI]Need Car Save and Load Code -
Admigo - 26.08.2012
Quote:
Originally Posted by Nirzor
your using Dini i guess you can use better things than dini
|
I am using Y_Ini.