14.10.2011, 07:09
I noticed you are using "GetPlayerVehicleID" as Model.
You should look the functions that you use up in the wiki. GetPlayerVehicleID, will give you the ID and not the model. Try for example like this: "GetVehicleModel(GetPlayerVehicleID(playerid)) "
Now about your SaveCarInfo function. How about you change your parameters?
Instead of SaveCarInfo(playerid), you could use SaveCarInfo(playerid, vehicleid). Then it would look something like this:
Try going from there. Play around with it and look up functions in the wiki.
You should look the functions that you use up in the wiki. GetPlayerVehicleID, will give you the ID and not the model. Try for example like this: "GetVehicleModel(GetPlayerVehicleID(playerid)) "
Now about your SaveCarInfo function. How about you change your parameters?
Instead of SaveCarInfo(playerid), you could use SaveCarInfo(playerid, vehicleid). Then it would look something like this:
pawn Код:
forward SaveCarInfo(playerid, vehicleid);
public SaveCarInfo(playerid, vehicleid)
{
new vfile[256], string[256];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(vfile, sizeof(vfile), ARS_VEH, name); //Are you sure this is right?
new Float:X, Float:Y, Float:Z, Float:A;
GetVehiclePos(vehicleid, X, Y, Z);
GetVehicleZAngle(vehicleid, A);
dini_IntSet(vfile, "Model", GetVehicleModel(vehicleid));
dini_Set(vfile, "Plate", PlayerInfo[playerid][pFirstname] );
dini_FloatSet(vfile, "LocX", X);
dini_FloatSet(vfile, "LocY", Y);
dini_FloatSet(vfile, "LocZ", Z);
dini_FloatSet(vfile, "LocA", A);
dini_IntSet(vfile, "Color1",VehicleInfo[playerid][vColor1]);
format(string, sizeof(string), "Car Saved At %f, %f, %f, %f", X, Y, Z, A);
SendClientMessage(playerid, GREEN, string);
return 1;
}