• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [Help] - Park vehicle cmd issues
#5
(2021-01-20, 03:06 AM)Behemoth Wrote: You will need to add something for the VW in the enumerator for PlayerVehicleInfo (something like pvVW). In UpdatePlayerVehicleParkPosition you will then need to adjust it accordingly, by adding a VW parameter to it.



Code:
UpdatePlayerVehicleParkPosition(playerid, playervehicleid, Float:newx, Float:newy, Float:newz, Float:newangle, Float:health, vw)? // notice I've added VW on the end



Furthermore, I find the old coords for the vehicle pretty pointless as even the smallest movement will change it, so I'd remove that;

Code:
Float:oldx, Float:oldy, Float:oldz

oldx = PlayerVehicleInfo[playerid][playervehicleid][pvPosX];

oldy = PlayerVehicleInfo[playerid][playervehicleid][pvPosY];

oldz = PlayerVehicleInfo[playerid][playervehicleid][pvPosZ];



if(oldx == newx && oldy == newy && oldz == newz) return 0;



and keep just oldfuel (it should look like new Float:oldfuel);.



Moving on...



You will now want to save the new field in the enum PlayerVehicleInformation, to do this, you should set it with "GetPlayerVirtualWorld"

Something like;

Code:
PlayerVehicleInfo[playerid][playervehicleid][pvVW] = GetPlayerVirtualWorld(playerid);



..- should work fine.



(I should note, none of this is tested as I don't have all your files, but it should give you the general idea)



and that's basically it for logging the VW, for a start anyway. You'll need to update your enum so it saves to the database (ini, sql etc) by adding a field for VW. You'll also need to find where the vehicle spawns and make sure that the VW is called and set for that too.



I appreciate this isn't a step by step guide, but it should point you in the right direction.



Thank you for the help, I'll take a look at getting it set up tonight when the rest of the team is on.
  Reply


Messages In This Thread
[Help] - Park vehicle cmd issues - by Disretired - 2021-01-20, 12:15 AM
RE: [Help] - Park vehicle cmd issues - by Disretired - 2021-01-20, 04:05 AM

Forum Jump: