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

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.

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

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

Founder of SAUR - Founder/Owner of ARC RPG

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

There is,

https://wiki.multitheftauto.com/wiki/CallClientFunction

https://wiki.multitheftauto.com/wiki/CallServerFunction

But i don't know if it's working.

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted

Yeah but what he means is attualy having a new function the same as a server on in a clinet script, that aint callfunction...

Founder of SAUR - Founder/Owner of ARC RPG

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