Sparrow Posted February 19, 2012 Share Posted February 19, 2012 I've done a window with grid list and buttons to spawn/destroy and fix the vehicle. spawn is working as well, but fix and destroy didn't work, also no errors on debugscript 3. script: function destroyVeh(thePlayer) if (thePlayer) then local theVehicle = getPedOccupiedVehicle (thePlayer) if (theVehicle) then destroyElement (theVehicle) outputChatBox("Your vehicle has been destroyed.", thePlayer, 0, 255, 0) else outputChatBox("Access Denied.", thePlayer, 255, 0, 0) end end end addEventHandler("onClientGUIClick", destroyButton, destroyVeh, false) function fixVeh(thePlayer) if (thePlayer) then local theVehicle = getPedOccupiedVehicle (thePlayer) if (theVehicle) then fixVehicle (theVehicle) outputChatBox("Your vehicle has been fixed.", thePlayer, 0, 255, 0) else outputChatBox("Access Denied.", thePlayer, 255, 0, 0) end end end addEventHandler("onClientGUIClick", fixButton, fixVeh, false) Link to comment
Castillo Posted February 19, 2012 Share Posted February 19, 2012 Because that just makes no sense. function destroyVeh() local theVehicle = getPedOccupiedVehicle (localPlayer) if (theVehicle) then destroyElement (theVehicle) outputChatBox("Your vehicle has been destroyed.", 0, 255, 0) else outputChatBox("You aren't in a vehicle.", 255, 0, 0) end end addEventHandler("onClientGUIClick", destroyButton, destroyVeh, false) function fixVeh() local theVehicle = getPedOccupiedVehicle (localPlayer) if (theVehicle) then fixVehicle (theVehicle) outputChatBox("Your has been fixed your vehicle.", 0, 255, 0) else outputChatBox("You aren't in a vehicle.", 255, 0, 0) end end addEventHandler("onClientGUIClick", fixButton, fixVeh, false) Link to comment
Sparrow Posted February 19, 2012 Author Share Posted February 19, 2012 (edited) ok, thanks solidsnake, EDIT: the vehicle didn't destroyed when I press "Destroy" button. Edited February 19, 2012 by Guest Link to comment
Castillo Posted February 19, 2012 Share Posted February 19, 2012 I would use a trigger to server side to destroy the vehicle/fix it. Link to comment
Sparrow Posted February 19, 2012 Author Share Posted February 19, 2012 fix is working, only the destroy didn't work, it didn't destroy the vehicle. 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