Jump to content

The Killer

Members
  • Posts

    1,336
  • Joined

Everything posted by The Killer

  1. والي يقهرك اكثر يجيك واحد طلب منك كود تبي تساعده يحسسك انك شغال عنده
  2. حلوه الفكره + الفكره الي قالها The Best صراحه اشوفها مناسبه الي يجتهد ياخذ نصيبه ولازم يكون فيه نظام .والي يديرون المنتدى ما يهمهم شغل واسطات
  3. طيب جرب ذا GUIEditor = { memo = {}, button = {}, window = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0.29, 0.24, 0.42, 0.49, "", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "", true, GUIEditor.window[1]) bAccept = guiCreateButton(0.60, 0.20, 0.34, 0.17, "Accept Job", true, 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(0.67, 0.61, 0.20, 0.16, "CLOSE", true, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bClose, showGUIbf, false) GUIEditor.memo[1] = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "Become a Taxi Driver and get excellent wages at $500 per ride! To start simply enter a Taxi, drive to the Blue Person Icon and Pick them up. Then drop them off at the Waypoint. Easy! Perks : Repairing your Taxi at a Pay'n Spray is free!", true, GUIEditor.window[1]) end ) local joinBD = createMarker(1777.05078125, -1887.853515625, 12.387156486511, "cylinder", 0.9, 255, 0, 0) addEventHandler( "onClientResourceStart", getRootElement( ), function ( startedRes ) createBlipAttachedTo( joinBD, 60, 2, 255, 255, 255, 255, 0, 9999, localPlayer); 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) function showGUIbf() guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end function joinTeam() triggerServerEvent("sTeame", localPlayer, "teamSet") end Server # local pickups = { [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 }, [5]={ 1133.2607421875, -1286.6201171875, 13.245727539063 }, [6]={ 1197.380859375, -1576.9228515625, 13.2406873703 }, [7]={ 1275.6181640625, -1717.5087890625, 13.241578102112 }, [8]={ 1041.908203125, -1869.1728515625, 13.15417766571 }, [9]={ 680.9248046875, -1763.6552734375, 13.168544769287 }, [10]={ 597.5556640625, -1598.90234375, 16.215705871582 }, [11]={ 357.197265625, -1443.72265625, 34.185447692871 } } local dropoffss = { [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 }, [5]={ 584.8916015625, -1328.7021484375, 13.25985622406 }, [6]={ 989.75, -1372.083984375, 13.244333267212 }, [7]={ 1116.333984375, -1410.7666015625, 13.267498970032 }, [8]={ 1437.5244140625, -1039.8212890625, 23.564819335938 }, [9]={ 2124.4521484375, -1116.4931640625, 25.031726837158 }, [10]={ 2700.8857421875, -1091.896484375, 69.064071655273 }, [11]={ 2769.2744140625, -1494.0517578125, 27.58003616333 } } local pedCus = { [1]={ 9 }, [2]={ 10 }, [3]={ 14 }, [4]={ 15 }, [5]={ 37 } } Teame = createTeam("Taxi Driver", 0, 255, 0) taxiTeams = { [Teame] = true } taxiVehs = { [420] = true } function teamSet ( ) local team = getTeamFromName ( "Taxi Driver" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 0, 255, 0 ) setElementModel(source, 57) createVehicle(420, 1777.3017578125, -1891.779296875, 13.157614707947) outputChatBox("You are now employed as a Taxi Driver!", thePlayer) else local teamw = getTeamFromName ( "Taxi Driver" ) if teamw then cancelEvent() outputChatBox("You are already a Taxi driver!", source) end end end addEvent ( "sTeame", true) addEventHandler ( "sTeame", root, teamSet ) function enterVehicle ( thePlayer, seat, jacked ) -- when a player enters a vehicle if getElementType ( thePlayer ) == "player" then if ( taxiVehs[getElementModel ( source )] ) and ( not taxiTeams[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 = { } 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 ) mposi = { getElementPosition( markers [ thePlayer ] ) } local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ thePlayer ] = createPed( skins, x, y, z ) blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 58 ,2,255,0,0,255,0,9999,thePlayer) addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) end function inVEH ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then if ( getElementModel ( source ) == 420 ) then startJob ( thePlayer ) end end end addEventHandler ( "onVehicleEnter", getRootElement(), inVEH ) function warpit ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehiclee = getPedOccupiedVehicle ( thePlayer ) if ( getElementModel ( vehiclee ) == 420 ) 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, 255, 0, 0, 50 ) mposii = { getElementPosition( markers [ thePlayer ] ) } blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41, 2, 255, 255, 255, 255, 0, 9999, 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( givePlayerMoney, 3000, 1, thePlayer, finalmoney ) setTimer( outputChatBox, 3000, 1, thePlayer, "You have earned ".. money .."!", 0, 144, 0) 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 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 consoleSetPlayerPosition ( source, commandName, posX, posY, posZ ) setElementPosition ( source, posX, posY, posZ ) end addCommandHandler ( "setpos", consoleSetPlayerPosition )
  4. اعتقد ان الموضوع انطرح في المنتدى من قبل المهم الكود يصير كذا --WANTED LEVEL IF A PLAYER IS MURDERED BY A NON-COP, OR IF AN INNOCENT PERSON IS MURDERED BY A COP function aplayerdied( ammo, attacker, weapon, bodypart ) local glevel = getPlayerWantedLevel ( source ) if isElement(attacker) then local wlevel = getPlayerWantedLevel( source ) if wlevel > 0 then if getElementParent(attacker) == kingCOP then setPlayerWantedLevel( source, 0 ) end end if ( getElementType( attacker ) == "player" ) then local wlevel = getPlayerWantedLevel( attacker ) if wlevel < 6 then setPlayerWantedLevel( attacker, wlevel+1 ) end elseif ( getElementType( attacker ) == "vehicle" ) then thekiller = getVehicleController( attacker ) if isElement(thekiller) then local wlevel = getPlayerWantedLevel ( thekiller ) if wlevel < 6 then setPlayerWantedLevel( thekiller, wlevel+1 ) end end end end -- setPlayerWantedLevel( source, 0 ) end addEventHandler ( "onPlayerWasted",root, aplayerdied ) addEventHandler ( "onPlayerWasted",root,function (ammo,attacker,weapon,bodypart ) if getPlayerTeam(attacker) ~= getTeamFromName("Police") and getPlayerTeam(source) == getTeamFromName("Police") then if getPlayerWantedLevel(attacker) <= 3 then setPlayerWantedLevel(attacker,getPlayerWantedLevel(attacker)+3 ) end else if getPlayerWantedLevel(attacker) >= 1 then setPlayerWantedLevel(attacker,0) end end end ) --WANTED LEVEL IF A POLICE OFFICER IS ATTACKED function assaultinganofficer ( attacker, weapon, bodypart, loss ) if getElementParent(source) == kingCOP then if isElement(attacker) then if ( getElementType( attacker ) == "player" ) then if getElementParent(attacker) == kingCOP then return end elseif ( getElementType( attacker ) == "vehicle" ) then thedriver = getVehicleController( attacker ) if isElement(thedriver) then if getElementParent(thedriver) == kingCOP then return end end end if (getElementData ( source, "justdamaged" ) ~= "yes") and (source ~= attacker) then setElementData ( source, "justdamaged", "yes" ) local damagereset = setTimer ( resethurt, 20000, 1, source ) if ( getElementType( attacker ) == "player" ) then local wlevel = getPlayerWantedLevel( attacker ) if wlevel < 1 then setPlayerWantedLevel( attacker, wlevel+1 ) end elseif ( getElementType( attacker ) == "vehicle" ) then local thekiller = getVehicleController( attacker ) if isElement(thekiller) then local wlevel = getPlayerWantedLevel ( thekiller ) if wlevel < 1 then setPlayerWantedLevel( thekiller, wlevel+1 ) end end end end end end end addEventHandler ( "onPlayerDamage", getRootElement(), assaultinganofficer ) function resethurt(source) if isElement(source) then setElementData ( source, "justdamaged", "none" ) end end --WANTED LEVEL IF SOMEONE OTHER THAN A COP JACKS SOMEONE function carjackcheck(theVehicle, seat, jacker) if isElement(jacker) then if getElementParent(jacker) == kingCOP then return end local wlevel = getPlayerWantedLevel( jacker ) if wlevel < 4 then setPlayerWantedLevel( jacker, wlevel+1 ) end end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), carjackcheck ) --WANTED LEVEL IF NON-COP TRIES TO USE A COP CAR function copcarcheck(theVehicle, seat, jacked) if getElementParent(source) == kingCOP then return else local carid = getElementModel( theVehicle ) if carid == 598 or carid == 596 or carid == 597 or carid == 427 or carid == 490 or carid == 599 then if (getElementData ( source, "currentstatus" ) ~= "underarrest" ) then local wlevel = getPlayerWantedLevel( source ) if wlevel < 4 then setPlayerWantedLevel( source, wlevel+1 ) end end end end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), copcarcheck ) -- WANTED LEVEL IF A COP SEES SOMEONE DOING SOMETHING ILLEGAL -- TO MAKE THIS WORK WITH YOUR SCRIPT, SET A PLAYERS ELEMENT DATA "legalstatus" TO "illegal" WHILE DOING SOMETHING ILLEGAL -- DONT FORGET TO CHANGE IT TO SOMETHING ELSE AFTERWARDS THOUGH!! function inspection ( element ) if isElement(element) then if getPlayerTeam(player) and getTeamName(getPlayerTeam(player)) == 'Police' then return end local wlevel = getPlayerWantedLevel( source ) if wlevel == 0 then if (getElementData ( element, "legalstatus" ) == "illegal" ) then local cx, cy, cz = getElementPosition ( source ) local px, py, pz = getElementPosition ( element ) if ( getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) < 15 ) then setPlayerWantedLevel ( element, 1 ) end end end end end addEventHandler ( "onPlayerTarget", getRootElement(), inspection ) --STUFF TO MAKE BRIBE PICKUPS WORK function pickedUpWantedCheck ( player ) if ( getElementType(source) == "pickup" ) then if getPickupType ( source ) == 3 then if (getElementData ( source, "model" ) == "1247" ) then local level = getPlayerWantedLevel(player) if ( level > 0 ) then setPlayerWantedLevel ( player, level-1 ) end end end end end addEventHandler ( "onPickupHit", getRootElement(), pickedUpWantedCheck )
  5. لم يتم التجربه GUIEditor = { memo = {}, button = {}, window = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0.29, 0.24, 0.42, 0.49, "", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "", true, GUIEditor.window[1]) bAccept = guiCreateButton(0.60, 0.20, 0.34, 0.17, "Accept Job", true, 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(0.67, 0.61, 0.20, 0.16, "CLOSE", true, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bClose, showGUIbf, false) GUIEditor.memo[1] = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "Become a Taxi Driver and get excellent wages at $500 per ride! To start simply enter a Taxi, drive to the Blue Person Icon and Pick them up. Then drop them off at the Waypoint. Easy! Perks : Repairing your Taxi at a Pay'n Spray is free!", true, GUIEditor.window[1]) end ) local joinBD = createMarker(1777.05078125, -1887.853515625, 12.387156486511, "cylinder", 0.9, 255, 0, 0) addEventHandler( "onClientResourceStart", getRootElement( ), function ( startedRes ) createBlipAttachedTo( joinBD, 60, 2, 255, 255, 255, 255, 0, 9999, getRootElement()); 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) function showGUIbf() guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end function joinTeam() triggerServerEvent("sTeame", localPlayer, "teamSet") end
  6. حايس الكود ********* --WANTED LEVEL IF A PLAYER IS MURDERED BY A NON-COP, OR IF AN INNOCENT PERSON IS MURDERED BY A COP function aplayerdied( ammo, attacker, weapon, bodypart ) local glevel = getPlayerWantedLevel ( source ) if isElement(attacker) then local wlevel = getPlayerWantedLevel( source ) if wlevel > 0 then if getElementParent(attacker) == kingCOP then setPlayerWantedLevel( source, 0 ) end end if ( getElementType( attacker ) == "player" ) then local wlevel = getPlayerWantedLevel( attacker ) if wlevel < 6 then setPlayerWantedLevel( attacker, wlevel+1 ) end elseif ( getElementType( attacker ) == "vehicle" ) then thekiller = getVehicleController( attacker ) if isElement(thekiller) then local wlevel = getPlayerWantedLevel ( thekiller ) if wlevel < 6 then setPlayerWantedLevel( thekiller, wlevel+1 ) end end end end -- setPlayerWantedLevel( source, 0 ) end addEventHandler ( "onPlayerWasted",root, aplayerdied ) addEventHandler ( "onPlayerWasted",root,function (ammo,attacker,weapon,bodypart ) if getPlayerTeam(attacker) ~= getTeamFromName("Police") and getPlayerTeam(source) == getTeamFromName("Police") then if getPlayerWantedLevel(attacker) <= 3 then setPlayerWantedLevel(attacker,getPlayerWantedLevel(attacker)+3 ) end else if getPlayerWantedLevel(attacker) >= 1 then setPlayerWantedLevel(attacker,0) end end end ) --WANTED LEVEL IF A POLICE OFFICER IS ATTACKED function assaultinganofficer ( attacker, weapon, bodypart, loss ) if getElementParent(source) == kingCOP then if isElement(attacker) then if ( getElementType( attacker ) == "player" ) then if getElementParent(attacker) == kingCOP then return end elseif ( getElementType( attacker ) == "vehicle" ) then thedriver = getVehicleController( attacker ) if isElement(thedriver) then if getElementParent(thedriver) == kingCOP then return end end end if (getElementData ( source, "justdamaged" ) ~= "yes") and (source ~= attacker) then setElementData ( source, "justdamaged", "yes" ) local damagereset = setTimer ( resethurt, 20000, 1, source ) if ( getElementType( attacker ) == "player" ) then local wlevel = getPlayerWantedLevel( attacker ) if wlevel < 1 then setPlayerWantedLevel( attacker, wlevel+1 ) end elseif ( getElementType( attacker ) == "vehicle" ) then local thekiller = getVehicleController( attacker ) if isElement(thekiller) then local wlevel = getPlayerWantedLevel ( thekiller ) if wlevel < 1 then setPlayerWantedLevel( thekiller, wlevel+1 ) end end end end end end end addEventHandler ( "onPlayerDamage", getRootElement(), assaultinganofficer ) function resethurt(source) if isElement(source) then setElementData ( source, "justdamaged", "none" ) end end --WANTED LEVEL IF SOMEONE OTHER THAN A COP JACKS SOMEONE function carjackcheck(theVehicle, seat, jacker) if isElement(jacker) then if getElementParent(jacker) == kingCOP then return end local wlevel = getPlayerWantedLevel( jacker ) if wlevel < 4 then setPlayerWantedLevel( jacker, wlevel+1 ) end end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), carjackcheck ) --WANTED LEVEL IF NON-COP TRIES TO USE A COP CAR function copcarcheck(theVehicle, seat, jacked) if getElementParent(source) == kingCOP then return else local carid = getElementModel( theVehicle ) if carid == 598 or carid == 596 or carid == 597 or carid == 427 or carid == 490 or carid == 599 then if (getElementData ( source, "currentstatus" ) ~= "underarrest" ) then local wlevel = getPlayerWantedLevel( source ) if wlevel < 4 then setPlayerWantedLevel( source, wlevel+1 ) end end end end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), copcarcheck ) -- WANTED LEVEL IF A COP SEES SOMEONE DOING SOMETHING ILLEGAL -- TO MAKE THIS WORK WITH YOUR SCRIPT, SET A PLAYERS ELEMENT DATA "legalstatus" TO "illegal" WHILE DOING SOMETHING ILLEGAL -- DONT FORGET TO CHANGE IT TO SOMETHING ELSE AFTERWARDS THOUGH!! function inspection ( element ) if isElement(element) then if getPlayerTeam(player) and getTeamName(getPlayerTeam(player)) == 'Police' then return end local wlevel = getPlayerWantedLevel( source ) if wlevel == 0 then if (getElementData ( element, "legalstatus" ) == "illegal" ) then local cx, cy, cz = getElementPosition ( source ) local px, py, pz = getElementPosition ( element ) if ( getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) < 15 ) then setPlayerWantedLevel ( element, 1 ) end end end end end addEventHandler ( "onPlayerTarget", getRootElement(), inspection ) --STUFF TO MAKE BRIBE PICKUPS WORK function pickedUpWantedCheck ( player ) if ( getElementType(source) == "pickup" ) then if getPickupType ( source ) == 3 then if (getElementData ( source, "model" ) == "1247" ) then local level = getPlayerWantedLevel(player) if ( level > 0 ) then setPlayerWantedLevel ( player, level-1 ) end end end end end addEventHandler ( "onPickupHit", getRootElement(), pickedUpWantedCheck )
  7. اقولك ما توقع تقدر تقولي تبي الفنكشن @_@
  8. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() setTimer(function() setTimer ( playSound, 1000, 1, "0.mp3") setTimer ( playSound, 1000, 1, "1.mp3") setTimer ( playSound, 5000, 1, "2.mp3") setTimer ( playSound, 15000, 1, "3.mp3") setTimer ( playSound, 19000, 1, "4.mp3") setTimer ( playSound, 30000, 1, "5.mp3") setTimer ( playSound, 40000, 1, "6.mp3") setTimer ( playSound, 50000, 1, "7.mp3") setTimer ( playSound, 80000, 1, "8.mp3") setTimer ( playSound, 100000, 1, "9.mp3") end) end )
  9. زود العدد هنا setSoundMaxDistance ( sound, 100 )
  10. isElementInMarker isElementWithinMarker
  11. المنطقه المحميه تقدر تستخدم معها : Event: 'onColShapeHit' createColCuboid -- تحطحها في منطقه معينه createRadarArea -- تستخدم معها هذا تخليه نفس الاحداثيات عشان تشوفه giveWeapon -- تعطيه سلاح اذا طلع منها Event: 'onColShapeLeave' takeWeapon -- تاخذ السلاح
  12. طيب وش تحتري ؟ رح جربه
  13. local Markers = { [1] = { 1218,-1656.6999511719,10.800000190735 }, [2] = { 1218,-1652,10.800000190735}, [3] = {1218,-1646.3000488281,10.800000190735 }, } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _, TheMarkers in ipairs ( Markers ) do TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 0, 0, 255, 250 ) end end ) local veh = {} addEvent ("getCar", true) addEventHandler ("getCar", getRootElement(), function(car) if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local carID = getVehicleModelFromName (car) local x,y,z = getElementPosition(source) local carName = getVehicleNameFromModel (carID) veh[source] = createVehicle(carID, x,y,z) addVehicleUpgrade(veh[source],1010) addVehicleUpgrade(veh[source],1085) if ( carID == 497 ) then setElementPosition ( veh[source], 1228.1999511719,-1685.3000488281,35) end if ( carID == 563 ) then setElementPosition ( veh[source], 1254.3000488281,-1684.4000244141,35) end setElementData ( veh[source], "DriveGroup", "SWAT" ) setVehicleColor(veh[source], 255, 255, 255) warpPedIntoVehicle(source, veh[source]) end ) addEventHandler ( "onPlayerQuit", getRootElement(), function () if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end end) addEventHandler ( "onVehicleStartEnter", root, function ( player ) if ( getElementData ( source, "DriveGroup" ) ) then if ( getElementData ( source, "DriveGroup" ) ~= getElementData ( player, "gang" ) ) then cancelEvent ( ) outputChatBox ( "* Error: This car for group 'SWAT' only!", player, 210, 0, 0, true ) end end end ) function markerHit (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then return end if getElementType(hitPlayer) == "player" then if (getElementData(hitPlayer, "gang") == "SWAT") then triggerClientEvent ("openMean", hitPlayer) end end end addEventHandler ("onMarkerHit", resourceRoot, markerHit) function markerLeave (hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then triggerClientEvent ("closeOpenMean", hitPlayer) end end addEventHandler ("onMarkerLeave", resourceRoot, markerLeave) window GUIEditor = { gridlist = {}, window = {}, button = {} } cars = { {490}, {528}, {601}, {522}, {411}, {541}, {497}, {563}, --{carID}, } local l, w = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((l - 144) / 2, (w - 353) / 2, 144, 353, "Group car", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF5A5A") GUIEditor.gridlist[1] = guiCreateGridList(9, 24, 126, 265, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3) guiGridListAddColumn(GUIEditor.gridlist[1], "Vehicle", 0.9) GUIEditor.button[1] = guiCreateButton(9, 295, 126, 22, "Get", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF5A5A") guiSetFont(GUIEditor.button[1], "default-bold-small") GUIEditor.button[2] = guiCreateButton(9, 321, 126, 22, "Close", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFB50000") guiSetFont(GUIEditor.button[2], "default-bold-small") for i,v in ipairs (cars) do local carName = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, i.."-", false, true) guiGridListSetItemText (GUIEditor.gridlist[1], row, 2, carName, false, true) guiGridListSetItemColor(GUIEditor.gridlist[1], row, 1, 255, 90, 90, 255) end addEvent ("openMean", true) function openMean () if (getLocalPlayer() == source) then guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end addEventHandler ("openMean", getRootElement(), openMean) addEvent ("closeOpenMean", true) function closeOpenMean () if (getLocalPlayer() == source) then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end addEventHandler ("closeOpenMean", getRootElement(), closeOpenMean) addEventHandler ("onClientGUIClick", GUIEditor.button[2], function (button, state, absoluteX, absoluteYe) guiSetVisible(GUIEditor.window[1],false) showCursor(false) end) function trigger () if (guiGridListGetSelectedItem (GUIEditor.gridlist[1])) then local car = guiGridListGetItemText (GUIEditor.gridlist[1], guiGridListGetSelectedItem (GUIEditor.gridlist[1]), 2) if car == "" or car == nil then outputChatBox( "#FFFF00Please Selected Car From List.",255,90,90,true ) return end triggerServerEvent ("getCar", getLocalPlayer(), car) guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end addEventHandler ("onClientGUIClick", GUIEditor.button[1], function (button, state, absoluteX, absoluteYe) trigger(getLocalPlayer()) end) addEventHandler ("onClientGUIDoubleClick", GUIEditor.gridlist[1], function (button, state, absoluteX, absoluteYe) trigger(getLocalPlayer()) end) الماركر الثاني local Markers = { [1] = { 206.3994140625,1863.19921875,12.39999961853 }, [2] = { 205.8994140625,1869.5,12.39999961853}, } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _, TheMarkers in ipairs ( Markers ) do TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 0, 0, 255, 250 ) end end ) local veh = {} addEvent ("getCar2", true) addEventHandler ("getCar2", getRootElement(), function(car) if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local carID = getVehicleModelFromName (car) local x,y,z = getElementPosition(source) local carName = getVehicleNameFromModel (carID) veh[source] = createVehicle(carID, x,y,z) addVehicleUpgrade(veh[source],1010) addVehicleUpgrade(veh[source],1085) if ( carID == 497 ) then setElementPosition ( veh[source],90.19108 ,1863.17017 ,18.02813) end if ( carID == 548 ) then setElementPosition ( veh[source], 89.87344 ,1838.84375 ,18.02813) end setElementData ( veh[source], "DriveGroup", "ARMY" ) setVehicleColor(veh[source], 255, 255, 255) warpPedIntoVehicle(source, veh[source]) end ) addEventHandler ( "onPlayerQuit", getRootElement(), function () if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end end) addEventHandler ( "onVehicleStartEnter", root, function ( player ) if ( getElementData ( source, "DriveGroup" ) ) then if ( getElementData ( source, "DriveGroup" ) ~= getElementData ( player, "gang" ) ) then cancelEvent ( ) outputChatBox ( "* Error: This car for group 'ARMY' only!", player, 210, 0, 0, true ) end end end ) function markerHit (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then return end if getElementType(hitPlayer) == "player" then if (getElementData(hitPlayer, "gang") == "ARMY") then triggerClientEvent ("openMean2", hitPlayer) end end end addEventHandler ("onMarkerHit", resourceRoot, markerHit) function markerLeave (hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then triggerClientEvent ("closeOpenMean2", hitPlayer) end end addEventHandler ("onMarkerLeave", resourceRoot, markerLeave) window GUIEditor = { gridlist = {}, window = {}, button = {} } cars = { {490}, {528}, {522}, {411}, {541}, {497}, {548}, --{carID}, } local l, w = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((l - 144) / 2, (w - 353) / 2, 144, 353, "Group car", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF5A5A") GUIEditor.gridlist[1] = guiCreateGridList(9, 24, 126, 265, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.3) guiGridListAddColumn(GUIEditor.gridlist[1], "Vehicle", 0.9) GUIEditor.button[1] = guiCreateButton(9, 295, 126, 22, "Get", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF5A5A") guiSetFont(GUIEditor.button[1], "default-bold-small") GUIEditor.button[2] = guiCreateButton(9, 321, 126, 22, "Close", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFB50000") guiSetFont(GUIEditor.button[2], "default-bold-small") for i,v in ipairs (cars) do local carName = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, i.."-", false, true) guiGridListSetItemText (GUIEditor.gridlist[1], row, 2, carName, false, true) guiGridListSetItemColor(GUIEditor.gridlist[1], row, 1, 255, 90, 90, 255) end addEvent ("openMean2", true) function openMean2 () if (getLocalPlayer() == source) then guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end addEventHandler ("openMean2", getRootElement(), openMean2) addEvent ("closeOpenMean2", true) function closeOpenMean2 () if (getLocalPlayer() == source) then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end addEventHandler ("closeOpenMean2", getRootElement(), closeOpenMean2) addEventHandler ("onClientGUIClick", GUIEditor.button[2], function (button, state, absoluteX, absoluteYe) guiSetVisible(GUIEditor.window[1],false) showCursor(false) end) function trigger () if (guiGridListGetSelectedItem (GUIEditor.gridlist[1])) then local car = guiGridListGetItemText (GUIEditor.gridlist[1], guiGridListGetSelectedItem (GUIEditor.gridlist[1]), 2) if car == "" or car == nil then outputChatBox( "#FFFF00Please Selected Car From List.",255,90,90,true ) return end triggerServerEvent ("getCar2", getLocalPlayer(), car) guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end addEventHandler ("onClientGUIClick", GUIEditor.button[1], function (button, state, absoluteX, absoluteYe) trigger(getLocalPlayer()) end) addEventHandler ("onClientGUIDoubleClick", GUIEditor.gridlist[1], function (button, state, absoluteX, absoluteYe) trigger(getLocalPlayer()) end) لم يتم التجربه
  14. جرب -- Server Side ! num = 5 setElementData ( resourceRoot, "Time", num ) function MissonTime ( ) num = num - 1 setElementData ( resourceRoot, "Time", num ) if num <= 0 then if isTimer ( MissonTimer ) then killTimer ( MissonTimer ) end num = 0 end end MissonTimer = setTimer ( MissonTime, 1000, 0 ) addCommandHandler ( "Time", function ( plr ) if getElementData ( resourceRoot, "Time" ) == 0 then outputChatBox ( "لقد بدأت المهمة فعلاً", plr, 255, 0, 0, true ) else outputChatBox ( "بقى على المهمة".. getElementData ( resourceRoot, "Time" ), plr, 0, 255, 0, true ) end end ) if getElementData(resourceRoot,'Time') == 5 then addEventHandler('onMarkerHit',JoinCrimes,MarkerStartFunction) end local Teams = {['No Team'] = true,['Grove'] = true,['Aztecas'] = true} local JoinCrimes = createMarker(727.57281,-1276.31909,13.64844,"cylinder",1.5,0,0,255,155) MarkerStartFunction = function(player) if ( getElementType(player) == 'player' ) then if ( getPlayerTeam ( player ) ) and ( Teams[getTeamName(getPlayerTeam(player))] ) then setElementInterior ( player, 5 ,1263.8504638672 ,-785.31146240234 ,1091.90625 ) end end end
  15. وش الي ما زبط نفس المشكله ينزل سيارتين ؟؟
  16. local Markers = { [1] = { 1218,-1656.6999511719,10.800000190735 }, [2] = { 1218,-1652,10.800000190735}, [3] = {1218,-1646.3000488281,10.800000190735 }, } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _, TheMarkers in ipairs ( Markers ) do TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 0, 0, 255, 250 ) end end ) local veh = {} addEvent ("getCar", true) addEventHandler ("getCar", getRootElement(), function(car) if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local carID = getVehicleModelFromName (car) local x,y,z = getElementPosition(source) local carName = getVehicleNameFromModel (carID) veh[source] = createVehicle(carID, x,y,z) addVehicleUpgrade(veh[source],1010) addVehicleUpgrade(veh[source],1085) if ( carID == 497 ) then setElementPosition ( veh[source], 1228.1999511719,-1685.3000488281,35) end if ( carID == 563 ) then setElementPosition ( veh[source], 1254.3000488281,-1684.4000244141,35) end setElementData ( veh[source], "DriveGroup", "SWAT" ) setVehicleColor(veh[source], 255, 255, 255) warpPedIntoVehicle(source, veh[source]) end ) addEventHandler ( "onPlayerQuit", getRootElement(), function () if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end end) addEventHandler ( "onVehicleStartEnter", root, function ( player ) if ( getElementData ( source, "DriveGroup" ) ) then if ( getElementData ( source, "DriveGroup" ) ~= getElementData ( player, "gang" ) ) then cancelEvent ( ) outputChatBox ( "* Error: This car for group 'SWAT' only!", player, 210, 0, 0, true ) end end end ) function markerHit (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then return end if getElementType(hitPlayer) == "player" then if (getElementData(hitPlayer, "gang") == "SWAT") then triggerClientEvent ("openMean", hitPlayer) end end end addEventHandler ("onMarkerHit", resourceRoot, markerHit) function markerLeave (hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then triggerClientEvent ("closeOpenMean", hitPlayer) end end addEventHandler ("onMarkerLeave", resourceRoot, markerLeave) الماركر الثاني local Markers = { [1] = { 206.3994140625,1863.19921875,12.39999961853 }, [2] = { 205.8994140625,1869.5,12.39999961853}, } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _, TheMarkers in ipairs ( Markers ) do TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 0, 0, 255, 250 ) end end ) local veh = {} addEvent ("getCar", true) addEventHandler ("getCar", getRootElement(), function(car) if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local carID = getVehicleModelFromName (car) local x,y,z = getElementPosition(source) local carName = getVehicleNameFromModel (carID) veh[source] = createVehicle(carID, x,y,z) addVehicleUpgrade(veh[source],1010) addVehicleUpgrade(veh[source],1085) if ( carID == 497 ) then setElementPosition ( veh[source],90.19108 ,1863.17017 ,18.02813) end if ( carID == 548 ) then setElementPosition ( veh[source], 89.87344 ,1838.84375 ,18.02813) end setElementData ( veh[source], "DriveGroup", "ARMY" ) setVehicleColor(veh[source], 255, 255, 255) warpPedIntoVehicle(source, veh[source]) end ) addEventHandler ( "onPlayerQuit", getRootElement(), function () if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end end) addEventHandler ( "onVehicleStartEnter", root, function ( player ) if ( getElementData ( source, "DriveGroup" ) ) then if ( getElementData ( source, "DriveGroup" ) ~= getElementData ( player, "gang" ) ) then cancelEvent ( ) outputChatBox ( "* Error: This car for group 'ARMY' only!", player, 210, 0, 0, true ) end end end ) function markerHit (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then return end if getElementType(hitPlayer) == "player" then if (getElementData(hitPlayer, "gang") == "ARMY") then triggerClientEvent ("openMean", hitPlayer) end end end addEventHandler ("onMarkerHit", resourceRoot, markerHit) function markerLeave (hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then triggerClientEvent ("closeOpenMean", hitPlayer) end end addEventHandler ("onMarkerLeave", resourceRoot, markerLeave) لم يتم التجربه
  17. جرب ذا addEventHandler("onPlayerWasted", root, function() local weapons = convertWeaponsToJSON(source) setElementData(source,"tempWeapons",weapons) end ) addEventHandler("onPlayerSpawn", root, function () local weapons = getElementData(source,"tempWeapons") if (weapons) then giveWeaponsFromJSON(source, weapons) end end ) function convertWeaponsToJSON(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end
×
×
  • Create New...