ViRuZGamiing Posted June 15, 2014 Share Posted June 15, 2014 Hi guys, I have 2 problems, 1. Bad 'ped' pointer @warpPedIntoVehicle 2. The setElementPosition doesn't do what it has too do. boatMarker = createMarker ( -1734.4, 221.3, 2.5, "cylinder", 3.5, 255, 0, 0, 255 ) dft = createVehicle( 578, -1745.1, 212.10001, 4.3, 0, 0, 270 ) dftBoat = createVehicle ( 473, -1747.4, 212.10001, 5 ) attachElements ( dftBoat, dft ) function spawnTheBoat ( thePlayer ) if getElementModel ( thePlayer ) == 578 then detachElements ( dftBoat ) setElementPosition (dftBoat, -1723.6, 229.39999, 0, 0, 0, 270) warpPedIntoVehicle ( thePlayer, dftBoat ) setElementFrozen ( dft, true ) function unfreezeDft ( thePlayer ) setElementFrozen ( dft, false ) attachElements ( dftBoat, dft ) warpPedIntoVehicle ( thePlayer, dft ) end addCommandHandler ("ready", unfreezeDft) end end addEventHandler ("onMarkerHit", boatMarker, spawnTheBoat) Yes this is the full code Link to comment
MIKI785 Posted June 15, 2014 Share Posted June 15, 2014 Function inside a function, really? It doesn't work because thePlayer is the string "ready" (the command) in unfreezeDft. Link to comment
ViRuZGamiing Posted June 15, 2014 Author Share Posted June 15, 2014 how do you mean is the string "ready"? changed the function in function; boatMarker = createMarker ( -1734.4, 221.3, 2.5, "cylinder", 3.5, 255, 0, 0, 255 ) dft = createVehicle( 578, -1745.1, 212.10001, 4.3, 0, 0, 270 ) dftBoat = createVehicle ( 473, -1747.4, 212.10001, 5 ) attachElements ( dftBoat, dft ) function spawnTheBoat ( thePlayer ) if getElementModel ( thePlayer ) == 578 then detachElements ( dftBoat ) setElementPosition (dftBoat, -1723.6, 229.39999, 0, 0, 0, 270) warpPedIntoVehicle ( thePlayer, dftBoat ) setElementFrozen ( dft, true ) end end addEventHandler ("onMarkerHit", boatMarker, spawnTheBoat) function unfreezeDft ( thePlayer ) setElementFrozen ( dft, false ) attachElements ( dftBoat, dft ) warpPedIntoVehicle ( thePlayer, dft ) end addCommandHandler ("ready", unfreezeDft) Link to comment
MIKI785 Posted June 15, 2014 Share Posted June 15, 2014 thePlayer is equal to "ready"... addCommandHandler Link to comment
ViRuZGamiing Posted June 15, 2014 Author Share Posted June 15, 2014 so what do I need to too? remove thePlayer and write "ready" everywhere? The first function doesn't work either with the warpPedIntoVehicle and there's no command triggering it. Link to comment
Moderators IIYAMA Posted June 15, 2014 Moderators Share Posted June 15, 2014 Your code is serverside right? MIKI785 is talking about this. For addCommandHandler: Server player playerSource, string commandName, [string arg1, string arg2, ...] Client string commandName, [string arg1, string arg2, ...] Make sure your code is serverside in the meta. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now