Jump to content

Lloyd Logan

Members
  • Posts

    642
  • Joined

  • Last visited

Everything posted by Lloyd Logan

  1. Thank you!! I hate doing the same function over and over again! On the other hand, did my script work for you Zombie?
  2. Can I quickly ask, is getElementsByType all you added in there? And yes it works! How then would get it, after the dropoff has been made, to create another pickup marker? And again Thank You!
  3. type="script" version="1.0.0" name="HelpForum" description="meh" />
  4. What do you mean by bugged, give me an example, remember if it is Client and for example is a vehicle, that vehicle wouldn't be enterable.
  5. I dont that, What i mean is, the player is already in the vehicle , it IS creating the DROP OFF marker, but it is also creating the PICK UP MARKER, Which shouldn't be made until the DROPOFF marker has been hit.
  6. You're wrong, it works for me. Just type in /ovp
  7. So, i create a random marker for the player to pick a ped up at, this marker is random Then, When the player hit the marker the ped is warped into the veh then the DROP OFF marker is displayed, problem is I don't know how to stop it creating another PICK UP marker aswell.
  8. You do know what I mean by my post?
  9. Hey, so i made a random marker, and you drive to the marker (this marker is created randomly) and pick up the created ped. When you do the marker is destroyed. The problem is, i have 2 tables, one to pick up the ped(in the table there is co-ordinates for the random marker), the other one is where to drop the ped off. The problem i am have is that when i pick up a ped it creates another pick up ped marker. How do i cancel it creating another marker? Team = createTeam("Taxi Driver", 0, 255, 0) busTeams = { [Team] = true } busVehs = { [420] = true } function enterVehicle ( thePlayer, seat, jacked ) -- when a player enters a vehicle if getElementType ( thePlayer ) == "player" then if ( busVehs[getElementModel ( source )] ) and ( not busTeams[getPlayerTeam( thePlayer )] ) then -- if the vehicle is one of 4 police cars, and the skin is not a police skin removePedFromVehicle( thePlayer )-- force the player out of the vehicle outputChatBox("Only Taxi Drivers can drive this vehicle!", thePlayer) end end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) markers = { } blips = { } peds = { } function inVEH(thePlayer) if isPedInVehicle ( thePlayer ) then if ( getElementModel ( source ) == 420 ) then local x, y, z = unpack ( dropoffs [ math.random ( #dropoffs ) ] ) markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 3.5, 255, 0, 0 ) local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ thePlayer ] = createPed( skins, x, y, z ) blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) end else if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) cancelEvent() end end end addEventHandler("onVehicleEnter", getRootElement(), inVEH) function warpit ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehicle = getPedOccupiedVehicle ( thePlayer ) if ( getElementModel ( vehicle ) == 420 ) then if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) warpPedIntoVehicle ( peds [ thePlayer ], vehicle, 2 ) triggerEvent ( "onPickUp", root ) end end end end end function pickMeUp () if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end end addEvent("onPickUp", true) addEventHandler("onPickUp", root, pickMeUp)
  10. Remember the command is ovp --CLIENT GUIEditor = { button = {}, window = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0, 274, 331, 493, "V.I.P Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetVisible( GUIEditor.window[1], false ) Turismo = guiCreateButton(17, 80, 130, 59, "Give Turismo", false, GUIEditor.window[1]) Hydra = guiCreateButton(173, 80, 132, 57, "Give Hydra", false, GUIEditor.window[1]) Chainsaw = guiCreateButton(17, 176, 127, 58, "Give Chainsaw", false, GUIEditor.window[1]) RPG = guiCreateButton(163, 176, 138, 53, "Give RPG x20", false, GUIEditor.window[1]) EnableGodmode = guiCreateButton(10, 268, 129, 54, "Enable Godmode", false, GUIEditor.window[1]) DisableGodmode = guiCreateButton(162, 268, 126, 49, "Disable Godmode", false, GUIEditor.window[1]) NRG500 = guiCreateButton(12, 348, 124, 53, "Give NRG-500", false, GUIEditor.window[1]) Close = guiCreateButton(162, 352, 121, 49, "Close Panel", false, GUIEditor.window[1]) showCursor( false ) function buyCar(thePlayer) triggerServerEvent ( "buyVeh", getLocalPlayer(), "greetingHandler" ) end end ) addEventHandler("onClientGUIClick", root, function() if source == Turismo then triggerServerEvent("Turismo", localPlayer) elseif source == Hydra then triggerServerEvent("Hydra", localPlayer) elseif source == Chainsaw then triggerServerEvent("Chainsaw", localPlayer) elseif source == RPG then triggerServerEvent("RPG", localPlayer) elseif source == NRG500 then triggerServerEvent("NRG500", localPlayer) elseif source == Close then guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end ) function showit ( ) guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) end addCommandHandler( "ovp", showit ) --SERVER addEvent( "Turismo", true) addEventHandler( "Turismo", root, function() x, y, z = getElementPosition ( source ) Vehicle = createVehicle ( 451, x, y, z + 2) warpPedIntoVehicle ( source, Vehicle ) end ) addEvent( "Hydra", true) addEventHandler( "Hydra", root, function() x, y, z = getElementPosition ( source ) Vehicle = createVehicle ( 520, x, y, z + 2) warpPedIntoVehicle ( source, Vehicle ) end ) addEvent( "NRG500", true) addEventHandler( "NRG500", root, function() x, y, z = getElementPosition ( source ) Vehicle = createVehicle ( 522, x, y, z + 2) warpPedIntoVehicle ( source, Vehicle ) end ) addEvent( "RPG", true) addEventHandler( "RPG", root, function() giveWeapon( root, 35, 1, true ) end ) addEvent( "Chainsaw", true) addEventHandler( "Chainsaw", root, function() giveWeapon( root, 9, 1, true ) end )
  11. So when a marker and blip is destroyed after picking up a ped, it keeps creating a random marker and blip from pickups, but I would like to be from the dropoff table, how would i do this? local dropoffs = { [1]={ 2060.7685546875, -1941.1181640625, 13.14103603363 }, [2]={ 2114.5068359375, -1611.302734375, 13.167269706726 }, [3]={ 1932.9521484375, -1776.1259765625, 13.16081237793 }, [4]={ 1057.41796875, -1568.4853515625, 13.166387557983 } } local sss = { [1]={ 1965.54296875 , -1883.013671875, 13.160305023193 }, [2]={ 1467.3916015625, -1736.419921875, 13.242918014526 }, [3]={ 2376.1064453125, -1728.4091796875, 13.162055015564 }, [4]={ 1066.5029296875, -1200.86328125, 18.405519485474 } } local pedCus = { [1]={ 9 }, [2]={ 10 }, [3]={ 14 }, [4]={ 15 }, [5]={ 37 } } Team = createTeam("Taxi Driver", 0, 255, 0) busTeams = { [Team] = true } busVehs = { [420] = true } function enterVehicle ( thePlayer, seat, jacked ) -- when a player enters a vehicle if getElementType ( thePlayer ) == "thePlayer" then if ( busVehs[getElementModel ( source )] ) and ( not busTeams[getPlayerTeam( thePlayer )] ) then -- if the vehicle is one of 4 police cars, and the skin is not a police skin removePedFromVehicle( thePlayer )-- force the player out of the vehicle outputChatBox("Only Taxi Drivers can drive this vehicle!", thePlayer) end end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) markers = { } blips = { } peds = { } function inVEH(thePlayer) if isPedInVehicle ( thePlayer ) then if ( getElementModel ( source ) == 420 ) then local x, y, z = unpack ( dropoffs [ math.random ( #dropoffs ) ] ) markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 3.5, 255, 0, 0 ) local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ thePlayer ] = createPed( skins, x, y, z ) blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) end else if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end end end addEventHandler("onVehicleEnter", getRootElement(), inVEH) function warpit ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehicle = getPedOccupiedVehicle ( thePlayer ) if ( getElementModel ( vehicle ) == 420 ) then if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end warpPedIntoVehicle ( peds [ thePlayer ], vehicle, 2 ) cancelEvent() end end end
  12. So for my removePedFromVehicle, only do this if it is a player?
  13. Hey, how do i warp a ped into a vehicle if the Ped isn't in that Team that vehicle is assigned to? I tried to warp a ped that i created into the team veh, but it was removed because the ped wasn't in the team. How do i fix this?
  14. GUIEditor = { memo = {}, button = {}, label = {}, window = {}, } windowjob9 = guiCreateWindow(253, 137, 304, 284, "", false) guiWindowSetSizable(windowjob9, false) SWATLabel = guiCreateLabel(65, 29, 264, 40, "SWAT Gear", false, windowjob9) guiSetFont(GUIEditor.label[1], "sa-gothic") SwatMemo2 = guiCreateMemo(304, 180, 0, 20, "", false, windowjob9) SwatMemo3 = guiCreateMemo(10, 85, 285, 104, "Arrest People For Money, RP Raids! And RP Riot Control!!", false, windowjob9) SwatButton = guiCreateButton(10, 200, 285, 51, "Take The Job!", false, windowjob9) guiSetFont(SwatButton, "sa-header") guiSetVisible(windowjob9, false) local marker7 = createMarker( 1671.845703125, -1705.2421875, 15.609375, "Cylinder", 2, 6, 183, 248, 153) function Medicjob9(hitElement) if getElementType(hitElement) == "localPlayer" then if not guiGetVisible(windowjob9) then guiSetVisible(windowjob9, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker7, Medicjob9) function Medicjobleave9(leaveElement) if getElementType(leaveElement) == "localPlayer" then if guiGetVisible(windowjob9) then guiSetVisible(windowjob9, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker7, Medicjobleave9) function joinTeam9() triggerServerEvent("setSWAT",localPlayer) guiSetVisible(windowjob9, false) showCursor(false) end addEventHandler("onClientGUIClick", SwatButton , joinTeam9, false)
  15. function showit ( ) guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) end addCommandHandler( "showit", showit )
  16. Yes, put in [lua]guiSetVisible(windowhere**, true)[\lua]
  17. Add a guiSetVisible(windowjob9, false) After you create the window. When the marker is hit, it will set the Boolean to true
  18. In your script, once you get to a certain velocity, play the sound?
  19. I would create one for you but I am on my phone, have you checked the community? http://www.community.multitheftauto.com
  20. You want us to send you the code? I'm looking for the code. / google translate I would create one for you but I am on my phone, have you checked the community? community.multitheftauto.com
  21. You want us to send you the code?
×
×
  • Create New...