denny199 Posted July 17, 2011 Share Posted July 17, 2011 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 Regards, Danny Link to comment
JR10 Posted July 17, 2011 Share Posted July 17, 2011 That's because it's a server side only function. Link to comment
denny199 Posted July 17, 2011 Author Share Posted July 17, 2011 That's because it's a server side only function. How can i get resolve it???????, mayby other codes???? Link to comment
JR10 Posted July 17, 2011 Share Posted July 17, 2011 --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
denny199 Posted July 18, 2011 Author Share Posted July 18, 2011 --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 triggerServerEvent("onTestFunction", getLocalPlayer(), ped, car) -- because it was already client side Link to comment
BinSlayer1 Posted July 18, 2011 Share Posted July 18, 2011 just make everything serverside except for setPedControlState what's the point of creating a street race if only the local player can see it? Link to comment
denny199 Posted July 18, 2011 Author Share Posted July 18, 2011 just make everything serverside except for setPedControlState what's the point of creating a street race if only the local player can see it? setPedControlState Isn't server side , And i need this for fun, so it means missions Link to comment
BinSlayer1 Posted July 18, 2011 Share Posted July 18, 2011 I said "except for setPedControlState", that one will be clientside indeed Link to comment
denny199 Posted July 18, 2011 Author Share Posted July 18, 2011 I said "except for setPedControlState", that one will be clientside indeed aah yes, sorry, but I wanna have this to for my atomatic train system and much more, that's why i need those codes or else it don't work 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