Jump to content

Help - warpPedIntoVehicle Don't work at client side?


denny199

Recommended Posts

Hi there, I was making a sort of streetrace but There was one problem,

I had added it this client side:

function test () 
ped = createPed ( 111, 0, 0, 4 ) 
car = createVehicle ( 411, 0, 0, 4 ) 
warpPedIntoVehicle ( ped, car ) 
setPedControlState ( ped, "accelerate", true ) 
end 
addCommandHandler ( "setup", test ) 

but now the ped can't warp in the vehicle HELP!

But this doesn't work I've got tried this:

added server side but setPedControlState is client side

Had triggered via serverside to clientside but an error because ped was in server side

Please help ;):fadein:

Regards,

Danny

Link to comment
--Client side 
function test () 
ped = createPed ( 111, 0, 0, 4 ) 
car = createVehicle ( 411, 0, 0, 4 ) 
setPedControlState ( ped, "accelerate", true ) 
triggerClientEvent("onTestFunction", getLocalPlayer(), ped, car) 
end 
addCommandHandler ( "setup", test ) 
  
--server side 
addEvent("onTestFunction", true) 
addEventHandler("onTestFunction", root, 
function(ped, car) 
warpPedIntoVehicle ( ped, car ) 
end) 

Link to comment
--Client side 
function test () 
ped = createPed ( 111, 0, 0, 4 ) 
car = createVehicle ( 411, 0, 0, 4 ) 
setPedControlState ( ped, "accelerate", true ) 
triggerClientEvent("onTestFunction", getLocalPlayer(), ped, car) 
end 
addCommandHandler ( "setup", test ) 
  
--server side 
addEvent("onTestFunction", true) 
addEventHandler("onTestFunction", root, 
function(ped, car) 
warpPedIntoVehicle ( ped, car ) 
end) 

Don't work and mayby is this better :P triggerServerEvent("onTestFunction", getLocalPlayer(), ped, car) -- because it was already client side

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...