-
Posts
493 -
Joined
Everything posted by toptional
-
The problem is everything that happens in mainFunction happens to everyone i need it local and i can't figure it out
-
I get no debug errors, What im trying to do is it checks if the player has a vehicle and it outputs the chatbox someone it toggle's off all controls and freezes the vehicle then after 5 seconds everything is reversed thats not working though. function SpawnDodo () triggerServerEvent ( "spawnDodo", localPlayer ) guiSetVisible(Window2, false) showCursor(false) destroyElement ( DestinationBlip ) destroyElement ( DestinationMarker ) PasengerMarker = createMarker (1574.69788, 1503.02808, 10.8363, "checkpoint",5,9,233,213,105 ) addEventHandler ( "onClientMarkerHit", PasengerMarker, mainFunction ) end addEventHandler ( 'onClientGUIClick', Button2, SpawnDodo, false ) function mainFunction( player ) if ( getPedOccupiedVehicle (player) ) then outputChatBox ("Your passengers are being loaded please stand by.",255, 50, 0, false ) toggleAllControls ( false ) setElementFrozen ( player, true ) setTimer(function (player) outputChatBox ("Your passengers now loaded please make your way to the runway to depart.", 255, 50, 0, false ) toggleAllControls ( true ) setElementFrozen (player, false ) destroyElement ( PasengerMarker ) end, 5000, 1,player ) end end
-
It depends the player might go in the marker with the vehilce or not, either way it's not working Manve. no errors!
-
Here is the client function SpawnDodo () triggerServerEvent ( "spawnDodo", localPlayer ) guiSetVisible(Window2, false) showCursor(false) destroyElement ( DestinationBlip ) destroyElement ( DestinationMarker ) PasengerMarker = createMarker (1574.69788, 1503.02808, 10.8363, "checkpoint",5,9,233,213,105 ) addEventHandler ( "onClientMarkerHit", PasengerMarker, mainFunction ) end addEventHandler ( 'onClientGUIClick', Button2, SpawnDodo, false ) And here the server addEvent ( "spawnDodo", true) addEventHandler ("spawnDodo", root, function () destroyElement ( source ) local dodo = createVehicle ( 593, 1580.09619, 1358.62195, 16, 0, 0,180 ) warpPedIntoVehicle( source, dodo ) outputChatBox ("#00CD66You will now take your first flight! Go to the blip marked on your map to pickup your first passenger.", source,24,116,205, true) fixVehicle ( dodo ) outputChatBox ("#EE9A00Please make your way to the terminal to pick the passnegers.", source,24,116,205, true) --destroyElement ( getRootElement() ) end ) My issue is this im trying to do this: when you hit this marker a gui shows up and you press the button and it spawns a dodo and destroys the current car you are in, althought when i change the destroyElement to ( source ) nothing is destroyed but with ( getRootElement() ) all the cars are destroyed which is not what i want Any help?
-
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
-
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'
-
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 )
-
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.
-
Silly mistake by me btw, when i use fixVehicle ( theVehicle ) What goes in the parameters "theVehicle" This is server side, it should fix the car of the local player.
-
Got this error with this script SCRIPT ERROR: Avia_Intro\server.lua:18: or '...' expected near 'local' addEvent ( "spawnDodo", true) addEventHandler ("spawnDodo", root, function ( local dodo = createVehicle ( 593, 1690.14868, 1453.82971, 10.76650, 0, 0, 0 ) warpPedIntoVehicle( source, dodo ) outputChatBox ("#FF0000You will now take your first flight! Go to the blip marked on your map to pickup your first passenger.", getRootElement(), 255, 0, 0, true ) end )
-
Thanks
-
Hi, so im making this gui with buttons on it that open another GUI, for some reason when i press the button it opens the small gui, but it's behind the main one, how do i make it infront? GUIEditor = { button = {}, window = {}, } Window1 = guiCreateWindow(369, 184, 547, 378, "Airline Owner Panel", false) guiSetAlpha(Window1, 0.84) Button1= guiCreateButton(29, 40, 138, 67, "Airline Money", false, Window1) guiSetFont(Button1, "default-bold-small") guiSetProperty(Button1, "NormalTextColour", "FFFF0101") Button2 = guiCreateButton(381, 46, 135, 67, "Invite Members", false, Window1) guiSetFont(Button2, "default-bold-small") guiSetProperty(Button2, "NormalTextColour", "FFFF0101") Button3 = guiCreateButton(381, 123, 136, 68, "Member List", false, Window1) guiSetFont(Button3, "default-bold-small") guiSetProperty(Button3, "NormalTextColour", "FFFF0101") Button4 = guiCreateButton(381, 201, 138, 66, "Set Payrate", false, Window1) guiSetFont(Button4, "default-bold-small") guiSetProperty(Button4, "NormalTextColour", "FFFF0101") Button5 = guiCreateButton(380, 282, 141, 68, "Airline Vehicles List", false, Window1) guiSetFont(Button5, "default-bold-small") guiSetProperty(Button5, "NormalTextColour", "FFFF0101") Button6 = guiCreateButton(29, 123, 136, 68, "Member List", false, Window1) guiSetFont(Button6, "default-bold-small") guiSetProperty(Button6, "NormalTextColour", "FFFF0101") Button7 = guiCreateButton(29, 201, 138, 66, "Payrate\n70/30", false, Window1) guiSetFont(Button7, "default-bold-small") guiSetProperty(Button7, "NormalTextColour", "FFFF0101") Button8 = guiCreateButton(29, 282, 141, 68, "Airline Vehicles \n7/10", false, Window1) guiSetFont(Button8, "default-bold-small") guiSetProperty(Button8, "NormalTextColour", "FFFF0101") Window2 = guiCreateWindow(507, 308, 265, 121, "Set Payrate", false) guiWindowSetSizable(Window2, false) Edit1 = guiCreateEdit(29, 51, 158, 27, "Enter Payrate", false,Window2) Button9 = guiCreateButton(201, 51, 37, 26, "Set", false, Window2) guiSetVisible(Window2,false) guiSetVisible(Window1,false) addEventHandler("onClientRender", root, function() dxDrawText("$1,000,000", 412, 271, 537, 289, tocolor(255, 255, 255, 255), 0, "bankgothic", "left", "top", false, false, true, false, false) end ) function openWin() if guiGetVisible(Window1) then guiSetVisible(Window1, false) showCursor(false) else guiSetVisible(Window1, true) showCursor(true) end end bindKey("F2", "down", openWin) function OpenWindow2 () guiSetVisible ( Window2, true) showCursor ( true ) end addEventHandler ( "onClientGUIClick", Button4, OpenWindow2 )
-
Still getting this Unknown command or cvar: chatbox
-
Heres the full code Server Side function freeze() setPedFrozen( client, true ) toggleAllControls( client, false ) toggleControl ( source, "chatbox", true ) end addEvent ( "freeze", true ) addEventHandler ( "freeze", root, freeze ) This might help
-
I added this toggleControl ( source, "chatbox", true ) But got this in the console: Unknown command or cvar: chatbox
-
Problem: How do i enable talking in chat when allcontrols are disabled?
-
server side to freeze setPedFrozen( client, true ) toggleAllControls( client, false ) unfreeze setPedFrozen( client, false ) toggleAllControls( client, true) Great it works I must have done something wrong when i tried before. Thanks!
-
I tried that it didn't work
-
When i freeze a player with setElementFrozen It freezes them but they can run around but not move,(hard to explain) Whats the function to completley freeze them they cannot move a bone?
-
Problem solved over skype, Thanks anyway.
-
the SetElement Frozen doesn't work function doafk (commandname) setTimer ( function() outputChatBox("You will be AFK in 5 seconds",255,0,0, false ) setElementAlpha(getLocalPlayer(),140) setElementFrozen ( player, true ) end, 5000, 1 ) end addCommandHandler("afk", doafk) WARNING AFK\client.lua:6: Bar argument @ 'setElementFrozen'' Getting this error
-
Thanks it works but you forgot the n on function
