12.06.2015, 08:10
Hello,
I wanna make PlayerInfo[playerid][pOwnedVehicle1] PlayerInfo[playerid][pOwnerVehicle2] and PlayerInfo[playerid][pOwnerVehicle3], so I can make car limit also to notice owned vehicle when I wanna do /lock /park commands etc..
but I couldn't do it, what I need to do? thats my vehicle system.
I wanna make PlayerInfo[playerid][pOwnedVehicle1] PlayerInfo[playerid][pOwnerVehicle2] and PlayerInfo[playerid][pOwnerVehicle3], so I can make car limit also to notice owned vehicle when I wanna do /lock /park commands etc..
but I couldn't do it, what I need to do? thats my vehicle system.
pawn Code:
enum vehicleInfo
{
vehModel,
vehOwner[32],
vehicle,
Float:vehX,
Float:vehY,
Float:vehZ,
vehC1,
vehC2
}
new VehicleInfo[MAX_VEHS][vehicleInfo];
new newvehicle;
stock LoadVehs()
{
for(new i=0;i<MAX_VEHS;i++)
{
new string[64];
format(string, sizeof(string), "/vehicles/%d.ini", i);
if(fexist(string))
{
INI_ParseFile(string, "LoadVehicles_%s", .bExtra = true, .extra = i);
VehicleInfo[i][vehicle] = CreateVehicle(VehicleInfo[i][vehModel], VehicleInfo[i][vehX], VehicleInfo[i][vehY], VehicleInfo[i][vehZ], VehicleInfo[i][vehC1], VehicleInfo[i][vehC2], 0, -1);
newvehicle=i+1;
}
}
return 1;
}
forward LoadVehicles_data(vehicleid, name[], value[]);
public LoadVehicles_data(vehicleid, name[], value[])
{
INI_Int("Model", VehicleInfo[vehicleid][vehModel]);
INI_String("Owner", VehicleInfo[vehicleid][vehOwner], MAX_PLAYER_NAME);
INI_Float("PosX", VehicleInfo[vehicleid][vehX]);
INI_Float("PosY", VehicleInfo[vehicleid][vehY]);
INI_Float("PosZ", VehicleInfo[vehicleid][vehZ]);
INI_Int("color1", VehicleInfo[vehicleid][vehC1]);
INI_Int("color2", VehicleInfo[vehicleid][vehC2]);
return 1;
}
stock SaveVehs()
{
for(new i=0; i<MAX_VEHS; i++)
{
new string[64];
format(string, sizeof(string), "/vehicles/%d.ini", i);
if(fexist(string))
{
new INI:File=INI_Open(string);
GetVehiclePos(VehicleInfo[i][vehicle], VehicleInfo[i][vehX], VehicleInfo[i][vehY], VehicleInfo[i][vehZ]);
INI_WriteInt(File, "Model", VehicleInfo[i][vehModel]);
INI_WriteString(File, "Owner", VehicleInfo[i][vehOwner]);
INI_WriteFloat(File, "PosX", VehicleInfo[i][vehX]);
INI_WriteFloat(File, "PosY", VehicleInfo[i][vehY]);
INI_WriteFloat(File, "PosZ", VehicleInfo[i][vehZ]);
INI_WriteInt(File, "color1", VehicleInfo[i][vehC1]);
INI_WriteInt(File, "color2", VehicleInfo[i][vehC2]);
INI_Close(File);
}
}
}