Jump to content

isa_Khamdan

Members
  • Posts

    484
  • Joined

  • Last visited

Everything posted by isa_Khamdan

  1. Hmm I forgot that So how can I fix it? Edit: will this work? Getting the speed first then check if the speed is 0 or not and if not then return?
  2. I used a timer so if the vehicle stopped for 5 seconds it will get destroyed or what I did is wrong?
  3. It return the speed "142.87299415513"
  4. It doesn't destroy the vehicle and there are no errors in debug Edit: it only destroy the car if there was no one driving it
  5. Still the same local Line1 = createColRectangle ( -1318.4671630859, -189.9077911377, 1000, 1000) function SafeZoneA(Vehicle) if getElementType ( Vehicle ) == "vehicle" then if (isElementWithinColShape(Vehicle, Line1)) then local Speed = getElementSpeed(Vehicle,"kmh") if Speed == 0 then setTimer ( destroyElement , 1000, 1, Vehicle ) end end end end addEventHandler ( "onColShapeHit", getRootElement(), SafeZoneA ) function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.8 * 100 end else outputDebugString("Not an element. Can't get speed") return false end end
  6. It doesn't work local Line1 = createColRectangle ( -1318.4671630859, -189.9077911377, 1000, 1000) function SafeZoneA(thePlayer) if getElementType ( thePlayer ) == "vehicle" then if (isElementWithinColShape(thePlayer, Line1)) then if ( getElementVelocity ( thePlayer ) == 0 ) then setTimer ( destroyElement , 1000, 1, thePlayer ) end end end end addEventHandler ( "onColShapeHit", getRootElement(), SafeZoneA ) function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.8 * 100 end else outputDebugString("Not an element. Can't get speed") return false end end
  7. Read again , It's a simple resource and it's easy to use.
  8. Why it doesn't work? local Line1 = createColRectangle ( -1287.9871826172, -217.75384521484, 500, 500) function SafeZoneA(thePlayer) if getElementType ( thePlayer ) == "vehicle" then if (isElementWithinColShape(thePlayer, Line1)) then if getElementVelocity ( thePlayer == 0) then setTimer ( destroyElement , 10000, 1, thePlayer ) end end end end addEventHandler ( "onColShapeHit", getRootElement(), SafeZoneA )
  9. Is this right? function Refresh () guiGridListClear ( GUIEditor_Grid[1] ) 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 ( "onClientPlayerJoin", getRootElement(), Refresh ) addEventHandler ( "onClientPlayerQuit", getRootElement(), Refresh ) addEventHandler ( "onClientPlayerChangeNick", getRootElement(), Refresh )
  10. Hello , I want to make a script that destroy cars if they stop in a collshape ( safe area ) for 5 seconds so if someone stopped his car and didn't move in 5 seconds the car will be destroyed. So I am going to use If isElementWithinCollsShape to check if the vehicle inside the safe area or not and then I will use getElementSpeed to see if the element is moving or not and if it's speed is 0 then it will destroy it So it's all good now but there is one thing that I didn't figure out how to do it How can I make it count the time so if player stopped his vehicle for 5 seconds then it will destroy it?
  11. Hmm I know how to use these events but how can I make the grid list refresh the player names?
  12. Hmm there still one problem the Names will never get updated How can I make them refresh if a player joined the server or if someone changed his nick.
  13. Thanks a lot Else : Can you view my thread that I posted before about jail system , You helped me to fix the timer but I am still stuck with the text and it's been long and I still didn't figure out how to do it so can you please help me to fix it
  14. complete codig! Rest of the code doesn't have anything about the Grid list and here is the window and the grid list GUIEditor_Window[1] = guiCreateWindow(355, 104, 227, 457, "Transfer Money", false) guiWindowSetSizable(GUIEditor_Window[1], false) guiSetProperty(GUIEditor_Window[1], "CaptionColour", "FFFF0000") GUIEditor_Grid[1] = guiCreateGridList(9, 71, 208, 243, false, GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1], 2) column = guiGridListAddColumn(GUIEditor_Grid[1], "Player List", 1)
  15. Hello , I have a GUI Grid list and I want to load player names in it okay so this code works but there is one problem with it The names get duplicates for example a player Names " King " his name will show in Grid list two Times like this King King So can anyone tell me how to fix this? else I want to make it refresh every few minutes if it's possible Thanks. 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", getRootElement(), clientsideResourceStart)
  16. This one is the right one to put it on the config? "1.3.4-9.05803.0"
  17. How can I set it on my server? I didn't understand what to put in the config file so what I should put here to enable it?
  18. He want the Radar area to blink like on the gang wars missions in GTA SA.
  19. You can else use In-Game handling editor to make your own custom handlings to use them for your script. Good Luck
×
×
  • Create New...