help with vehicles -
undeteker - 06.11.2015
i am trying to do a save car position
and then it will go to a file but didnt succes,
here is the code that i maked but it
code :
the /savevehicle savethe file on the folder
but the command /getvehicle didnot get the cars
anyone can help me please
PHP код:
if(!strcmp(cmd, "/savevehicle", true))
{
new Float:pos[4], Model, VehiclePath[50], PlayerVehicleID;
PlayerVehicleID = GetPlayerVehicleID(playerid);
format(VehiclePath, 50, "vehicless/%d.ini", PlayerVehicleID);
Model = GetVehicleModel(PlayerVehicleID);
GetVehiclePos(PlayerVehicleID, pos[0], pos[1], pos[2]);
GetVehicleZAngle(PlayerVehicleID, pos[3]);
dini_Create(VehiclePath);й
dini_IntSet(VehiclePath, "Model", Model);
dini_FloatSet(VehiclePath, "X", pos[0]);
dini_FloatSet(VehiclePath, "Y", pos[1]);
dini_FloatSet(VehiclePath, "Z", pos[2]);
dini_FloatSet(VehiclePath, "A", pos[3]);
return 1;
}
if(!strcmp(cmd, "/getvehicle", true))
{
new VehicleToGet[256], VehiclePath[50], Float:pos[4], Model;
format(VehiclePath, 50, "vehicless/%d.ini", strval(VehicleToGet));
Model = dini_Int(VehiclePath, "Model");
pos[0] = dini_Float(VehiclePath, "X");
pos[1] = dini_Float(VehiclePath, "Y");
pos[2] = dini_Float(VehiclePath, "Z");
pos[3] = dini_Float(VehiclePath, "A");
CreateVehicle(Model, pos[0], pos[1], pos[2], pos[3], 0, 0, 0);
return 1;
}
Re : help with vehicles -
StreetRP - 06.11.2015
Change
PHP код:
pos[0] = dini_Float(VehiclePath, "X");
pos[1] = dini_Float(VehiclePath, "Y");
pos[2] = dini_Float(VehiclePath, "Z");
pos[3] = dini_Float(VehiclePath, "A");
PHP код:
pos[0] = dini_Get(VehiclePath, "X");
pos[1] = dini_Get(VehiclePath, "Y");
pos[2] = dini_Get(VehiclePath, "Z");
pos[3] = dini_Get(VehiclePath, "A");
Re: help with vehicles -
undeteker - 06.11.2015
i have errors
C:\Users\йайш\Desktop\щшъ\gamemodes\GTR.pwn(2347) : error 006: must be assigned to an array
C:\Users\йайш\Desktop\щшъ\gamemodes\GTR.pwn(234
: error 006: must be assigned to an array
C:\Users\йайш\Desktop\щшъ\gamemodes\GTR.pwn(2349) : error 006: must be assigned to an array
C:\Users\йайш\Desktop\щшъ\gamemodes\GTR.pwn(2350) : error 006: must be assigned to an array
lines
pos[0] = dini_Get(VehiclePath, "X");
pos[1] = dini_Get(VehiclePath, "Y");
pos[2] = dini_Get(VehiclePath, "Z");
pos[3] = dini_Get(VehiclePath, "A");
Re: help with vehicles -
[ABK]Antonio - 06.11.2015
You never actually set VehicleToGet to anything.
Re: help with vehicles -
undeteker - 07.11.2015
PHP код:
new idx,cmd[256];
cmd = strtok(cmdtext, idx);
PHP код:
pos[0] = DOF2_GetString(VehiclePath, "X");
pos[1] = DOF2_GetString(VehiclePath, "Y");
pos[2] = DOF2_GetString(VehiclePath, "Z");
pos[3] = DOF2_GetString(VehiclePath, "A");
PHP код:
errors :
C:\Users\йайш\Desktop\щшъ\filterscripts\CARPOSSAVE.pwn(116) : error 006: must be assigned to an array
C:\Users\йайш\Desktop\щшъ\filterscripts\CARPOSSAVE.pwn(117) : error 006: must be assigned to an array
C:\Users\йайш\Desktop\щшъ\filterscripts\CARPOSSAVE.pwn(118) : error 006: must be assigned to an array
C:\Users\йайш\Desktop\щшъ\filterscripts\CARPOSSAVE.pwn(119) : error 006: must be assigned to an array
Re: help with vehicles -
Mencent - 07.11.2015
Hello!
PHP код:
format(VehiclePath, 50, "vehicless/%d.ini", strval(VehicleToGet));
"VehicleToGet" has no value, it's empty.