HeK Posted January 3, 2012 Share 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 Link to comment
Castillo Posted January 3, 2012 Share Posted January 3, 2012 You're showing everything but the needed, post your server-side script. Link to comment
HeK Posted January 3, 2012 Author Share Posted January 3, 2012 Edited, that's the last .lua i have on this resource. Link to comment
Castillo Posted January 3, 2012 Share 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) Link to comment
HeK Posted January 3, 2012 Author Share Posted January 3, 2012 Thanks so much Castillo it worked. 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