Kazafka Posted January 11, 2020 Share Posted January 11, 2020 This one got me on disappointment, It is like 10th time! When I delete a vehicle from my user's list (my vehicle system, "VaporCars", 99% of completement) script SHOULD remove a blip, that is moving within a car, but it says, that this car, that I'm in, is a boolean. Any idea? Code: --Attached elements: BLIP --Im in car: YES --Player is: ME local veh = getPedOccupiedVehicle(player) local vehTable = getAttachedElements(veh) destroyElement(vehTable[1]) --Why this ain't work? Link to comment
Moderators Patrick Posted January 11, 2020 Moderators Share Posted January 11, 2020 paste full code Link to comment
Kazafka Posted January 11, 2020 Author Share Posted January 11, 2020 11 minutes ago, stPatrick said: paste full code Lua: addCommandHandler("usun.pojazd", function(player) local veh = getPedOccupiedVehicle(player) if veh then if(getElementData(veh, "owner") == getPlayerName(player)) then local xml = xmlLoadFile("saved.xml") if xml then local branch = xmlFindChild(xml, "vehs", 0) local table_ = xmlNodeGetChildren(branch) local customID = getElementData(veh, "id") for i, node in ipairs(table_) do if(customID == xmlNodeGetAttribute(node, "customID")) then xmlDestroyNode(node) end end xmlSaveFile(xml) xmlUnloadFile(xml) end destroyElement(veh) local vT = getAttachedElements(veh) destroyElement(vT[1]) outputChatBox("#007FFF[VaporCars] #4a4a4aCar successfully #007FFFdeleted#4a4a4a!", player, 255, 255, 255, true) end end end) Link to comment
Moderators IIYAMA Posted January 12, 2020 Moderators Share Posted January 12, 2020 (edited) 2 hours ago, VaporZ said: SHOULD remove a blip, that is moving within a car, but it says, that this car, that I'm in, is a boolean. Any idea? First get the blip, then destroy the vehicle. Line 21, 22 Where is the blip creation part? Also, never trust values, so always add value checks. Edited January 12, 2020 by IIYAMA Link to comment
Kazafka Posted January 12, 2020 Author Share Posted January 12, 2020 10 hours ago, IIYAMA said: First get the blip, then destroy the vehicle. Line 21, 22 Where is the blip creation part? Also, never trust values, so always add value checks. ahh, that's right. Imma so dumb 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