Jump to content

Anubhav

Members
  • Posts

    2,277
  • Joined

  • Last visited

Everything posted by Anubhav

  1. you must use mySQL or xml to save it. Use the resource as gtagasje said
  2. Anubhav

    Blip

    It will show to all players white afaik.
  3. Anubhav

    Blip

    root = getRootElement () color = { 255, 255, 255 } players = {} resourceRoot = getResourceRootElement ( getThisResource () ) function onResourceStart ( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do if ( players[player] ) then createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] ) end end end function onPlayerSpawn ( spawnpoint ) if ( players[source] ) then createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] ) end end function onPlayerQuit () destroyBlipsAttachedTo ( source ) end function onPlayerWasted ( totalammo, killer, killerweapon ) destroyBlipsAttachedTo ( source ) end function setBlipsColor ( source, commandName, r, g, b ) if ( tonumber ( b ) ) then color = { tonumber ( r ), tonumber ( g ), tonumber ( b ) } for id, player in ipairs( getElementsByType ( "player" ) ) do destroyBlipsAttachedTo ( player ) if ( players[player] ) then createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] ) end end end end function setBlipColor ( source, commandName, r, g, b ) if ( tonumber ( b ) ) then destroyBlipsAttachedTo ( source ) players[source] = { tonumber ( r ), tonumber ( g ), tonumber ( b ) } createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) end end addCommandHandler ( "setblipscolor", setBlipsColor ) addCommandHandler ( "setblipcolor", setBlipColor ) addEventHandler ( "onResourceStart", resourceRoot, onResourceStart ) addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn ) addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerWasted", root, onPlayerWasted ) function destroyBlipsAttachedTo(player) local attached = getAttachedElements ( player ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end White colour...
  4. Anubhav

    sounds

    Ye, use playSound
  5. [url=https://wiki.multitheftauto.com/wiki/SetVehicleLocked]https://wiki.multitheftauto.com/wiki/SetVehicleLocked[/url] -- to lock
  6. --Making a gui guiCreateWindow guiCreateButton [url=https://wiki.multitheftauto.com/wiki/Server_Scripting_Functions#Vehicle_functions]https://wiki.multitheftauto.com/wiki/Se ... _functions[/url]
  7. What do you mean? It will respawn vehicles only and what you mean by i just need it so it ignores the trailers
  8. use it will respawn it. Click on it to go to wiki page. respawnVehicle
  9. SERVER: local pickups = { [1]={ 1985.55078125, -2252.1572265625, 13.722847938538, 103.69232177734 }, [2]={ 1977.173828125, -2306.5771484375, 13.726548194885, 117.84616088867 }, [3]={ 1978.21484375, -2375.298828125, 13.72612285614, 83.032989501953 }, [4]={ 1881.8857421875, -2618.0634765625, 13.723665237427, 354.06594848633 }, [5]={ 1822.025390625, -2616.158203125, 13.72287273407, 1.5384826660156 }, [6]={ 1565.8037109375, -2444.390625, 13.732352256775, 347.20880126953 }, [7]={ 1648.4814453125, -2442.1494140625, 13.746061325073, 311.34066772461 }, [8]={ 1726.4033203125, -2432.03515625, 14.044448852539, 316.79119873047 }, [9]={ 2065.685546875, 312.734375, 34.874977111816, 97.362640380859 }, [10]={ 1317.638671875, 1342.4091796875, 11.03280544281, 6.8132019042969 }, [11]={ 1332.490234375, 1596.5615234375, 10.997436523438, 119.69232177734 }, [12]={ 1475.1220703125, 1813.1171875, 10.996809959412, 5.6703491210938 }, [13]={ 1557.3193359375, 1500.7099609375, 11.015826225281, 30.637359619141 }, [14]={ 1557.189453125, 1360.5888671875, 11.044065475464, 301.23077392578 }, [15]={ 662.484375, 2152.4541015625, 20.68162727356, 355.03295898438 }, [16]={ 401.177734375, 2501.7470703125, 16.6618309021, 84.791229248047 }, [17]={ -40.1162109375, 2505.916015625, 16.770608901978, 89.098907470703 }, [18]={ -1818.6318359375, 2208.9130859375, 17.039325714111, 55.9560546875 }, [19]={ -1694.5498046875, -314.765625, 14.349038124084, 149.84616088867 }, [20]={ -1607.03125, -496.0966796875, 22.264881134033, 229.40660095215 }, [21]={ -1278.2822265625, -591.33984375, 14.32221031189, 14.901123046875 }, [22]={ -1235.732421875, -364.64453125, 14.478247642517, 162.94506835938 }, [23]={ -1312.7216796875, -202.8291015625, 14.327821731567, 135.07693481445 }, [24]={ -1225.6865234375, -12.3369140625, 14.343338012695, 47.164855957031 }, [25]={ -1286.9658203125, 95.5546875, 14.349571228027, 336.39559936523 }, } local dropoffss = { [1]={ 1985.55078125, -2252.1572265625, 13.722847938538, 103.69232177734 }, [2]={ 1977.173828125, -2306.5771484375, 13.726548194885, 117.84616088867 }, [3]={ 1978.21484375, -2375.298828125, 13.72612285614, 83.032989501953 }, [4]={ 1881.8857421875, -2618.0634765625, 13.723665237427, 354.06594848633 }, [5]={ 1822.025390625, -2616.158203125, 13.72287273407, 1.5384826660156 }, [6]={ 1565.8037109375, -2444.390625, 13.732352256775, 347.20880126953 }, [7]={ 1648.4814453125, -2442.1494140625, 13.746061325073, 311.34066772461 }, [8]={ 1726.4033203125, -2432.03515625, 14.044448852539, 316.79119873047 }, [9]={ 2065.685546875, 312.734375, 34.874977111816, 97.362640380859 }, [10]={ 1317.638671875, 1342.4091796875, 11.03280544281, 6.8132019042969 }, [11]={ 1332.490234375, 1596.5615234375, 10.997436523438, 119.69232177734 }, [12]={ 1475.1220703125, 1813.1171875, 10.996809959412, 5.6703491210938 }, [13]={ 1557.3193359375, 1500.7099609375, 11.015826225281, 30.637359619141 }, [14]={ 1557.189453125, 1360.5888671875, 11.044065475464, 301.23077392578 }, [15]={ 662.484375, 2152.4541015625, 20.68162727356, 355.03295898438 }, [16]={ 401.177734375, 2501.7470703125, 16.6618309021, 84.791229248047 }, [17]={ -40.1162109375, 2505.916015625, 16.770608901978, 89.098907470703 }, [18]={ -1818.6318359375, 2208.9130859375, 17.039325714111, 55.9560546875 }, [19]={ -1694.5498046875, -314.765625, 14.349038124084, 149.84616088867 }, [20]={ -1607.03125, -496.0966796875, 22.264881134033, 229.40660095215 }, [21]={ -1278.2822265625, -591.33984375, 14.32221031189, 14.901123046875 }, [22]={ -1235.732421875, -364.64453125, 14.478247642517, 162.94506835938 }, [23]={ -1312.7216796875, -202.8291015625, 14.327821731567, 135.07693481445 }, [24]={ -1225.6865234375, -12.3369140625, 14.343338012695, 47.164855957031 }, [25]={ -1286.9658203125, 95.5546875, 14.349571228027, 336.39559936523 }, } local team = getTeamFromName ( "Civilians" ) local planeVeh = { [592] = true, [577] = true, [511] = true, [548] = true, [593] = true, [487] = true, [519] = true, [513] = true, [553] = true, [488] = true, [469] = true } function teamSet ( ) local team = getTeamFromName ( "Civilians" ) if team and getElementData( client, "Occupation" ) ~= "Pilot" then setPlayerTeam ( thePlayer, Civilians ) setPlayerNametagColor ( client, 255, 200, 0 ) setElementData( client, "Occupation", "Pilot", true ) local skinID = 61 setElementModel(client, skinID) createBlipAttachedTo ( client, 0, 2, 255, 200, 0, 255, 1 ) exports["AC_message"]:outputTopBar( "You are now a pilot!", client, 0, 255, 0 ) else exports["AC_message"]:outputTopBar( "You are already a pilot!", client, 255, 0, 0 ) end end addEvent ( "setTeam", true) addEventHandler ( "setTeam", root, teamSet ) local markers = { } local blips = { } mposi = { } mposii = {} function startJob ( thePlayer ) local x,y,z,r = 0,0,0,0 local px,py,pz = getElementPosition( thePlayer ) repeat x,y,z,r = unpack( pickups[math.random ( #pickups )]) until getDistanceBetweenPoints3D( px,py,pz, x,y,z ) > 800 markers[thePlayer] = createMarker( x, y, z, "cylinder", 5.0, 255, 255, 255, 30 ) mposi = { getElementPosition( markers[thePlayer] ) } blips[thePlayer] = createBlipAttachedTo( markers [ thePlayer ], 41, 2, 0, 0, 0, 255, 3, 9999999, thePlayer ) addEventHandler( "onMarkerHit", markers[thePlayer], warpit ) exports["AC_message"]:outputTopBar("Fly to the next location at: "..getZoneName(x,y,z), thePlayer, 0, 255, 0) end local taximeter = {} function inVEH ( thePlayer, seat, jacked ) if ( getElementType( thePlayer ) == "player" and isPedInVehicle( thePlayer ) ) and seat == 0 and getElementData( thePlayer, "Occupation" ) == "Pilot" then if ( planeVeh[getElementModel( source )] ) then startJob ( thePlayer ) end end -- Enable the taximeter if getElementType ( thePlayer ) == "player" then if ( planeVeh[getElementModel( source )] ) and seat > 0 then drivers = getVehicleOccupants ( source ) payForTaxi( drivers[0], thePlayer ) if isTimer( taximeter[thePlayer] ) then killTimer( taximeter[thePlayer] ) end taximeter[thePlayer] = setTimer( payForTaxi, 60000, 0, drivers[0], thePlayer ) end end end addEventHandler ( "onVehicleEnter", getRootElement(), inVEH ) function payForTaxi( driver, passenger ) if isElement( passenger ) then if getPlayerMoney( passenger ) > 55 then local theVehicle = getPedOccupiedVehicle( driver ) if isElement( driver ) and isElement( passenger ) and isElement( theVehicle ) and getVehicleOccupant ( theVehicle, 0 ) == driver and getElementData( driver, "Occupation" ) == "Pilot" then takePlayerMoney( passenger, 55 ) givePlayerMoney( driver, 55 ) end else removePedFromVehicle( passenger ) if isElement( taximeter[thePlayer] ) then destroyElement( taximeter[thePlayer] ) end exports["AC_message"]:outputTopBar( "You can't afford this flight anymore, GET OUT!", passenger, 255, 0, 0 ) end end end function stopPaymentTaxi ( thePlayer, seat, jacked ) if isTimer( taximeter[thePlayer] ) then killTimer( taximeter[thePlayer] ) end end addEventHandler ( "onVehicleExit", getRootElement(), stopPaymentTaxi ) function warpit( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehicle = getPedOccupiedVehicle ( thePlayer ) if ( planeVeh[getElementModel( vehicle )] ) then destroyJob ( thePlayer ) local x, y, z, r = unpack( dropoffss[math.random( #dropoffss )]) markers[thePlayer] = createMarker( x, y, z - 1, "cylinder", 5.0, 255, 255, 255, 30 ) mposii = { getElementPosition( markers[thePlayer]) } blips[thePlayer] = createBlipAttachedTo( markers [thePlayer], 41, 2, 0, 0, 0, 255, 3, 9999999, thePlayer ) addEventHandler( "onMarkerHit", markers[thePlayer], pickmeup ) exports["AC_message"]:outputTopBar("Loading passengers...", thePlayer, 0, 255, 0) setTimer( setElementFrozen, 1000, 1, getPedOccupiedVehicle(thePlayer), true ) setTimer( setElementFrozen, 10000, 1, getPedOccupiedVehicle(thePlayer), false ) setTimer( flyTo, 10000, 1, thePlayer, x,y,z) 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/5 ) fine = math.floor(finalmoney - (finalmoney*(1-( getElementHealth( getPedOccupiedVehicle( thePlayer ))/1000)))) if finalmoney then givePlayerMoney( thePlayer, fine ) exports["AC_message"]:outputTopBar("You have earned ".. tostring(fine) .."$!", thePlayer, 0, 255, 0) if (finalmoney - fine) > 0 then exports["AC_message"]:outputTopBar("Removed ".. tostring(finalmoney - fine) .."$ due to damaged plane!", thePlayer, 255, 0, 0) end setTimer( function( ) startJob ( thePlayer ) end , 1000, 1 ) setTimer( setElementFrozen, 1000, 1, getPedOccupiedVehicle(thePlayer), true ) setTimer( setElementFrozen, 10000, 1, getPedOccupiedVehicle(thePlayer), false ) 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( taximeter[thePlayer] ) then killTimer( taximeter[thePlayer] ) end end addEventHandler ( "onVehicleExit", getRootElement(), deleteOnExit ) function destroyJob ( thePlayer ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end end function flyTo(thePlayer,x,y,z) exports["AC_message"]:outputTopBar("Take the passengers to: "..getZoneName(x,y,z), thePlayer, 0, 255, 0) end function destroyJob ( thePlayer ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end end function flyTo(thePlayer,x,y,z) exports["AC_message"]:outputTopBar("Take the passengers to: "..getZoneName(x,y,z), thePlayer, 0, 255, 0) end CLIENT local GUIEditor = { memo = {}, button = {}, window = {}, } addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource( )), function() local guiX,guiY = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((guiX-500)/2, (guiY-350)/2, 500, 350, "Pilot", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateButton(10, 300, 110, 36, "Take job", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bAccept, showGUIbf, false) addEventHandler("onClientGUIClick", bAccept, joinTeam, false) bClose = guiCreateButton(126, 300, 110, 36, "Cancel", false, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bClose, showGUIbf, false) GUIEditor.memo[1] = guiCreateMemo(10, 30, 480, 264, "Pilot\n".. "Fly around San Andreas and get payed\n" , false, GUIEditor.window[1]) guiEditSetReadOnly(GUIEditor.memo[1],true) end ) local joinBD = createMarker(-1546, -442, 5, "cylinder", 1.5, 255, 200, 0, 50) local joinBD2 = createMarker(1958, -2182, 12.5, "cylinder", 1.5, 255, 200, 0, 50) local joinBD3 = createMarker(1717, 1615.6, 9, "cylinder", 1.5, 255, 200, 0, 50) addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( )), function ( startedRes ) createBlipAttachedTo( joinBD, 56, 2, 0, 0, 0, 0, 0, 400); createBlipAttachedTo( joinBD2, 56, 2, 0, 0, 0, 0, 0, 400); createBlipAttachedTo( joinBD3, 56, 2, 0, 0, 0, 0, 0, 400); end ); function showGUIbt(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then guiSetVisible(GUIEditor.window[1], true) showCursor( true ) end end addEventHandler("onClientMarkerHit", joinBD, showGUIbt) addEventHandler("onClientMarkerHit", joinBD2, showGUIbt) addEventHandler("onClientMarkerHit", joinBD3, showGUIbt) function showGUIbf() guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end function joinTeam() triggerServerEvent("setTeam", localPlayer) end
  10. function setSkin() setElementModel( source, skinID ) end addCommandHandler("skin",setPedSkin) Use setElementModel .
  11. Anubhav

    HELP ME!!

    omg add me at skype i will tell you ( skype name: anubhav.agarwal87 )
  12. Anubhav

    HELP ME!!

    function spawn() createVehicle ( modelID, x, y, z + 10 ) -- Model ID i wrote it below where you can find it. Use x,y,z For location . In freeroam go where you want spawn it and type /getpos end To find model ID of Cars go to: https://wiki.multitheftauto.com/wiki/Vehicle_IDs
  13. I Think yes ,but slowly in all servers that script will be found. Please post a vedio or a screenshot.
  14. Anubhav

    HELP ME!!

    createVehicle respawnVehicle
  15. function m4FullSkill() setPedStat ( source , 78 , 50) --It will set the skill of M4 50. (50 OUT OF 1000)--
  16. https://wiki.multitheftauto.com/wiki/SetPedStat
  17. Use : setRadarAreaColour -- [url=https://wiki.multitheftauto.com/wiki/SetRadarAreaColor]https://wiki.multitheftauto.com/wiki/SetRadarAreaColor[/url] --
  18. Anubhav

    Help me

    OMG! Why no one is helping me? ccw answer fast i am realy tired of this noob bug of MTA (I THINK)
  19. Whats wrong with this script? you tried /debugscript 3 ? what are errors in it?
  20. https://forum.multitheftauto.com/viewtopic.php?f=148&t=69493
  21. It won't create image. It will create window.
  22. function playerLeave() local playeracc = getPlayerAccount(source) if ( playeraccount == true ) then local playercash = getPlayerMoney(source) setAccountData(playeracc, "cash", playercash) end end function playerReJoin() local playeracc = getPlayerAccount(source) if (playeracc == true) then local playerbank = getElementData(playercash, "cash",) if (playerbank == true) then setPlayerMoney(source, playerbank) else outputChatBox("You have no cash in your bank. no money has been set!", source, 255, 0, 0) end end end addEventHandler("onPlayerJoin", getRootElement(), playerReJoin) addEventHandler("onPlayerLeave", getRootElement(), playerLeave) Don't use getAccountData use getElementData it will be easier. Try this it should work
  23. Oh ok. Thanks for making me understand.
×
×
  • Create New...