Jump to content

ابي طلب


Recommended Posts

ابي كيف اسوي يعني واحد لما ياخذ الشنطة تجيه عليه ضوء احمر ا وردي يعني هو الي اخذ الشنطة

سيرفر

mark = { 
    {1912.7153320313,-1353.298828125,14.034099578857}, 
    {965.12274169922,-1254.515625,16.978940963745}, 
    {767.3583984375,-1089.9201660156,24.0859375}, 
    {1119.6906738281,-1667.3558349609,13.632842063904}, 
    {1594.3298339844,-1555.9375,13.586387634277}, 
    {2550.1772460938,-1209.9743652344,54.543243408203}, 
    {2440.9250488281,-1900.4132080078,13.546875}, 
    {2801.7236328125,-2033.1927490234,13.5546875}, 
    {2478.498046875,-1962.2583007813,16.7578125}, 
    {2238.3420410156,-2155.6213378906,13.553833007813}, 
} 
  
bag = { 
    {1578.2777099609,-1345.7055664063,16.484375}, 
    {1302.3748779297,-1463.0034179688,10.046875}, 
    {839.49645996094,-1373.4074707031,22.532068252563}, 
    {913.87054443359,-1239.5350341797,17.019510269165}, 
    {1343.0270996094,-1665.2170410156,13.581394195557}, 
    {2755.1091308594,-1431.0084228516,30.453125}, 
    {2504.1252441406,-1688.5943603516,13.556813240051}, 
    {2448.0864257813,-2119.3666992188,13.546875}, 
    {2676.2385253906,-1791.9935302734,11.84375}, 
    {2754.1650390625,-2099.2358398438,12.10768699646}, 
} 
  
  
function createBag() 
    local mt = math.random(#bag) 
    ob = createObject(1210,bag[mt][1],bag[mt][2],bag[mt][3]) 
    setElementCollisionsEnabled(ob,false) 
    time = setTimer(roo,100,0,ob) 
    mar = createMarker(bag[mt][1],bag[mt][2],bag[mt][3],"corona",0.5,255,0,0,120) 
    bl = createBlipAttachedTo(mar,17) 
    setElementData(mar,"num",mt) 
    exports.guimessages:outputServer(root,"* #0069c7The Briefcase Has Been Started",0,255,0,true) 
end 
addEventHandler("onResourceStart",resourceRoot,createBag) 
  
addEventHandler("onMarkerHit",root, 
    function (player) 
        if ( source == mar ) then 
            if getElementType(player) == "player" then 
                local x,y,z = getElementPosition(player) 
                local data = getElementData(mar,"num") 
                local data = tonumber(data) 
                destroyElement(mar) 
                destroyElement(ob) 
                destroyElement(bl) 
                killTimer(time) 
                setElementData(player,"bag",true) 
                atBag = createObject(1210,x,y,z) 
                setElementData(atBag,"num",data) 
                exports.bone_attach:attachElementToBone(atBag,player,12,0,0.05,0.27,0,180,0) 
                bli = createBlipAttachedTo(player,17) 
                exports.guimessages:outputServer(root,"* #ffffff[ #ff0000" .. getPlayerName(player) .. "#ffffff ]#0069c7 Has Take The Bag",0,255,0,true) 
                marker = createMarker(mark[data][1],mark[data][2],mark[data][3],"cylinder",1.5,255,255,0,255,player) 
                marBli = createBlipAttachedTo(marker,12,2,255,0,0,255,0,99999.0,player) 
            end 
                    if ( isPedInVehicle( player ) ) then 
            return 
        end 
        end 
    end 
) 
  
function roo(ele) 
    local x,y,z = getElementRotation(ele) 
    setElementRotation(ele,x,y,z + 5) 
end 
  
addEventHandler("onPlayerWasted",root, 
    function () 
        if getElementData(source,"bag") and getElementData(source,"bag") == true then 
            local data = getElementData(atBag,"num") 
            local data = tonumber(data) 
            local x,y,z = getElementPosition(source) 
            setElementData(source,"bag",false) 
            destroyElement(atBag) 
            destroyElement(marker) 
            destroyElement(bli) 
            destroyElement(marBli) 
            ob = createObject(1210,x,y,z) 
            setElementCollisionsEnabled(ob,false) 
            time = setTimer(roo,100,0,ob) 
            mar = createMarker(x,y,z,"corona",0.5,255,0,0,120) 
            setElementData(mar,"num",data) 
            bl = createBlipAttachedTo(mar,17) 
        end 
    end 
) 
  
addEventHandler("onMarkerHit",root, 
    function (player) 
        if ( source == marker ) then 
            if getElementType(player) == "player" then 
                setElementData(player,"bag",false) 
                destroyElement(marker) 
                destroyElement(marBli) 
                destroyElement(bli) 
                destroyElement(atBag) 
                exports.guimessages:outputServer(root,"* #ffffff[ #ff0000" .. getPlayerName(player) .. " #ffffff] #0069c7Has Won #00ff0050000$ #0069c7From The Bag",255,0,0,true) 
                setElementData(player, "Money", (getElementData(player, "Money") or 0) + 50000) 
                triggerClientEvent(player,"onShowMoney",player) 
                setTimer(createBag,300000,1) 
            end 
        end 
    end 
) 
  
addEventHandler("onVehicleStartEnter",root, 
    function (player) 
        if getElementData(player,"bag") and getElementData(player,"bag") == true then 
            cancelEvent() 
            exports.guimessages:outputServer(player,"* #0069c7You Can't Enter The Vehicle You Have The Bag",255,0,0,true) 
        end 
    end 
) 
  
addEventHandler("onPlayerQuit",root, 
    function () 
        if getElementData(source,"bag") and getElementData(source,"bag") == true then 
            local data = getElementData(atBag,"num") 
            local data = tonumber(data) 
            local x,y,z = getElementPosition(source) 
            setElementData(source,"bag",false) 
            destroyElement(atBag) 
            destroyElement(marker) 
            destroyElement(bli) 
            destroyElement(marBli) 
            ob = createObject(1210,x,y,z) 
            setElementCollisionsEnabled(ob,false) 
            time = setTimer(roo,100,0,ob) 
            mar = createMarker(x,y,z,"corona",0.5,255,0,0,120) 
            setElementData(mar,"num",data) 
            bl = createBlipAttachedTo(mar,17) 
        end 
    end 
) 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...