kieran

Members
  • Content count

    289
  • Joined

  • Last visited

Community Reputation

29 Good

1 Follower

About kieran

  • Rank
    Pee-Wee
  • Birthday August 21

Details

  • Gang
    n/a, I am a cat!
  • Location
    United Rainy Kingdom.
  • Occupation
    Newb scripter.
  • Interests
    I love GUI's and MTA, but I am lazy so don't ask for any help. (I also have a peanut brain haha)

Recent Profile Visitors

1,372 profile views
  1. Thanks, works great, but there's a slight problem with how I'm doing this (this is the last thing that needs fixed ) If you look at line 46 you'll see I set marker_data to be source, as it was originally spawning when you hit the marker and I'm remodeling it for GUI spawning, the reason I use marker_data is because it got the marker I was currently in, do you know of any other ways to get the marker other than using onMarkerHit handler and getting table index? local TruckerTeam = createTeam("Trucker", 20, 100, 150) TruckerMarker = {--marker [x,y,z] truck spawn point: [x,y,z,rotationx,rotationy,rotationz], [location] {2179.841796875, -2263.6940917969, 13.8, 2167.4401855469, -2273.9362792969, 14 ,-0, 0, 220, "Ocean Docks"}, {-1737.9622802734, 20.285757064819, 2.7, -1710, 10, 4, 0, 0, 315, "Easter Basin"}, {1643, 2354, 10, 1634, 2365, 11, -0, 0, 90, "Redsands West"} }--Above table is for the job markers, player walks into one, they become trucker and a truck is spawned. local markerStore = {} --Stores markers function TruckerStart ( hitElement, matchingDimension ) if isElement(hitElement) and getElementType(hitElement) == "player" and matchingDimension then if not (isGuestAccount (getPlayerAccount (hitElement))) then local account = getPlayerAccount (hitElement) if (account) then local PlayerShipments = getAccountData( account, "Trucker.pres" ) if (PlayerShipments) then setElementData (hitElement, "Trucker.pres", PlayerShipments) else setElementData (hitElement, "Trucker.pres", 0) end triggerClientEvent ( hitElement, "spawnTruck", hitElement) end end end end addEvent("spawnTruckYes", true) addEventHandler("spawnTruckYes", root, function (hitElement) if isElement(hitElement) and getElementType(hitElement) == "player" then if ( TruckerTeam ) then if isPedOnGround ( hitElement ) then local playerTeam = getPlayerTeam ( hitElement ) if not ( playerTeam == TruckerTeam) then setPlayerTeam(hitElement, TruckerTeam) end local spawnedTruck = getElementData( hitElement, "Trucker.truck" ) --Check if they have spawned a truck if ( spawnedTruck ~= false ) then destroyElement(spawnedTruck) --If they have, destroy the truck spawnedTruck = nil setElementData(hitElement, "Trucker.truck", false) --Set there data to false else triggerClientEvent ( hitElement, "shipmentMarker", hitElement) local x, y, z, rx, ry, rz, name local marker_data = markerStore[source] --Getting the marker data if marker_data then outputDebugString("Marker data: "..marker_data) x,y,z,rx,ry,rz,name = marker_data[4],marker_data[5],marker_data[6],marker_data[7],marker_data[8],marker_data[9],marker_data[10] local Truck = createVehicle (515, x, y, z+1, rx, ry, rz) setElementData(hitElement, "Trucker.truck", Truck) warpPedIntoVehicle (hitElement, Truck) end end else outputChatBox("You must be on foot!", hitElement, 255, 0, 0) end end end end ) function createMarkers() for i=1,#TruckerMarker do local x,y,z = TruckerMarker[i][1],TruckerMarker[i][2],TruckerMarker[i][3]--x = key 1, y = key 2, z = key 3 local marker = createMarker( x,y,z,"cylinder", 1, 0, 200, 55, 255 ) markerStore[marker] = TruckerMarker[i] TruckerJobBlip = createBlipAttachedTo ( marker, 42, 2, 0, 0, 0, 0, 0, 500 ) addEventHandler("onMarkerHit", marker, TruckerStart) end end createMarkers() Can't thank you guys enough for the help.
  2. Both good points, but this was example code I typed quickly to show how I was trying to pass the PLAYER as an argument to server side, I will put actual code below, just made example because it's easier to read... In the script the marker is server side, as well as the vehicle spawning, change teams, and checks for element data. Server side is just GUI, sorry for the confusion with the bad example. Client Only need first 2 functions, third just shows you what I want to do if they click no. function spawnTheTruck() local screenW, screenH = guiGetScreenSize() window = guiCreateWindow((screenW - 312) / 2, (screenH - 104) / 2, 312, 104, "Spawn a truck or use your own?", false) guiWindowSetSizable(window, false) showCursor(true) label1 = guiCreateLabel(56, 27, 201, 17, "Yes - Spawn a truck.", false, window) label2 = guiCreateLabel(56, 40, 201, 17, "No - I brought my own.", false, window) guiLabelSetHorizontalAlign ( label1, "center") guiLabelSetHorizontalAlign ( label2, "center") Yes_btn = guiCreateButton(56, 64, 89, 30, "Yes", false, window) No_btn = guiCreateButton(168, 65, 89, 29, "No", false, window) addEventHandler("onClientGUIClick", Yes_btn, spawnYes) addEventHandler("onClientGUIClick", No_btn, spawnNo) end addEvent("spawnTruck", true) addEventHandler("spawnTruck", getRootElement(), spawnTheTruck) function spawnYes(button, state, hitElement) if source == Yes_btn and button == "left" and state == "up" then triggerServerEvent("spawnTruckYes", localPlayer, hitElement) destroyElement(window) showCursor(false) end end function spawnNo(button, state) if source == No_btn and button == "left" and state == "up" then --triggerServerEvent("spawnTruckNo", localPlayer, this) destroyElement(window) showCursor(false) end end Server Only need first 3 functions, last one is just there to show how markers are made. local markerStore = {} --Stores markers function TruckerStart ( hitElement, matchingDimension ) if isElement(hitElement) and getElementType(hitElement) == "player" and matchingDimension then if not (isGuestAccount (getPlayerAccount (hitElement))) then local account = getPlayerAccount (hitElement) if (account) then local PlayerShipments = getAccountData( account, "Trucker.pres" ) if (PlayerShipments) then setElementData (hitElement, "Trucker.pres", PlayerShipments) else setElementData (hitElement, "Trucker.pres", 0) end triggerClientEvent ( hitElement, "spawnTruck", hitElement) end end end end function spawnNo(hitElement) --If player choses no in client side GUI, then they won't get a truck if isElement(hitElement) and getElementType(hitElement) == "player" and matchingDimension then if ( TruckerTeam ) then if isPedOnGround ( hitElement ) then local playerTeam = getPlayerTeam ( hitElement ) if not ( playerTeam == TruckerTeam) then setPlayerTeam(hitElement, TruckerTeam) end --[[triggerClientEvent ( hitElement, "destroyIron", hitElement)<<Custom handler for iron miner script]] triggerClientEvent ( hitElement, "shipmentMarker", hitElement) else outputChatBox("You must be on foot!", hitElement, 255, 0, 0) end end end end addEvent("spawnTruckNo", true) addEventHandler("spawnTruckNo", getRootElement(), spawnNo) function spawnYes(hitElement)--If player choses yes in client side GUI, then they will get a truck if isElement(hitElement) and getElementType(hitElement) == "player" and matchingDimension then if ( TruckerTeam ) then if isPedOnGround ( hitElement ) then local playerTeam = getPlayerTeam ( hitElement ) if not ( playerTeam == TruckerTeam) then setPlayerTeam(hitElement, TruckerTeam) end local spawnedTruck = getElementData( hitElement, "Trucker.truck" ) --Check if player has spawned a truck if ( spawnedTruck ~= false ) then destroyElement(spawnedTruck) --If they have, destroy the truck spawnedTruck = nil setElementData(hitElement, "Trucker.truck", false) --And set there data to false else triggerClientEvent ( hitElement, "destroyIron", hitElement) triggerClientEvent ( hitElement, "shipmentMarker", hitElement) local x, y, z, rx, ry, rz, name local marker_data = markerStore[source] if marker_data then x,y,z,rx,ry,rz,name = marker_data[4],marker_data[5],marker_data[6],marker_data[7],marker_data[8],marker_data[9],marker_data[10] local Truck = createVehicle (515, x, y, z+1, rx, ry, rz) setElementData(hitElement, "Trucker.truck", Truck) warpPedIntoVehicle (hitElement, Truck) end end else outputChatBox("You must be on foot!", hitElement, 255, 0, 0) end end end end addEvent("spawnTruckYes", true) addEventHandler("spawnTruckYes", getRootElement(), spawnYes) function createMarkers() for i=1,#TruckerMarker do local x,y,z = TruckerMarker[i][1],TruckerMarker[i][2],TruckerMarker[i][3] local marker = createMarker( x,y,z,"cylinder", 1, 0, 200, 55, 255 ) markerStore[marker] = TruckerMarker[i] TruckerJobBlip = createBlipAttachedTo ( marker, 42, 2, 0, 0, 0, 0, 0, 500 ) addEventHandler("onMarkerHit", marker, TruckerStart) end end createMarkers() Hope this helps you understand what I'm trying to accomplish...
  3. @<~KaMiKaZe~> what do you mean send the buttons? Do you mean passing localPlayer on the handler for buttons? Because that doesn't work, handlers can't take arguments like triggerEvent
  4. I have tried this, nothing happens, when I look at triggerServerEvent it's event, element, [arguments...] So my best guess is for hitElement (on custom event) to get the player from client side when they click a button, I need to pass localPlayer (which I have tried as well as "getLocalPlayer()" and "client") to the server as an argument, not just as an element... So it'd be this: triggerServerEvent("spawnTruck", localPlayer, localPlayer) Which doesn't work...
  5. I have a client side GUI with 2 buttons, if the player clicks yes, the local player should be carried to the server side script as "hitElement" I am doing this because "source" does nothing, and if I use getLocalPlayer() as an argument for the triggerEvent it returns an error saying it got a userdata value. -->[[Client]]<-- local marker = createMarker( 0,0,0,"cylinder", 2, 0, 200, 55, 255 ) --Marker function GUIwindow() local screenW, screenH = guiGetScreenSize() window = guiCreateWindow((screenW - 312) / 2, (screenH - 104) / 2, 312, 104, "", false)--GUI guiWindowSetSizable(window, false) showCursor(true) label = guiCreateLabel(56, 30, 201, 17, "Do you want to spawn a truck?", false, window) yes_btn = guiCreateButton(56, 64, 89, 30, "Yes", false, window) --Button no_btn = guiCreateButton(168, 65, 89, 29, "No", false, window) addEventHandler("onClientGUIClick", yes_btn, triggerEvent) --Handler end addEventHandler("onMarkerHit", marker, GUIwindow) function triggerEvent(button, state) if source == yes_btn and button == "left" and state == "up" then triggerServerEvent("spawnTruck", localPlayer, getLocalPlayer()) --Trying to carry local player as hitElement to server destroyElement(window) showCursor(false) end end -->[[Server]]<-- function spawnTheTruck(hitElement)--If player choses yes in client side GUI, then they will get a truck if isElement(hitElement) and getElementType(hitElement) == "player" and matchingDimension then if isPedOnGround ( hitElement ) then --If so, check if player is on foot local Truck = createVehicle (515, 0, 5, 5, 0, 0, 0) warpPedIntoVehicle (hitElement, Truck) end end end addEvent("spawnTruck", true) addEventHandler("spawnTruck", getRootElement(), spawnTheTruck) --Server side event Info of why the triggerEvent isn't working would be nice, thanks for help.
  6. Made a trucker script, but I want to set the players data when there truck/trailer explodes, so I tried a for loop and the idea was to get all players element data and set it to false if the source was there vehicle... function ExitVehicle(thePlayer) --This function works fine, is just here to give you an idea of what I'm trying ti achieve if getPlayerTeam(thePlayer) == (TruckerTeam) then local spawnedTruck = getElementData( thePlayer, "Trucker.truck" ) local theTrailer = getElementData( thePlayer, "Trucker.trailer" ) --Name changed from spawnedTrailer to prevent conflict if (spawnedTruck) then outputChatBox("You have 20 seconds to get back to your truck!", thePlayer) TruckTimer = setTimer(function() if ( spawnedTruck ~= false ) then --(~= is not equal) destroyElement(spawnedTruck) setElementData(thePlayer, "Trucker.truck", false) end if (theTrailer) ~= false then destroyElement(theTrailer) setElementData(thePlayer, "Trucker.trailer", false) end triggerClientEvent(thePlayer, "destroyMarker", thePlayer) triggerClientEvent(thePlayer, "shipmentMarker", thePlayer) end,20000,1) end if not (spawnedTruck) and (theTrailer) then outputChatBox("You have 20 seconds to get back to your truck!", thePlayer) TrailerTimer = setTimer(function() destroyElement(theTrailer) triggerClientEvent(thePlayer, "destroyMarker", thePlayer) setElementData(thePlayer, "Trucker.trailer", false) triggerClientEvent(thePlayer, "shipmentMarker", thePlayer) end,20000,1) end end end addEventHandler("onVehicleExit",getRootElement(),ExitVehicle) --When vehicles explode the players data will be removed function explodingTruck() for _,player in ipairs(getElementsByType("player")) do --LOOP through all players local spawnedTruck = getElementData( player, "Trucker.truck" ) --The data is the players vehicle, set when the player spawned it. local theTrailer = getElementData( player, "Trucker.trailer" ) --^^^ if source == spawnedTruck then --If the source was the players vehicle setElementData(player, "Trucker.truck", false) --The idea is to set there data to false so they can spawn another one if the server has automatic respawn/deletion for vehicles. end if source == theTrailer then setElementData(player, "Trucker.trailer", false) triggerClientEvent(player, "destroyMarker", player) --Obviously I want to destroy the players mission blip and marker if they have a trailer, but it fails to get the player. end end end addEventHandler("onVehicleExplode",getRootElement(),explodingTruck) Full resource can be found here if you need more code: https://community.multitheftauto.com/?p=resources&s=details&id=15161 debugscript 3 When the timer to check for data (check if the player has a vehicle spawned) is done, the below shows, clearly showing me that it failed to set players data to false. [2018-01-14 22:35:14] WARNING: RP-Trucker\Trucker_s.lua:188: Bad argument @ 'destroyElement' [Expected element at argument 1] [2018-01-14 22:35:14] WARNING: RP-Trucker\Trucker_s.lua:192: Bad argument @ 'destroyElement' [Expected element at argument 1] Any help with it would be nice, I want the community to have a perfect RP resource, plus it'll help me learn to make new ones ^.^ Thanks in advance!
  7. destroyElement

    Here's an idea (someone helped me understand this as I had similar issues) try setting the players element data to the vehicle, then when they die, get the data, here's untested code, if it doesn't work do a debugscript 3 and tell me the errors. function spawnVeh (thePlayer) --This function adds a command that spawns a car and sets players data, we will remove the car later local x, y, z = getElementPosition (thePlayer) --Get players position local rotX, rotY, rotZ = getElementRotation (thePlayer) --Get there rotation veh = createVehicle (468, x, y, z+5, rotX, rotY, rotZ) --Create the vehicle at the players position +5 height warpPedIntoVehicle (thePlayer, veh) --Warp the player into the vehicle setElementData(thePlayer, "freecar", veh) --Set the players data to the car end addCommandHandler("sanchez", spawnVeh) --When command is passed we create a sanchez above and set players data function removeVehicle () local theVeh = getElementData( source, "freecar" ) --First we get the players element data if ( theVeh ~= false ) then --If the data exists, it means the vehicle exists (unless you have done above command and the car gets destroyed) destroyElement(theVeh) --Since we got the element with getElementData above we can now destroy it setElementData(source, "freecar", false) --We now set the players data to false. end end addEventHandler("onPedWasted", getRootElement(), removeVehicle) --When player dies we trigger our function to check there data Hopefully this works!
  8. add a custom object

    Here's a link to the MTA channel on YouTube, it explains how you make, export, and load a custom object into your server, it's also pretty funny Custom Map Models Tutorial Time that the script is made for importing the custom object
  9. I have made a trucker script, but have a few issues destroying markers, the idea is, I trigger a client side event to make multiple markers and add handlers to them, so when I hit the markers a GUI pops up, when I click accept, a marker and blip is created client side and a server side event is triggered to make a trailer, but I want to add all the markers to a table and destroy them when I click accept, but only one is destroyed, there are no errors on debug script 3, code below... --x, y, z, location, cash Locations = { [1] = {-1351.5205078125, -503.66796875, 14.171875, "SF Airport"}, [2] = {2838.658203125, 999.6708984375, 10.75, "East LV"}, [3] = {2262.89453125, 2792.927734375, 10.8203125, "Near KACC"}, [4] = {2763.138671875, -2421.6845703125, 13.486039161682, "Test"}, [5] = {-576.53063964844, -550.34674072266, 25.529611587524, "Fallen Tree"} } Markers = { [1] = {2762.677734375, -2431.4296875, 12.5}, [2] = {2747.6467285156, -2410.5747070313, 13.45193195343} } local GoodsMarker --Make a global variable local markerVault = {} -- local Name local marker local blip local cash window = {} function showGUI() local screenW, screenH = guiGetScreenSize() window = guiCreateWindow((screenW - 498) / 2, (screenH - 266) / 2, 498, 266, "Shipments", false) guiWindowSetSizable(window, false) gridlist = guiCreateGridList(9, 27, 479, 194, false, window) colLocation = guiGridListAddColumn(gridlist, "Location", 0.33) colDistance = guiGridListAddColumn(gridlist, "Distance", 0.33) colCash = guiGridListAddColumn(gridlist, "Cash", 0.33) for i=1,#Locations do --Here is the information for gridlist local x,y,z,text = Locations[i][1],Locations[i][2],Locations[i][3],Locations[i][4] --x,y,z,name of the location local px,py,pz = getElementPosition(localPlayer) --Get players position local distance = getDistanceBetweenPoints3D(px,py,pz,x,y,z) --get the distance between player and each point cash = math.floor(distance*3) --distance x 3 is the cash the player will get, rounded it so it's an integer not a float local row = guiGridListAddRow ( gridlist,text, math.floor(distance), cash ) --add a row for each table index... rounded distance so it doesn't look horrible end btn_acc = guiCreateButton(72, 231, 140, 25, "Accept", false, window) --accept button guiSetFont(btn_acc, "sa-header") btn_exit = guiCreateButton(284, 231, 140, 25, "Exit", false, window) --exit button guiSetFont(btn_exit, "sa-header") showCursor(true) local playerVehicle = getPedOccupiedVehicle ( localPlayer ) --Freeze player if (playerVehicle) then setElementFrozen ( playerVehicle, true ) end addEventHandler("onClientGUIClick", btn_acc, Accept) addEventHandler("onClientGUIClick", btn_exit, Exit) end addEvent("TruckerStart", true) --triggered server side when a player hits a marker addEventHandler("TruckerStart", getRootElement(), showGUI) function Accept(button, state) if source == btn_acc and button == "left" and state == "up" then Name = guiGridListGetItemText(gridlist,guiGridListGetSelectedItem(gridlist),1) --Get the name (text) from gridlist (Location[4]) of selected row local x, y, z for i=1,#Locations do --For all locations I check the selected name against the rows in the table if Name == Locations[i][4] then x, y, z = Locations[i][1], Locations[i][2], Locations[i][3] end end if isElement (marker) then --if the player has already made a marker I remove handler and destroy the marker removeEventHandler("onClientMarkerHit", marker, reward) destroyElement(marker) destroyElement(blip) end marker = createMarker( x,y,z-1,"cylinder", 3, 0, 100, 0, 100 ) --I create the marker and blip and add the handler blip = createBlipAttachedTo(marker, 51 ) --Type, Size, R, G, B addEventHandler("onClientMarkerHit", marker, reward) removeEventHandler("onClientGUIClick", btn_acc, Accept) --I remove the handler from this function destroyElement(window) --I destroy the window, hide the cursor and trigger an event to make a trailer showCursor(false) triggerServerEvent("createTrailer", localPlayer) if isElement (GoodsMarker) then --AND HERE IS WHERE I HAVE AN ISSUE, I want to destroy the markers I made on the function at the bottom local marker_data = markerVault[source] if marker_data then for i=1, #marker_data do destroyElement(i) end end end local playerVehicle = getPedOccupiedVehicle ( localPlayer ) --Unfreeze player if (playerVehicle) then -- set the new freeze status setElementFrozen ( playerVehicle, false ) end end end function Exit(button, state) --Exit button destroys window and creates marker if source == btn_exit and button == "left" and state == "up" then removeEventHandler("onClientGUIClick", btn_acc, Accept) removeEventHandler("onClientGUIClick", btn_exit, Exit) destroyElement(window) showCursor(false) triggerEvent("shipmentMarker", localPlayer) local playerVehicle = getPedOccupiedVehicle ( localPlayer ) if (playerVehicle) then setElementFrozen ( playerVehicle, false ) end end end function reward() --Give the player reward and destroy marker for i=1,#Locations do if Name == Locations[i][4] then destroyElement(marker) destroyElement(blip) triggerServerEvent("truckerReward", localPlayer, cash) triggerEvent ("TruckerStart", localPlayer) end end end function makeGoodsMarker() --For each line in table, I make a marker for i=1,#Markers do local x,y,z = Markers[i][1],Markers[i][2],Markers[i][3]--x = key 1, y = key 2, z = key 3 GoodsMarker = createMarker( x,y,z,"cylinder", 5, 0, 200, 55, 255 ) markerVault[i] = GoodsMarker TruckerJobBlip = createBlipAttachedTo ( GoodsMarker, 56 ) addEventHandler("onClientMarkerHit", GoodsMarker, trailerSpawn) end end addEvent("shipmentMarker", true) --I add a custom event as I want to trigger it again when the player clicks exit on GUI addEventHandler("shipmentMarker", getRootElement(), makeGoodsMarker) Markers made on line 128, meant to be destroyed on line 82. Thanks for any help, been struggling with this for a while.
  10. [HELP] Marker.

    You made a marker, but you forgot to put the marker inside the interior When you create markers, they are the same as any other element, interior 0, dimension 0, until you set there interior/dimension, try this. local yMarker = createMarker (2104.7353515625, -1806.4340820313, 12.5, "cylinder", 0.5, 255, 255, 0) function yMarker (hitPlayer, matchingDiemension) if matchingDiemension and hitPlayer == localPlayer then outputChatBox ("Has entered the shop") setElementInterior ( localPlayer, 5, 372.40167236328, -132.85858154297, 1001.4921875) end end addEventHandler ("onClientMarkerHit", root, yMarker) local rMarker = createMarker (372.40167236328, -132.85858154297, 1001.4921875, "cylinder", 0.5, 255, 255, 0) setElementInterior ( rMarker, 5) Also it is important to note, if you set your players position/interior at the marker where you exit, the player will be moving between markers forever unable to move away.
  11. @TRtam I thought it was something like this, but first ever grid list script that's working with tables haha, worked perfect thanks!
  12. I am trying to make a grid list GUI, the idea is to add the contents of the table to the grid list, and then check the first column against the table data, if the name is equal to the row index on table, then get the xyz and create a marker. Made the GUI, but making the marker is what I'm struggling with... --x, y, z, location, cash Locations = { [1] = {-1351.5205078125, -503.66796875, 14.171875, "SF Airport", 15000}, [2] = {2838.658203125, 999.6708984375, 10.75, "East LV", 12000}, [3] = {2262.89453125, 2792.927734375, 10.8203125, "Near KACC", 12500} } window = {} local Name local marker function showGUI() local screenW, screenH = guiGetScreenSize() window = guiCreateWindow((screenW - 498) / 2, (screenH - 266) / 2, 498, 266, "Shipments", false) guiWindowSetSizable(window, false) gridlist = guiCreateGridList(9, 27, 479, 194, false, window) colLocation = guiGridListAddColumn(gridlist, "Location", 0.33) colDistance = guiGridListAddColumn(gridlist, "Distance", 0.33) colCash = guiGridListAddColumn(gridlist, "Cash", 0.33) for i=1,#Locations do --For loop shows location, distance (rounded to integer) and the cash player will get local x,y,z,text,cash = Locations[i][1],Locations[i][2],Locations[i][3],Locations[i][4],Locations[i][5] local px,py,pz = getElementPosition(localPlayer) --Player position local distance = getDistanceBetweenPoints3D(px,py,pz,x,y,z) --Distance between player and location local row = guiGridListAddRow ( gridlist,text, math.floor(distance), cash ) end btn_acc = guiCreateButton(72, 231, 140, 25, "Accept", false, window) guiSetFont(btn_acc, "sa-header") btn_exit = guiCreateButton(284, 231, 140, 25, "Exit", false, window) guiSetFont(btn_exit, "sa-header") addEventHandler("onClientDoubleClick", root, DoubleClick) --Handler for double click end addEvent("TruckerStart", true) addEventHandler("TruckerStart", getRootElement(), showGUI) function DoubleClick (button) if button == "left" then Name = guiGridListGetItemText(gridlist,guiGridListGetSelectedItem(gridlist),1) --Get the name (Location[4]) outputChatBox(""..Name) --Testing to see if it gets the name --Something to iterate through table and check if the Name is equals to ^"Name"^, then create a marker after it gets the Locations x,y,z from table local marker = createMarker( x,y,z-1,"cylinder", 3, 0, 100, 0, 100 ) end end Any help is appreciated, or even a pointer to a site where it explains how to get 1 row in a table.
  13. [Question] Checking when player leaves team

    @IIYAMA Thanks so much, I was confused if custom handlers were just used within a script nice to know there's an easy way!
  14. [HELP] how to disabe tank damageproof

    He is asking how to make it so Rhino takes more damage, believe it or not... Rhino DOES take damage already! But it takes little damage.... There's a few ways you can mess around with how much damage vehicles take, I recommend you start with SetVehicleHandling and use collisionDamageMultiplier, I do not know if this is just for vehicle collisions, so if your car hits a wall or another car.... But it's a start! If it doesn't work for bullets etc, then maybe think of getting the vehicles health and setting it (as bonus said) with OnVehicleDamage, this will mean you can set health to vehicle health -x where x is the amount you want to subtract from the vehicles health after you get the current health. If you have set Rhinos to be damage proof with another script then just use setVehicleDamageProof(vehicle, false) where vehicle is the Rhino. Hope this helped! Can always try make a function if you're still struggling.