23.01.2011, 23:41
Well, I am still making a Vehicle System and I am having the same problem as before but this is Saving;
If you could tell me how to fix this I would be eternily greatful.
The command is just saying "SERVER: Unknown Command." but I don't see what is wrong.
I would also appreciate it if someone could tell me how to propaly save the Vehicle's ID for example, Infernus's ID is 411 so I would want to save the 411 in to VehicleInfo[vehicle][vModel].
Cheers.
pawn Код:
if(strcmp(cmdtext, "/savev", true) == 0)
{
new file[128];
new vehicle = GetPlayerVehicleID(playerid);
new Float:X,Float:Y,Float:Z,Float:A;
for(new v = 0; v<MAX_CARS; v++)
{
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
format(file, sizeof(file), "Vehicles/%d.ini", v);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
VehicleInfo[v][vModel] = vehicle;
VehicleInfo[v][vX] = X;
VehicleInfo[v][vY] = Y;
VehicleInfo[v][vZ] = Z;
VehicleInfo[v][vA] = A;
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Model", VehicleInfo[vehicle][vModel]);
dini_FloatSet(file, "VehX", VehicleInfo[vehicle][vX]);
dini_FloatSet(file, "VehY", VehicleInfo[vehicle][vY]);
dini_FloatSet(file, "VehZ", VehicleInfo[vehicle][vZ]);
dini_FloatSet(file, "VehA", VehicleInfo[vehicle][vA]);
}
print("Saved!");
}
return 1;
}
The command is just saying "SERVER: Unknown Command." but I don't see what is wrong.
I would also appreciate it if someone could tell me how to propaly save the Vehicle's ID for example, Infernus's ID is 411 so I would want to save the 411 in to VehicleInfo[vehicle][vModel].
Cheers.