[Ajuda] Salvamento
#4

tente dessa forma,irei dar uma pequena base...
pawn Код:
//topo
enum VInfo
{
    Float:X,
    Float:Y,
    Float:Z,

};
new CarrosInfo[MAX_VEHICLES][VInfo];

//no comando

new fstring[60];
new Float:cX,Float:cY,Float:cZ;

new VeiculoID = GetPlayerVehicleID(playerid);
GetVehiclePos(VeiculoID, cX, cY, cZ);
for(i = 0; i != MAX_VEHICLES; ++i)
{
format(fstring, 60, "Carros/%d.ini", i);
if(!DOF2_FileExists(fstring)) break;//verifica
}
format(fstring, 60, "Carros/%d.ini", i);//irб setar em ordem na pasta,0,1,2,3,4......
DOF2_SetFloat(fstring, "X", cX);
DOF2_SetFloat(fstring, "Y", cY);
DOF2_SetFloat(fstring, "Z", cZ);


//para carregar exemplo:

new fstring[60];
for(new i = 0; i < sizeof(CarrosInfo); i++)
{
 format(fstring,sizeof(fstring),Carros/%d.ini,i);
if(DOF2_FileExists(fstring))
{
CarrosInfo[i][X] = DOF2_GetFloat(fstring, "X");
CarrosInfo[i][Y] = DOF2_GetFloat(fstring, "Y");
CarrosInfo[i][Z] = DOF2_GetFloat(fstring, "Z");

Experimente dessa forma,tenho em meu gamemode e funciona perfeitamente.

ou pegue de base...

http://forum.sa-mp.com/showthread.ph...=salvar+carros
Reply


Messages In This Thread
Salvamento - by ArthurxD - 15.09.2014, 02:31
Re: Salvamento - by JonasGabriel - 15.09.2014, 02:33
Re: Salvamento - by ArthurxD - 15.09.2014, 02:38
Re: Salvamento - by JonasGabriel - 15.09.2014, 02:49
Re: Salvamento - by MultiKill - 15.09.2014, 15:38

Forum Jump:


Users browsing this thread: 1 Guest(s)