Jump to content

Warping player to a car - client side possible?


Chlorek

Recommended Posts

Posted

Yo. I have one (I think easy for you scripters) question, so is it possible to warp player to a car using client side function? IF it is please give example or function name =] thanks for help!

Posted

Dude the wiki got all server side functions and events and all client side functions and events,

No there is no function for it, but you can use triggerServerEvent to use warpPedIntoVehicle.

Posted

Yeah I know it is a way, but then I have to move a lot of my functions to another script (server side). And it'll take so much time. So there isn't any way to do that? :?

Posted

What are you talking about, why you need to move alot of functions to another script, i think you don't understand,

It's so simple here (and you don't need to move anything)

--clientside 
function warpPlayer(vehicle) 
triggerServerEvent('warpThePlayer', root, vehicle) 
end 
  
--server side 
addEvent('warpThePlayer', true) 
addEventHandler('warpThePlayer', root, 
function(vehicle) 
warpPedIntoVehicle(client, vehicle) 
end 
) 

not tested but should work.

Posted

Oh no, I understand... you don't know how looks my script so it's you don't understand. But it's not important now. Thanks for help, I found little trick =]

Posted

Erm, Chlorek, sorry to post after you solved it, but there is no way you can have server functions in a client script, you need to do what JR10 said by making a triggerServerEvent...

Posted

I just got new idea how to do that. So bcuz of function on client side is called from server script, I made warping ped to vehicle before triggerClientEvent so on server side =] not on called client side function.

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...