HeK Posted January 3, 2012 Posted January 3, 2012 (edited) Hello guys, i have a script made by Stanley Sathler a great friend, and in this script you hit the marker a gui pops up and you choose a vehicle, the problem is, i want each player to have a Max of 1 vehicle, or they will spawn the area with vehicles. -- -------------------------------------------------------- -- [x] Author: Stanley Sathler -- [x] Function: Spawn vehicle on map -- [X] Group: |MS-13| Mara Salvatrucha -- -------------------------------------------------------- function SpawnTheVehicle(model) Vehicle = createVehicle(tonumber(model), 1597, -1705, 5) setVehicleColor(Vehicle, 0) warpPedIntoVehicle(source, Vehicle) end addEvent("SpawnVehicleOnMap", true) addEventHandler("SpawnVehicleOnMap", getRootElement(), SpawnTheVehicle) Edited January 5, 2012 by Guest Zero is a number too.
Castillo Posted January 3, 2012 Posted January 3, 2012 You're showing everything but the needed, post your server-side script. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
HeK Posted January 3, 2012 Author Posted January 3, 2012 Edited, that's the last .lua i have on this resource. Zero is a number too.
Castillo Posted January 3, 2012 Posted January 3, 2012 -- -------------------------------------------------------- -- [x] Author: Stanley Sathler -- [x] Function: Spawn vehicle on map -- [X] Group: |MS-13| Mara Salvatrucha -- -------------------------------------------------------- local playerVehicles = {} function SpawnTheVehicle(model) if isElement(playerVehicles[source]) then destroyElement(playerVehicles[source]) end playerVehicles[source] = createVehicle(tonumber(model), 1597, -1705, 5) setVehicleColor(playerVehicles[source], 0) warpPedIntoVehicle(source, playerVehicles[source]) end addEvent("SpawnVehicleOnMap", true) addEventHandler("SpawnVehicleOnMap", getRootElement(), SpawnTheVehicle) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
HeK Posted January 3, 2012 Author Posted January 3, 2012 Thanks so much Castillo it worked. Zero is a number too.
Castillo Posted January 3, 2012 Posted January 3, 2012 You're welcome . San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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