HustraDev Posted October 2, 2016 Share Posted October 2, 2016 hi guys i made a car shop script and i have problem with it when the player spawn the vehicle he could't enter it code [ Client ] addEventHandler ("onClientGUIClick", root, function() if source == BtnShow then if not isElement(car) then local vehID = guiGridListGetItemText (PlayerVehicleList, guiGridListGetSelectedItem (PlayerVehicleList), 1) local vehName = guiGridListGetItemText (PlayerVehicleList, guiGridListGetSelectedItem (PlayerVehicleList), 2) local x,y,z = getElementPosition(getLocalPlayer()) car = createVehicle(vehID,x+3,y,z) warpPedIntoVehicle(localPlayer,car,0) outputChatBox ("لقد ثم إنزال سيارتك الـ" .. vehName .. "[ نظام المركبات ]", getLocalPlayer(), 40, 50, 120, false) elseif source == BtnHide then destroyElement(car) end end end ) Link to comment
iPrestege Posted October 2, 2016 Share Posted October 2, 2016 Make your code server side please and use table. 1 Link to comment
HustraDev Posted October 2, 2016 Author Share Posted October 2, 2016 13 minutes ago, Mr.Pres[T]ege said: Make your code server side please and use table. HOW ? use table Link to comment
iPrestege Posted October 2, 2016 Share Posted October 2, 2016 Use triggerServerEvent and use table : local vehicle = { } vehicle [ player ] = createVehicle ( .... ) -- P.S : player is not defined here it's just example . 1 Link to comment
HustraDev Posted October 2, 2016 Author Share Posted October 2, 2016 4 minutes ago, Mr.Pres[T]ege said: Use triggerServerEvent and use table : local vehicle = { }vehicle [ player ] = createVehicle ( .... )-- P.S : player is not defined here it's just example . i'm completely lost man can you edit my code i well be grateful client : 9 minutes ago, Mr.Pres[T]ege said: Use triggerServerEvent and use table : local vehicle = { } vehicle [ player ] = createVehicle ( .... ) -- P.S : player is not defined here it's just example . Thanks Man it works i appreciate your help Link to comment
iPrestege Posted October 2, 2016 Share Posted October 2, 2016 No problem any time but make sure to make a trigger to the server side and make the vehicle server side so it will be visible to all and destroy it when the player quit. 1 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