toptional Posted March 26, 2013 Posted March 26, 2013 Hi so I'm trying to destroy these 2 elements, a blip and a marker. They are created here DestinationBlip = createBlip ( 1514.71289, 1205.07666, 10.83374, 41, 2,255, 0, 0, 255, 0, 100000) DestinationMarker = createMarker ( 1514.71289, 1205.07666, 10, "cylinder", 2, 9, 233, 213, 105 ) And destroyed here destroyElement ( DestinationBlip ) destroyElement ( DestinationMarker ) It destroys the Blip but not the marker? Whats wrong.
PaiN^ Posted March 26, 2013 Posted March 26, 2013 Show us the function where you destroy theme, And how you trigger the function ( triggers, timer, event, etc.. )
toptional Posted March 26, 2013 Author Posted March 26, 2013 Created here function doubleClicked ( ) local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local vehicleName = guiGridListGetItemText ( source, row, 1 ) triggerServerEvent ( "spawnPlane", localPlayer, vehicleName ) guiSetVisible ( Window, false ) showCursor ( false ) DestinationBlip = createBlip ( 1514.71289, 1205.07666, 10.83374, 41, 2,255, 0, 0, 255, 0, 100000) DestinationMarker = createMarker ( 1514.71289, 1205.07666, 10, "cylinder", 2, 9, 233, 213, 105 ) addEventHandler ( "onClientMarkerHit", DestinationMarker, gettoDestination ) - end end It's Destroyed here function SpawnDodo () triggerServerEvent ( "spawnDodo", localPlayer ) guiSetVisible(Window2, false) showCursor(false) destroyElement ( DestinationBlip ) destroyElement ( DestinationMarker ) PassengerMarker = createMarker ( 1514.71289, 1205.07666, 10, "cylinder", 2, 9, 233, 213, 105 ) PasengerMarker = createMarker (1574.69788, 1503.02808, 10.8363, "checkpoint",5,9,233,213,105 ) end addEventHandler ( 'onClientGUIClick', Button2, SpawnDodo, false )
Markeloff Posted March 26, 2013 Posted March 26, 2013 function SpawnDodo () triggerServerEvent ( "spawnDodo", localPlayer ) guiSetVisible(Window2, false) showCursor(false) then destroyElement ( DestinationBlip ) destroyElement ( DestinationMarker ) PassengerMarker = createMarker ( 1514.71289, 1205.07666, 10, "cylinder", 2, 9, 233, 213, 105 ) PasengerMarker = createMarker (1574.69788, 1503.02808, 10.8363, "checkpoint",5,9,233,213,105 ) end addEventHandler ( 'onClientGUIClick', Button2, SpawnDodo, false ) I added a then after showCursor(false) Try it now
ZL|LuCaS Posted March 26, 2013 Posted March 26, 2013 function SpawnDodo () triggerServerEvent ( "spawnDodo", localPlayer ) guiSetVisible(Window2, false) showCursor(false) then destroyElement ( DestinationBlip ) destroyElement ( DestinationMarker ) PassengerMarker = createMarker ( 1514.71289, 1205.07666, 10, "cylinder", 2, 9, 233, 213, 105 ) PasengerMarker = createMarker (1574.69788, 1503.02808, 10.8363, "checkpoint",5,9,233,213,105 ) end addEventHandler ( 'onClientGUIClick', Button2, SpawnDodo, false ) I added a then after showCursor(false) Try it now this is wrong showCursor(false) then
toptional Posted March 26, 2013 Author Posted March 26, 2013 Yes that is wrong, no idea how that would fix it Got this error with that WARNING: Loading script failed: Avia_Intro\client.lua:78: unexpected symbol near 'then'
ZL|LuCaS Posted March 26, 2013 Posted March 26, 2013 Yes that is wrong, no idea how that would fix itGot this error with that WARNING: Loading script failed: Avia_Intro\client.lua:78: unexpected symbol near 'then' you are creating again. function SpawnDodo () triggerServerEvent ( "spawnDodo", localPlayer ) guiSetVisible(Window2, false) showCursor(false) destroyElement ( DestinationBlip ) destroyElement ( DestinationMarker ) PassengerMarker = createMarker ( 1514.71289, 1205.07666, 10, "cylinder", 2, 9, 233, 213, 105 ) PasengerMarker = createMarker (1574.69788, 1503.02808, 10.8363, "checkpoint",5,9,233,213,105 ) end addEventHandler ( 'onClientGUIClick', Button2, SpawnDodo, false ) function SpawnDodo () guiSetVisible(Window2, false) showCursor(false) destroyElement ( DestinationBlip ) destroyElement ( DestinationMarker ) end addEventHandler ( 'onClientGUIClick', Button2, SpawnDodo, false ) ERROR? post your full code
toptional Posted March 26, 2013 Author Posted March 26, 2013 Thanks that worked but i got another error function mainFunction() outputChatBox ("Your passengers are being loaded please stand by.",getRootElement(), 255, 0, 0, false ) toggleAllControls ( false ) setElementFrozen ( player, true ) setTimer(function () outputChatBox ("Your passengers now loaded please make your way to the runway to depart.",getRootElement(), 255, 0, 0, false ) toggleAllControls ( true ) setElementFrozen ( player, true ) destroyElement ( PasengerMarker ) end, 5000, 1 ) end the setElementFrozen does not work getting a bad argument
iPrestege Posted March 26, 2013 Posted March 26, 2013 function mainFunction( player ) outputChatBox ("Your passengers are being loaded please stand by.",getRootElement(), 255, 0, 0, false ) toggleAllControls ( player , false ) setElementFrozen ( player , true ) setTimer(function (player) outputChatBox ("Your passengers now loaded please make your way to the runway to depart.",getRootElement(), 255, 0, 0, false ) toggleAllControls ( player,true ) setElementFrozen ( player, true ) destroyElement ( PasengerMarker ) end, 5000, 1,player ) end
Smart. Posted March 26, 2013 Posted March 26, 2013 Thanks that workedbut i got another error function mainFunction() outputChatBox ("Your passengers are being loaded please stand by.",getRootElement(), 255, 0, 0, false ) toggleAllControls ( false ) setElementFrozen ( player, true ) setTimer(function () outputChatBox ("Your passengers now loaded please make your way to the runway to depart.",getRootElement(), 255, 0, 0, false ) toggleAllControls ( true ) setElementFrozen ( player, true ) destroyElement ( PasengerMarker ) end, 5000, 1 ) end the setElementFrozen does not work getting a bad argument If this is a server sided script you're aware that every player will get those messages? and oh, the player isn't passed onto the function. Also, all those markers/blips will be visible for every player. If it's a client script which I guess then change player to localPlayer and remove the second argument of outputChatBox as there isn't any visibleTo argument when using outputChatBox client sided.
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