Jump to content

client and server


Recommended Posts

Hi, i have a code for client side to spawn a vehicle and i don't know what to put in the server side, I was reading on the wiki and it said "Important Note: Vehicles created client side are only seen by the client that creates, them, aren't synced and players cannot enter them. They are essentially for display only" and this i and i gui button.

function spawn2(button,state)
if button == "left" and state == "down" then
local source = getLocalPlayer() -- get the local player
local x, y, z = getElementPosition ( source ) -- retrive the player's position
createVehicle ( 429 , x + 5, y + 5 , z + 2 )
end
end
addEventHandler ( "onClientGUIClick", Button[8], spawn2 )

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