Gtagasje Posted October 26, 2011 Posted October 26, 2011 Hi, I made a vehicle gui which will give you a vehicle if you press the button. And it works, but now I wan't it to warp you inside also,. This is what I have: Server: function createLS () local LS = createVehicle ( 596, 1557.03284, -1605.92700, 13 ) end addEvent("PoliceLS",true) addEventHandler("PoliceLS", root, createLS) function createLV () local LV = createVehicle ( 598, 1557.03284, -1605.92700, 13 ) end addEvent("PoliceLV",true) addEventHandler("PoliceLV", root, createLV) function createSF () local SF = createVehicle ( 597, 1557.03284, -1605.92700, 13 ) end addEvent("PoliceSF",true) addEventHandler("PoliceSF", root, createSF) function createRan () local Ran = createVehicle ( 599, 1557.03284, -1605.92700, 13 ) and warpPedIntoVehicle ( Ran ) end addEvent("PoliceRan",true) addEventHandler("PoliceRan", root, createRan) I didn't add the client because I know warpPedIntoVehicle is serverside.
CapY Posted October 26, 2011 Posted October 26, 2011 Why you added local Ran = createVehicle ( 599, 1557.03284, -1605.92700, 13 ) and warpPedIntoVehicle ( Ran ) "AND" ? Try to remove it.
TAPL Posted October 26, 2011 Posted October 26, 2011 why your code has so much space? function createLS () local LS = createVehicle ( 596, 1557.03284, -1605.92700, 13 ) warpPedIntoVehicle (source,LS) end addEvent("PoliceLS",true) addEventHandler("PoliceLS", root, createLS) function createLV () local LV = createVehicle ( 598, 1557.03284, -1605.92700, 13 ) warpPedIntoVehicle (source,LV) end addEvent("PoliceLV",true) addEventHandler("PoliceLV", root, createLV) function createSF () local SF = createVehicle ( 597, 1557.03284, -1605.92700, 13 ) warpPedIntoVehicle (source,SF) end addEvent("PoliceSF",true) addEventHandler("PoliceSF", root, createSF) function createRan () local Ran = createVehicle ( 599, 1557.03284, -1605.92700, 13 ) warpPedIntoVehicle (source,Ran) end addEvent("PoliceRan",true) addEventHandler("PoliceRan", root, createRan)
Gtagasje Posted October 27, 2011 Author Posted October 27, 2011 I don't know . But really thank you for the answer .
MTA Team qaisjp Posted October 27, 2011 MTA Team Posted October 27, 2011 Gtagasje, don't use several events for the same thing. Make one event, and as an argument put the model id (triggerServerEvent("SpawnPoliceCar", root, modelID)
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