Jump to content

#Ivan7

Members
  • Posts

    90
  • Joined

  • Last visited

Everything posted by #Ivan7

  1. Ok Guys so I did it all but it says when I try load it : couldnt parse meta file for Swat2014
  2. see these are the files: biker.txd bikerhelmet.txd hoodyagreen.txd tracketrgang.txd zorro.txd zorromask.dff now example to change them would be this maybe: [/lua]skins= { ["bikerhelmet"] = id, ["hoodyagreen"] = id, ["tracketrgang"] = id, ["zorro"] = id, ["zorromask] = id, } function replaceClothes() for swat, id in pairs(texturi) do local txd = engineLoadTXD (swat..".txd") engineImportTXD(txd, id) end end[lua]
  3. I know that but see.. do i need to use gta-inside or anything?
  4. How would I be able to change a swat txd so that all players can see it?
  5. #Ivan7

    Help Taxi

    Thanks, it worked but imma go back to wiki after i finish this, and their are 3 bugs left but i will fix them my self again thanks
  6. #Ivan7

    PEDS

    Ok I finished the script only problem is the Peds wont warp in vechile when I hit H, I did bindkey but it wont work ServerSide: local pickups = { { -2514.2985839844, -19.26721572876, 25.6171875 }, { -2413.8093261719, 314.66299438477, 35.171875 }, { -1980.0808105469, 884.00354003906, 45.203125 }, { -1584.2047119141, 812.43743896484, 6.8203125 }, { -1817.1701660516, 1286.7491455078, 15.492509841919 }, { -2343.4348144531, 983.23840322031, 50.6953125 }, { -2554.942629531, 193.716659548, 6.2031769752502 } } local dropoffss = { { -2275.2744140625, 612.84197998047, 43.402828216553 }, { -2566.2153320313, 578.38897705078, 14.453125 }, { -2128.4689941406, 310.44934082031, 35.254566192627 }, { -1702.652941016, 717.54370117188, 24.890625 }, { -1912.1589355469, 883.3916015625, 35.215755462646 }, { -1977.3975830078, 1118.9444580078, 53.23331451416 }, { -1703.1501464844, 1340.6345214844, 7.1796875 } } local pedCus = { { 7 }, { 21 }, { 29 }, { 137 }, { 27 }, { 240 }, { 264 } } function SetVisiteFor (mark,player) setElementVisibleTo ( mark, root, false ) setElementVisibleTo ( mark, player, true ) end taxiVehs = { [420] = true } Cars = {} function teamSet ( ) if (isElement(Cars[source])) then destroyElement(Cars[source]) end setElementData(source,"markertax",4) setElementModel(source, 255) Cars[source] = createVehicle(420, -2485.3188476563, -169.93522644043, 25.6171875) addEventHandler ( "onVehicleExit", Cars[source], deleteOnExit ) addEventHandler ( "onVehicleEnter", Cars[source], inVEH ) addEventHandler ( "onVehicleStartEnter", Cars[source], enterVehicle ) warpPedIntoVehicle ( source, Cars[source] ) startJob() outputChatBox("You are now employed as a Taxi Driver!", source) end addEvent ( "sTeame", true) addEventHandler ( "sTeame", root, teamSet ) addEventHandler('onPlayerQuit', root, function() if isElement( Cars[source] ) then destroyElement(Cars[source] ) end end ) function enterVehicle ( seat, jacked ) if getElementData(source,"JobNew") ~= 4 then removePedFromVehicle( source ) outputChatBox("Only Taxi Drivers can drive this vehicle!", source) end end markers = { } blips = { } peds = { } mposi = { } mposii = {} function startJob ( ) local x, y, z = unpack ( pickups [ math.random ( #pickups ) ] ) markers [ source ] = createMarker ( x, y, z, "cylinder", 5.0, 255, 0, 0, 0 ) SetVisiteFor (markers [ source ],source) mposi = { getElementPosition( markers [ source ] ) } local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ source ] = createPed( skins, x, y, z ) SetVisiteFor (peds [ source ],source) blips [ source ] = createBlipAttachedTo ( markers [ source ], 58 ) SetVisiteFor (blips [ source ],source) addEventHandler ( "onMarkerHit", markers [ source ], warpit ) end function inVEH () if isPedInVehicle ( source ) and getElementData(source,"JobNew") == 4 then startJob () end end function warpit ( ) if isPedInVehicle ( source ) then local vehiclee = getPedOccupiedVehicle ( source ) if ( getElementModel ( vehiclee ) == 420 ) then bindKey(source,"H","down",warpit) end end end function warpit2 () warpPedIntoVehicle(peds [ source ], getPedOccupiedVehicle ( source ), 2 ) local x, y, z = unpack ( dropoffss [ math.random ( #dropoffss ) ] ) markers [ source ] = createMarker ( x, y, z - 1, "cylinder", 5.0, 195, 197, 9, 255 ) SetVisiteFor (markers [ source ],source) mposii = { getElementPosition( markers [ source ] ) } blips [ source ] = createBlipAttachedTo ( markers [ source ], 41 ) SetVisiteFor (blips [ source ],source) addEventHandler ( "onMarkerHit", markers [ source ], pickmeup ) unbindKey(source,"H","down",warpit2) end function pickmeup () if isPedInVehicle ( source ) then destroyJob () local mx, my, mz = unpack ( mposi ) local mmx, mmy, mmz = unpack ( mposii ) local money = getDistanceBetweenPoints2D ( mx, my, mmx, mmy ) finalmoney = math.floor ( money ) if finalmoney then setTimer( function () finalmoney = finalmoney + 1000 setElementData(source,"Money", (getElementData(source,"Money" or 0 ) ) ) outputChatBox( "You have earned "..finalmoney.."!",source,0, 144, 0) setElementData(source,"Money", getElementData(source,"Money" or 0 ) ) end, 3000, 1 ) setTimer ( function () if ( isElement ( peds [ source ] ) ) then destroyElement ( peds [ source ] ) end startJob () end ,3000, 1 ) end end end function deleteOnExit ( ) if ( isElement ( markers [ source ] ) ) then destroyElement ( markers [ source ] ) end if ( isElement ( blips [ source ] ) ) then destroyElement ( blips [ source ] ) end if ( isElement ( peds [ source ] ) ) then destroyElement ( peds [ source ] ) end end -- lol ok function destroyJob () if ( isElement ( markers [ source ] ) ) then destroyElement ( markers [ source ] ) end if ( isElement ( blips [ source ] ) ) then destroyElement( blips [ source ] ) end end
  7. #Ivan7

    Help Taxi

    Ok guys.. so i changed it to bindkey and it still doesnt work.. please any suggestions? local pickups = { { -2514.2985839844, -19.26721572876, 25.6171875 }, { -2413.8093261719, 314.66299438477, 35.171875 }, { -1980.0808105469, 884.00354003906, 45.203125 }, { -1584.2047119141, 812.43743896484, 6.8203125 }, { -1817.1701660516, 1286.7491455078, 15.492509841919 }, { -2343.4348144531, 983.23840322031, 50.6953125 }, { -2554.942629531, 193.716659548, 6.2031769752502 } } local dropoffss = { { -2275.2744140625, 612.84197998047, 43.402828216553 }, { -2566.2153320313, 578.38897705078, 14.453125 }, { -2128.4689941406, 310.44934082031, 35.254566192627 }, { -1702.652941016, 717.54370117188, 24.890625 }, { -1912.1589355469, 883.3916015625, 35.215755462646 }, { -1977.3975830078, 1118.9444580078, 53.23331451416 }, { -1703.1501464844, 1340.6345214844, 7.1796875 } } local pedCus = { { 7 }, { 21 }, { 29 }, { 137 }, { 27 }, { 240 }, { 264 } } function SetVisiteFor (mark,player) setElementVisibleTo ( mark, root, false ) setElementVisibleTo ( mark, player, true ) end taxiVehs = { [420] = true } Cars = {} function teamSet ( ) if (isElement(Cars[source])) then destroyElement(Cars[source]) end setElementData(source,"markertax",4) setElementModel(source, 255) Cars[source] = createVehicle(420, -2485.3188476563, -169.93522644043, 25.6171875) addEventHandler ( "onVehicleExit", Cars[source], deleteOnExit ) addEventHandler ( "onVehicleEnter", Cars[source], inVEH ) addEventHandler ( "onVehicleStartEnter", Cars[source], enterVehicle ) warpPedIntoVehicle ( source, Cars[source] ) startJob() outputChatBox("You are now employed as a Taxi Driver!", source) end addEvent ( "sTeame", true) addEventHandler ( "sTeame", root, teamSet ) addEventHandler('onPlayerQuit', root, function() if isElement( Cars[source] ) then destroyElement(Cars[source] ) end end ) function enterVehicle ( seat, jacked ) if getElementData(source,"JobNew") ~= 4 then removePedFromVehicle( source ) outputChatBox("Only Taxi Drivers can drive this vehicle!", source) end end markers = { } blips = { } peds = { } mposi = { } mposii = {} function startJob ( ) local x, y, z = unpack ( pickups [ math.random ( #pickups ) ] ) markers [ source ] = createMarker ( x, y, z, "cylinder", 5.0, 255, 0, 0, 0 ) SetVisiteFor (markers [ source ],source) mposi = { getElementPosition( markers [ source ] ) } local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ source ] = createPed( skins, x, y, z ) SetVisiteFor (peds [ source ],source) blips [ source ] = createBlipAttachedTo ( markers [ source ], 58 ) SetVisiteFor (blips [ source ],source) addEventHandler ( "onMarkerHit", markers [ source ], warpit ) end function inVEH () if isPedInVehicle ( source ) and getElementData(source,"JobNew") == 4 then startJob () end end function warpit ( ) if isPedInVehicle ( source ) then local vehiclee = getPedOccupiedVehicle ( source ) if ( getElementModel ( vehiclee ) == 420 ) then bindKey(source,"H","down",warpit) end end end function warpit2 () warpPedIntoVehicle(peds [ source ], getPedOccupiedVehicle ( source ), 2 ) local x, y, z = unpack ( dropoffss [ math.random ( #dropoffss ) ] ) markers [ source ] = createMarker ( x, y, z - 1, "cylinder", 5.0, 195, 197, 9, 255 ) SetVisiteFor (markers [ source ],source) mposii = { getElementPosition( markers [ source ] ) } blips [ source ] = createBlipAttachedTo ( markers [ source ], 41 ) SetVisiteFor (blips [ source ],source) addEventHandler ( "onMarkerHit", markers [ source ], pickmeup ) unbindKey(source,"H","down",warpit2) end function pickmeup () if isPedInVehicle ( source ) then destroyJob () local mx, my, mz = unpack ( mposi ) local mmx, mmy, mmz = unpack ( mposii ) local money = getDistanceBetweenPoints2D ( mx, my, mmx, mmy ) finalmoney = math.floor ( money ) if finalmoney then setTimer( function () finalmoney = finalmoney + 1000 setElementData(source,"Money", (getElementData(source,"Money" or 0 ) ) ) outputChatBox( "You have earned "..finalmoney.."!",source,0, 144, 0) setElementData(source,"Money", getElementData(source,"Money" or 0 ) ) end, 3000, 1 ) setTimer ( function () if ( isElement ( peds [ source ] ) ) then destroyElement ( peds [ source ] ) end startJob () end ,3000, 1 ) end end end function deleteOnExit ( ) if ( isElement ( markers [ source ] ) ) then destroyElement ( markers [ source ] ) end if ( isElement ( blips [ source ] ) ) then destroyElement ( blips [ source ] ) end if ( isElement ( peds [ source ] ) ) then destroyElement ( peds [ source ] ) end end function destroyJob () if ( isElement ( markers [ source ] ) ) then destroyElement ( markers [ source ] ) end if ( isElement ( blips [ source ] ) ) then destroyElement( blips [ source ] ) end end
  8. #Ivan7

    Help Taxi

    No Im talking about the peds i created around the map when I go to 1 of the peds im suppose to hit caps and it will warp the ped in.. it worked in my other verison but not this 1 for some reason
  9. #Ivan7

    Help Taxi

    Lol wow i was working for like 9 hours yesterday honostly I didnt get sleep, probley was tired and forgot it , anyways thanks but 1 more issue and i think im good ok i have warppedInVechile just issue is when I hit caps lock it wont warp him in.. but I have it set up, btw thanks alot diesel i owe u big time
  10. #Ivan7

    Help Taxi

    Ok So Everything seems to work now, just 1 problem when your the taximan it wont show the peds, or the blips .. once u click accept on the gui all thats happens is the taximan skin shows and u spawn in the taxi car here is the clientside GUIEditor = { memo = {}, button = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(0.4, 0.16, 0.35, 0.45, "Gta-Ar Taxi Job", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateButton(0.10, 0.90, 0.41, 0.80, "Accept", true, GUIEditor.window[1]) guiSetProperty(bAccept, "NormalTextColour", "FFAAAAAA") bClose = guiCreateButton(0.52, 0.90, 0.41, 0.80, "Decline", true, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") GUIEditor.memo[1] = guiCreateMemo(0.10, 0.1, 0.80, 0.75, " Gta-Ar Taxi Job Rules: 1) Go To Player (Blue Blip). 2) Pick up Player by pressing car horn. 3) Drop off Player to Red Blip. Be sure not to die, if you do you will lose your customer. Every dropoff you will earn up to $1000! Made By: [Gta-Ar]#Ivan ", true, GUIEditor.window[1]) local taximarker = createMarker(-2479.9282226563, -198.06895446777, 24.623662948608, "cylinder", 1.5, 255, 0, 0) createBlipAttachedTo( taximarker, 42) addEventHandler( "onClientRender", root, function ( ) local x, y, z = getElementPosition( taximarker ) local Mx, My, Mz = getCameraMatrix( ) if ( getDistanceBetweenPoints3D( x, y, z, Mx, My, Mz ) <= 15 ) then local WorldPositionX, WorldPositionY = getScreenFromWorldPosition( x, y, z +1.2, 3 ) if ( WorldPositionX and WorldPositionY ) then dxDrawText ( "Taxi Job", WorldPositionX, WorldPositionY, WorldPositionX, WorldPositionY, tocolor(255,255,255,255), 2.4, "arial" ) end end end ) function showGUIbt(hitElement) if (hitElement == localPlayer ) and not isPedInVehicle(localPlayer) then if getTeamName(getPlayerTeam(localPlayer)) ~= "Police" then guiSetVisible(GUIEditor.window[1], true) showCursor( true ) end end end addEventHandler("onClientMarkerHit", taximarker, showGUIbt) function showGUIbf() if source == bAccept then guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) triggerServerEvent("sTeame",localPlayer) elseif source == bClose then guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end end addEventHandler("onClientGUIClick", GUIEditor.window[1], showGUIbf) This is server side local pickups = { { -2514.2985839844, -19.26721572876, 25.6171875 }, { -2413.8093261719, 314.66299438477, 35.171875 }, { -1980.0808105469, 884.00354003906, 45.203125 }, { -1584.2047119141, 812.43743896484, 6.8203125 }, { -1817.1701660516, 1286.7491455078, 15.492509841919 }, { -2343.4348144531, 983.23840322031, 50.6953125 }, { -2554.942629531, 193.716659548, 6.2031769752502 } } local dropoffss = { { -2275.2744140625, 612.84197998047, 43.402828216553 }, { -2566.2153320313, 578.38897705078, 14.453125 }, { -2128.4689941406, 310.44934082031, 35.254566192627 }, { -1702.652941016, 717.54370117188, 24.890625 }, { -1912.1589355469, 883.3916015625, 35.215755462646 }, { -1977.3975830078, 1118.9444580078, 53.23331451416 }, { -1703.1501464844, 1340.6345214844, 7.1796875 } } local pedCus = { { 7 }, { 21 }, { 29 }, { 137 }, { 27 }, { 240 }, { 264 } } function SetVisiteFor (mark,player) setElementVisibleTo ( mark, root, false ) setElementVisibleTo ( mark, player, true ) end taxiVehs = { [420] = true } Cars = {} function teamSet ( ) if (isElement(Cars[source])) then destroyElement(Cars[source]) end setElementData(source,"markertax",4) setElementModel(source, 255) Cars[source] = createVehicle(420, -2485.3188476563, -169.93522644043, 25.6171875) addEventHandler ( "onVehicleExit", Cars[source], deleteOnExit ) addEventHandler ( "onVehicleEnter", Cars[source], inVEH ) addEventHandler ( "onVehicleStartEnter", Cars[source], enterVehicle ) warpPedIntoVehicle ( source, Cars[source] ) outputChatBox("You are now employed as a Taxi Driver!", source) end addEvent ( "sTeame", true) addEventHandler ( "sTeame", root, teamSet ) addEventHandler('onPlayerQuit', root, function() if isElement( Cars[source] ) then destroyElement(Cars[source] ) end end ) function enterVehicle ( thePlayer, seat, jacked ) if getElementType ( thePlayer ) == "player" and getElementData(thePlayer,"JobNew") ~= 4 then removePedFromVehicle( thePlayer ) outputChatBox("Only Taxi Drivers can drive this vehicle!", thePlayer) end end markers = { } blips = { } peds = { } mposi = { } mposii = {} function startJob ( thePlayer ) local x, y, z = unpack ( pickups [ math.random ( #pickups ) ] ) markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 5.0, 255, 0, 0, 0 ) SetVisiteFor (markers [ thePlayer ],thePlayer) mposi = { getElementPosition( markers [ thePlayer ] ) } local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ thePlayer ] = createPed( skins, x, y, z ) SetVisiteFor (peds [ thePlayer ],thePlayer) blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 58 ) SetVisiteFor (blips [ thePlayer ],thePlayer) addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) end function inVEH ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) and getElementData(thePlayer,"JobNew") == 4 then startJob ( thePlayer ) end end function warpit ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehiclee = getPedOccupiedVehicle ( thePlayer ) if ( getElementModel ( vehiclee ) == 420 ) and getElementData(thePlayer,"JobNew") == 4 then setTimer ( warpPedIntoVehicle, 2000, 1, peds [ thePlayer ], vehiclee, 2 ) destroyJob ( thePlayer ) local x, y, z = unpack ( dropoffss [ math.random ( #dropoffss ) ] ) markers [ thePlayer ] = createMarker ( x, y, z - 1, "cylinder", 5.0, 195, 197, 9, 255 ) SetVisiteFor (markers [ thePlayer ],thePlayer) mposii = { getElementPosition( markers [ thePlayer ] ) } blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) SetVisiteFor (blips [ thePlayer ],thePlayer) addEventHandler ( "onMarkerHit", markers [ thePlayer ], pickmeup ) end end end function pickmeup ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then destroyJob ( thePlayer ) local mx, my, mz = unpack ( mposi ) local mmx, mmy, mmz = unpack ( mposii ) local money = getDistanceBetweenPoints2D ( mx, my, mmx, mmy ) finalmoney = math.floor ( money ) if finalmoney then setTimer( function () finalmoney = finalmoney + 1000 setElementData(thePlayer,"Money", (getElementData(thePlayer,"Money" or 0 ) ) ) outputChatBox( "You have earned "..finalmoney.."!", thePlayer,0, 144, 0) setElementData(thePlayer,"Money", getElementData(thePlayer,"Money" or 0 ) ) end, 3000, 1 ) setTimer ( function ( ) if ( isElement ( peds [ thePlayer ] ) ) then destroyElement ( peds [ thePlayer ] ) end startJob ( thePlayer ) end ,3000, 1 ) end end end function deleteOnExit ( thePlayer ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement ( blips [ thePlayer ] ) end if ( isElement ( peds [ thePlayer ] ) ) then destroyElement ( peds [ thePlayer ] ) end end function destroyJob ( thePlayer ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end end
  11. #Ivan7

    ServerSided

    idk man ill just ask my friend #Twerky he will help me understand when we do teamviwer anyways thanks for always helping me if you can 1 do come to [Gta-Ar] Gangwars I would like to chill with you sometime, oh also idk if you know but im new to scripting like im really bad i probley started 8 days ago somewhere around their... i hope to get better soon
  12. #Ivan7

    ServerSided

    Dude the script isnt mine I told you Im making this for a friend and he wanted me to fix it up, sicne the script isnt mine i have to do it his way, if this was for me i would of started off simple, and the first time i did i had it like this bAccept = guiCreateButton(0.10, 0.90, 0.41, 0.80, "Accept", true, GUIEditor.window[1]) guiSetProperty(bAccept, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bAccept, showGUIbf, false) triggerServerEvent( "sTeame", thePlayer, "joinTeam" ) which you said was incorrect my gusse is im putting the wrong ifno in triggerServerEvent
  13. #Ivan7

    ServerSided

    I did excatly what u said but still the serverside is not working
  14. #Ivan7

    ServerSided

    I did it first time but my boss told me he didnt want it in team format so i had to change it up
  15. #Ivan7

    ServerSided

    this is the serversided local pickups = { [1]={ -2514.2985839844, -19.26721572876, 25.6171875 }, [2]={ -2413.8093261719, 314.66299438477, 35.171875 }, [3]={ -1980.0808105469, 884.00354003906, 45.203125 }, [4]={ -1584.2047119141, 812.43743896484, 6.8203125 }, [5]={ -1817.1701660516, 1286.7491455078, 15.492509841919 }, [6]={ -2343.4348144531, 983.23840322031, 50.6953125 }, [7]={ -2554.942629531, 193.716659548, 6.2031769752502 } } local dropoffss = { [1]={ -2275.2744140625, 612.84197998047, 43.402828216553 }, [2]={ -2566.2153320313, 578.38897705078, 14.453125 }, [3]={ -2128.4689941406, 310.44934082031, 35.254566192627 }, [4]={ -1702.652941016, 717.54370117188, 24.890625 }, [5]={ -1912.1589355469, 883.3916015625, 35.215755462646 }, [6]={ -1977.3975830078, 1118.9444580078, 53.23331451416 }, [7]={ -1703.1501464844, 1340.6345214844, 7.1796875 } } local pedCus = { [1]={ 7 }, [2]={ 21 }, [3]={ 29 }, [4]={ 137 }, [5]={ 27 }, [6]={ 240 }, [7]={ 264 } } function SetVisiteFor (mark,player) setElementVisibleTo ( mark, root, false ) setElementVisibleTo ( mark, player, true ) end taxiVehs = { [420] = true } Cars = {} function teamSet ( ) if (isElement(Cars[source])) then destroyElement(Cars[source]) end setElementData(source,"taximarker",4) setElementModel(source, 255) Cars[source] = createVehicle(420, -2485.3188476563, -169.93522644043, 25.6171875) addEventHandler ( "onVehicleExit", Cars[source], deleteOnExit ) addEventHandler ( "onVehicleEnter", Cars[source], inVEH ) addEventHandler ( "onVehicleStartEnter", Cars[source], enterVehicle ) warpPedIntoVehicle ( source, Cars[source] ) outputChatBox("You are now employed as a Taxi Driver!", source) end addEvent ( "sTeame", true) addEventHandler ( "sTeame", root, teamSet ) addEventHandler('onPlayerQuit', root, function() if isElement( Cars[source] ) then destroyElement(Cars[source] ) end end ) function enterVehicle ( thePlayer, seat, jacked ) if getElementType ( thePlayer ) == "player" and getElementData(thePlayer,"JobNew") ~= 4 then removePedFromVehicle( thePlayer ) outputChatBox("Only Taxi Drivers can drive this vehicle!", thePlayer) end end markers = { } blips = { } peds = { } mposi = { } mposii = {} function startJob ( thePlayer ) local x, y, z = unpack ( pickups [ math.random ( #pickups ) ] ) markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 5.0, 255, 0, 0, 0 ) SetVisiteFor (markers [ thePlayer ],thePlayer) mposi = { getElementPosition( markers [ thePlayer ] ) } local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ thePlayer ] = createPed( skins, x, y, z ) SetVisiteFor (peds [ thePlayer ],thePlayer) blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 58 ) SetVisiteFor (blips [ thePlayer ],thePlayer) addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) end function inVEH ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) and getElementData(thePlayer,"JobNew") == 4 then startJob ( thePlayer ) end end function warpit ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehiclee = getPedOccupiedVehicle ( thePlayer ) if ( getElementModel ( vehiclee ) == 420 ) and getElementData(thePlayer,"JobNew") == 4 then setTimer ( warpPedIntoVehicle, 2000, 1, peds [ thePlayer ], vehiclee, 2 ) destroyJob ( thePlayer ) local x, y, z = unpack ( dropoffss [ math.random ( #dropoffss ) ] ) markers [ thePlayer ] = createMarker ( x, y, z - 1, "cylinder", 5.0, 195, 197, 9, 255 ) SetVisiteFor (markers [ thePlayer ],thePlayer) mposii = { getElementPosition( markers [ thePlayer ] ) } blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) SetVisiteFor (blips [ thePlayer ],thePlayer) addEventHandler ( "onMarkerHit", markers [ thePlayer ], pickmeup ) end end end function pickmeup ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then destroyJob ( thePlayer ) local mx, my, mz = unpack ( mposi ) local mmx, mmy, mmz = unpack ( mposii ) local money = getDistanceBetweenPoints2D ( mx, my, mmx, mmy ) finalmoney = math.floor ( money ) if finalmoney then setTimer( function () finalmoney = finalmoney + 1000 outputChatBox( "You have earned ".. finalmoney .."!", thePlayer,0, 144, 0) setElementData(thePlayer,"Money", (getElementData(thePlayer,"Money") or 0 ) end, 3000, 1 ) setTimer ( function ( ) if ( isElement ( peds [ thePlayer ] ) ) then destroyElement ( peds [ thePlayer ] ) end startJob ( thePlayer ) end ,3000, 1 ) end end end function deleteOnExit ( thePlayer ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement ( blips [ thePlayer ] ) end if ( isElement ( peds [ thePlayer ] ) ) then destroyElement ( peds [ thePlayer ] ) end end function destroyJob ( thePlayer ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end end
  16. #Ivan7

    ServerSided

    so I would be putting this for client? taking a gusse.. GUIEditor = { memo = {}, button = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(0.4, 0.16, 0.35, 0.45, "Gta-Ar Taxi Job", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateButton(0.10, 0.90, 0.41, 0.80, "Accept", true, GUIEditor.window[1]) guiSetProperty(bAccept, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bAccept, showGUIbf, false) triggerServerEvent( "sTeame", thePlayer, "joinTeam" ) bClose = guiCreateButton(0.52, 0.90, 0.41, 0.80, "Decline", true, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") GUIEditor.memo[1] = guiCreateMemo(0.10, 0.1, 0.80, 0.75, " Gta-Ar Taxi Job Rules: 1) Go To Player (Blue Blip). 2) Pick up Player by pressing car horn. 3) Drop off Player to Red Blip. Be sure not to die, if you do you will lose your customer. Every dropoff you will earn up to $1000! Made By: [Gta-Ar]#Ivan ", true, GUIEditor.window[1]) local taximarker = createMarker(-2479.9282226563, -198.06895446777, 24.623662948608, "cylinder", 1.5, 255, 0, 0) createBlipAttachedTo( taximarker, 42) addEventHandler( "onClientRender", root, function ( ) local x, y, z = getElementPosition( taximarker ) local Mx, My, Mz = getCameraMatrix( ) if ( getDistanceBetweenPoints3D( x, y, z, Mx, My, Mz ) <= 15 ) then local WorldPositionX, WorldPositionY = getScreenFromWorldPosition( x, y, z +1.2, 3 ) if ( WorldPositionX and WorldPositionY ) then dxDrawText ( "Taxi Job", WorldPositionX, WorldPositionY, WorldPositionX, WorldPositionY, tocolor(255,255,255,255), 2.4, "arial" ) end end end ) function showGUIbt(hitElement) if (hitElement == localPlayer ) and not isPedInVehicle(localPlayer) then if getTeamName(getPlayerTeam(localPlayer)) ~= "Police" then guiSetVisible(GUIEditor.window[1], true) showCursor( true ) end end end addEventHandler("onClientMarkerHit", taximarker, showGUIbt) function showGUIbf() if source == bAccept then guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) joinTeam() elseif source == bClose then guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end end addEventHandler("onClientGUIClick", getRootElement(), showGUIbf)
  17. #Ivan7

    ServerSided

    i had it on the serverside first but then deleted it becuase i didnt want a team showing on Tab
  18. #Ivan7

    ServerSided

    In serverside line 137 unexpected symbol near ')'
  19. #Ivan7

    ServerSided

    And this would be the clientside GUIEditor = { memo = {}, button = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(0.4, 0.16, 0.35, 0.45, "Gta-Ar Taxi Job", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateButton(0.10, 0.90, 0.41, 0.80, "Accept", true, GUIEditor.window[1]) guiSetProperty(bAccept, "NormalTextColour", "FFAAAAAA") bClose = guiCreateButton(0.52, 0.90, 0.41, 0.80, "Decline", true, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") GUIEditor.memo[1] = guiCreateMemo(0.10, 0.1, 0.80, 0.75, " Gta-Ar Taxi Job Rules: 1) Go To Player (Blue Blip). 2) Pick up Player by pressing car horn. 3) Drop off Player to Red Blip. Be sure not to die, if you do you will lose your customer. Every dropoff you will earn up to $1000! Made By: [Gta-Ar]#Ivan ", true, GUIEditor.window[1]) local taximarker = createMarker(-2479.9282226563, -198.06895446777, 24.623662948608, "cylinder", 1.5, 255, 0, 0) createBlipAttachedTo( taximarker, 42) addEventHandler( "onClientRender", root, function ( ) local x, y, z = getElementPosition( taximarker ) local Mx, My, Mz = getCameraMatrix( ) if ( getDistanceBetweenPoints3D( x, y, z, Mx, My, Mz ) <= 15 ) then local WorldPositionX, WorldPositionY = getScreenFromWorldPosition( x, y, z +1.2, 3 ) if ( WorldPositionX and WorldPositionY ) then dxDrawText ( "Taxi Job", WorldPositionX, WorldPositionY, WorldPositionX, WorldPositionY, tocolor(255,255,255,255), 2.4, "arial" ) end end end ) function showGUIbt(hitElement) if (hitElement == localPlayer ) and not isPedInVehicle(localPlayer) then if getTeamName(getPlayerTeam(localPlayer)) ~= "Police" then guiSetVisible(GUIEditor.window[1], true) showCursor( true ) end end end addEventHandler("onClientMarkerHit", taximarker, showGUIbt) function showGUIbf() if source == bAccept then guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) joinTeam() elseif source == bClose then guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end end addEventHandler("onClientGUIClick", getRootElement(), showGUIbf)
  20. #Ivan7

    ServerSided

    Ok So Im doing the TaxiJob and Im almost done only problem is that once I click the button Accept it wont change my skin or spawn me in my car.. this is the server sided local pickups = { [1]={ -2514.2985839844, -19.26721572876, 25.6171875 }, [2]={ -2413.8093261719, 314.66299438477, 35.171875 }, [3]={ -1980.0808105469, 884.00354003906, 45.203125 }, [4]={ -1584.2047119141, 812.43743896484, 6.8203125 }, [5]={ -1817.1701660516, 1286.7491455078, 15.492509841919 }, [6]={ -2343.4348144531, 983.23840322031, 50.6953125 }, [7]={ -2554.942629531, 193.716659548, 6.2031769752502 } } local dropoffss = { [1]={ -2275.2744140625, 612.84197998047, 43.402828216553 }, [2]={ -2566.2153320313, 578.38897705078, 14.453125 }, [3]={ -2128.4689941406, 310.44934082031, 35.254566192627 }, [4]={ -1702.652941016, 717.54370117188, 24.890625 }, [5]={ -1912.1589355469, 883.3916015625, 35.215755462646 }, [6]={ -1977.3975830078, 1118.9444580078, 53.23331451416 }, [7]={ -1703.1501464844, 1340.6345214844, 7.1796875 } } local pedCus = { [1]={ 7 }, [2]={ 21 }, [3]={ 29 }, [4]={ 137 }, [5]={ 27 }, [6]={ 240 }, [7]={ 264 } } function SetVisiteFor (mark,player) setElementVisibleTo ( mark, root, false ) setElementVisibleTo ( mark, player, true ) end taxiVehs = { [420] = true } Cars = {} function teamSet ( ) if (isElement(Cars[source])) then destroyElement(Cars[source]) end setElementData(source,"taximarker",4) setElementModel(source, 255) Cars[source] = createVehicle(420, -2485.3188476563, -169.93522644043, 25.6171875) addEventHandler ( "onVehicleExit", Cars[source], deleteOnExit ) addEventHandler ( "onVehicleEnter", Cars[source], inVEH ) addEventHandler ( "onVehicleStartEnter", Cars[source], enterVehicle ) warpPedIntoVehicle ( source, Cars[source] ) outputChatBox("You are now employed as a Taxi Driver!", source) end addEvent ( "sTeame", true) addEventHandler ( "sTeame", root, teamSet ) addEventHandler('onPlayerQuit', root, function() if isElement( Cars[source] ) then destroyElement(Cars[source] ) end end ) function enterVehicle ( thePlayer, seat, jacked ) -- when a player enters a vehicle if getElementType ( thePlayer ) == "player" and getElementData(thePlayer,"JobNew") ~= 4 then removePedFromVehicle( thePlayer ) outputChatBox("Only Taxi Drivers can drive this vehicle!", thePlayer) end end markers = { } blips = { } peds = { } mposi = { } mposii = {} function startJob ( thePlayer ) local x, y, z = unpack ( pickups [ math.random ( #pickups ) ] ) markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 5.0, 255, 0, 0, 0 ) SetVisiteFor (markers [ thePlayer ],thePlayer) mposi = { getElementPosition( markers [ thePlayer ] ) } local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ thePlayer ] = createPed( skins, x, y, z ) SetVisiteFor (peds [ thePlayer ],thePlayer) blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 58 ) SetVisiteFor (blips [ thePlayer ],thePlayer) addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) end function inVEH ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) and getElementData(thePlayer,"JobNew") == 4 then startJob ( thePlayer ) end end function warpit ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehiclee = getPedOccupiedVehicle ( thePlayer ) if ( getElementModel ( vehiclee ) == 420 ) and getElementData(thePlayer,"JobNew") == 4 then setTimer ( warpPedIntoVehicle, 2000, 1, peds [ thePlayer ], vehiclee, 2 ) destroyJob ( thePlayer ) local x, y, z = unpack ( dropoffss [ math.random ( #dropoffss ) ] ) markers [ thePlayer ] = createMarker ( x, y, z - 1, "cylinder", 5.0, 195, 197, 9, 255 ) SetVisiteFor (markers [ thePlayer ],thePlayer) mposii = { getElementPosition( markers [ thePlayer ] ) } blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) SetVisiteFor (blips [ thePlayer ],thePlayer) addEventHandler ( "onMarkerHit", markers [ thePlayer ], pickmeup ) end end end function pickmeup ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then destroyJob ( thePlayer ) local mx, my, mz = unpack ( mposi ) local mmx, mmy, mmz = unpack ( mposii ) local money = getDistanceBetweenPoints2D ( mx, my, mmx, mmy ) finalmoney = math.floor ( money ) if finalmoney then setTimer( function () finalmoney = finalmoney + 1000 outputChatBox( "You have earned ".. finalmoney .."!", thePlayer,0, 144, 0) setElementData(thePlayer,"Money", (getElementData(thePlayer,"Money") or 0 ) + ) end, 3000, 1 ) setTimer ( function ( ) if ( isElement ( peds [ thePlayer ] ) ) then destroyElement ( peds [ thePlayer ] ) end startJob ( thePlayer ) end ,3000, 1 ) end end end function deleteOnExit ( thePlayer ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement ( blips [ thePlayer ] ) end if ( isElement ( peds [ thePlayer ] ) ) then destroyElement ( peds [ thePlayer ] ) end end function destroyJob ( thePlayer ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end end
  21. #Ivan7

    TaxiHelp

    No it doesnt work its fine thought i took it out ..
  22. #Ivan7

    Need Help

    1) the whole script isnt the owners.. 2) i created the GUI, Blips, Marker, Peds etc... 3) Only Problem I am having with is dxDrawText which now I took out because it doesnt seem to work
  23. #Ivan7

    Need Help

    + i did debug its in another topic and i stated the excat error.
  24. #Ivan7

    Need Help

    I never said it was at first... also im just doing editing like i said im new
  25. #Ivan7

    Need Help

    also when i hit the marker it says attempting to compare nil with a number..
×
×
  • Create New...