Jump to content

isa_Khamdan

Members
  • Posts

    484
  • Joined

  • Last visited

Everything posted by isa_Khamdan

  1. The output doesn't work and I do not know what is the reason ( I want it to be visible for the player who triggered the function only ) function DestroyRS( element ) if ( isElement(element) and getElementType (element) == "vehicle" ) and not ( getElementModel ( element ) == 431 ) then local x,y,z = getElementRotation ( element ) if isElementWithinColShape ( element, LineRS ) and (z >= 90) and (z <= 270) then outputChatBox ( "* Destroyed", element, 255, 0, 0, true ) destroyElement( element ) end end end
  2. It works perfectly now and thanks to you else I have one more question how can I compare a number with a number between two numbers like 90 to 270?
  3. Thanks it works but I have little problem with this code it doesn't work and there are no errors in debug function Destroy2( element ) if ( isElement(element) and getElementType (element) == "vehicle" ) then local x,y,z = getElementRotation ( element ) outputChatBox ( "Target player rotation: " .. z ) if z == (z < 90) or z == (z > 270) then destroyElement( element ) end end end
  4. sorry forgot to post the code function Destroy( element ) local Speed = getElementSpeed( element ) if getElementType ( element ) == "vehicle" then if Speed == 0 then destroyElement( element ) end end end
  5. Hello , I have this function that destroy the vehicle if it's speed is 0 but after destroying it in debugscript it show warning WARNING: test1\SafeZone.lua:16: Bad argument @ 'getElementType' [Expected element at argument 1] So how can I fix it?
  6. Hello , I have little Question Do guiSetEnabled work for GUI Gridlists?
  7. isa_Khamdan

    Warp

    Thanks a lot it's working fine now
  8. isa_Khamdan

    Warp

    Like this? setTimer ( fadeCamera, 5, true ) Edit: I want it to Fade just like on the freeroam when you use set position using the map.
  9. isa_Khamdan

    Warp

    It is working but why the Camera doesn't fade?
  10. isa_Khamdan

    Warp

    It doesn't work addEventHandler("onClientGUIClick",root, function () local sel = guiGridListGetSelectedItem(grid) local theVehicle = getPedOccupiedVehicle ( localPlayer ) if source == move then if sel ~= -1 then if not isPedInVehicle ( localPlayer ) then local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) fadeCamera ( false, 0.5) fadeCamera ( true, 2 ) setElementPosition(localPlayer,x,y,z) elseif source == move then if sel ~= -1 then if isPedInVehicle ( localPlayer ) then local Controler = getVehicleController ( theVehicle ) if ( Controler ) then local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) fadeCamera ( false, 0.5 ) fadeCamera ( true, 2 ) setElementPosition(theVehicle,x,y,z) warpPedIntoVehicle ( localPlayer, theVehicle ) end end end end else outputChatBox("* Please Select A Positon",255,0,0) end end end )
  11. isa_Khamdan

    Warp

    Hmm , The Camera fade now but how can I make it stop after 1 second?
  12. isa_Khamdan

    Warp

    then which code should do that??
  13. isa_Khamdan

    Warp

    So it should look like this? fadeCamera ( true, 5)
  14. isa_Khamdan

    Warp

    Only the fade camera isn't working , I think there is a mistake in the Syntax cuz I couldn't find the right one So can you give me the right Syntax for FadeCamera ( Client Side ).
  15. isa_Khamdan

    Warp

    Hmm it works but I still have one problem with my code It doesn't fade Camera so can anyone tell me how can I fix it? fadeCamera(true, 5)
  16. isa_Khamdan

    Warp

    Hello , I making a Warp panel but I am having a little problem with setElementPosition(localPlayer,x,y,z) This will only change the player position so how can I make it spawn the player with the vehicle if he have one in the selected x,y,z?
  17. It works fine I was testing it alone that's why I was getting this problem Thanks for telling me that it skip local player
  18. Edit : I will test it now on my server.
  19. Hello , I made a search bar for my gridlist and I used this code from the forums to make it work but it doesn't and there is no errors at all so can anyone tell me how can I fix it? clientsideResourceStart = function() if column then for id,playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, column, getPlayerName(playeritem), false, false) end end end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart ) function search() guiGridListClear(GUIEditor_Grid[1]) local text = guiGetText(SearchBar) if (text == "") then for index, player in ipairs(getElementsByType("player")) do if (player ~= localPlayer) then local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, 1, getPlayerName(player), false, false) end end else for index, player in ipairs(getElementsByType("player")) do if (player ~= localPlayer) then if string.find (string.upper(getPlayerName(player)), string.upper(text), 1, true) then local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, 1, getPlayerName(player), false, false) end end end end end addEventHandler("onClientGUIChanged", SearchBar, search)
  20. Do these event exists on the server side?
×
×
  • Create New...