Jump to content

iMr.SFA7

Members
  • Posts

    2,013
  • Joined

  • Last visited

Posts posted by iMr.SFA7

  1. spawns = {} 
      
    local DerbyMarker = createMarker( 2750.90234, -1694.06433, 11.83718 +1, 'arrow', 2,0,0,255,255 ) 
      
    setElementData(resourceRoot,"map","no") 
    setElementData(resourceRoot,"winMoney","0") 
    addEventHandler( 'onMarkerHit', DerbyMarker, 
    function( hitElement ) 
    if( hitElement ) and ( getElementType( hitElement ) == 'player' ) and not ( isPedInVehicle( hitElement) ) and checkDuel(hitElement) == "prestart" and ( not checkExistPlrOnDuel(hitElement) ) then 
    online = countPlayersOnDerby() 
    if tonumber(online)+1 < 32 then 
    setData(hitElement,"onCrossMap","yes") 
    outputChatBox("المرجو الانتظار...",hitElement,255,255,0,true) 
    setD(hitElement) 
    spawnOnMap(hitElement) 
    else 
    outputChatBox("لم يبق مكان لك بالديربي انتظر حتى الديربي القادم ان شاء الله",hitElement,0,255,0,true) 
    end 
    end 
    end) 
    function checkDuel(p) 
    if tostring(getElementData(resourceRoot,"map")) == "yes" then 
    outputChatBox("انتظر ريثما ينتهي الديربي الحالي",p,255,255,0,true) 
    elseif tostring(getElementData(resourceRoot,"map")) == "no" then 
    outputChatBox("انتظر ريثما يبدأ الديربي",p,255,255,0,true) 
    end 
    return tostring(getElementData(resourceRoot,"map")) 
    end 
    function checkExistPlrOnDuel(p) 
    per = getElementData(p,"onCrossMap") 
    if tostring(per) == "yes" then 
    return true 
    else 
    return false 
    end 
    end 
    function setData(element,key,vlr) 
    setElementData(element,key,vlr) 
    end 
    function setD(element) 
    setElementDimension(element,30) 
    end 
    function spawnOnMap(p) 
    count = countPlayersOnDerby() 
    spawned = "no" 
    for i,data in pairs(spawns)do 
    if tonumber(data.id) == tonumber(count) then 
    spawned = "yes" 
    v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz) 
    setElementDimension(v,30) 
    setElementFrozen(v,true) 
    setElementData(v,"creatorDerby","yes") 
    break 
    end 
    end 
    end 
    if spawned == "no" then 
    randomS = math.random("1","32") 
    for i,data in pairs(spawns)do 
    if tonumber(data.id) == tonumber(randomS) then 
    v = createVehicle(411,data.x,data.y,data.z,data.rx,data.ry,data.rz) 
    setElementDimension(v,30) 
    setElementFrozen(v,true) 
    setElementData(v,"creatorDerby","yes") 
    break 
    end end 
    end 
    if( hitElement ) and ( getElementType( hitElement ) == 'player' ) then 
    toggleControl(hitElement,"enter_exit", false ) 
    warpPedIntoVehicle(hitElement,v) 
    setCameraTarget(hitElement,hitElement) 
    end 
    function countPlayersOnDerby() 
    c = -1 
    for i,p in pairs(getElementsByType("player"))do 
    if checkExistPlrOnDuel(p) then 
    c = c+1 
    end 
    end 
    return tonumber(c) 
    end 
    function eventCheck () 
    if checkExistPlrOnDuel(source) then 
    toggleControl(source,"enter_exit",true ) 
    setData(source,"onCrossMap","no") 
    checkEnd() 
    end 
    end 
    addEventHandler("onPlayerWasted",getRootElement(),eventCheck) 
    addEventHandler("onPlayerQuit",getRootElement(),eventCheck) 
    addEventHandler("onPlayerJoin",getRootElement(),function() 
    outputChatBox("#CC0000#Derby Distruction Edited By #0069cc#mIDO",source,255,255,0,true) 
    setData(source,"onCrossMap","no") 
    end) 
    for i,p in pairs(getElementsByType("player"))do 
    setData(p,"onCrossMap","no") 
    end 
    function checkEnd() 
    c = 0 
    for i,p in pairs(getElementsByType("player"))do 
    if checkExistPlrOnDuel(p) then 
    c = c+1 
    winner = p 
    end end 
    if tonumber(c) == 1 then 
    givePlayerMoney(winner,tonumber(getElementData(resourceRoot,"winMoney"))) 
    n = string.gsub(getPlayerName(winner), "#%x%x%x%x%x%x", "") 
    outputChatBox("#00FF00[" .. n .. "]#FFFF00 Won the Derby and Won#00FF00[" .. tonumber(getElementData(resourceRoot,"winMoney")) .. "$]",getRootElement(),255,255,0,true) 
    setElementData(resourceRoot,"map","no") 
    endDerby() 
    setTimer(newDuel,30000,1) 
    end 
    end 
    function newDuel() 
    for i,p in pairs(getElementsByType("player"))do 
    setData(p,"onCrossMap","no") 
    end 
    setElementData(resourceRoot,"map","prestart") 
    RMoney = math.random("5000","20000") 
    setElementData(resourceRoot,"winMoney",tonumber(RMoney)) 
    outputChatBox("Derby Started / Winning Take :" .. RMoney .. "$ | $ " .. RMoney .. " الديربي بدأ / نصيب الفائز",getRootElement(),0,255,0,true) 
    setTimer(checkPlrs,30000,1) 
    end 
    function checkPlrs () 
    c = 0 
    for i,p in pairs(getElementsByType("player"))do 
    if checkExistPlrOnDuel(p) then 
    c = c+1 
    end end 
    if tonumber(c) > 1 then 
    setElementData(resourceRoot,"map","yes") 
    for i,p in pairs(getElementsByType("player"))do 
    if checkExistPlrOnDuel(p) then 
    setElementCollisionsEnabled(getPedOccupiedVehicle(p),true) 
    outputChatBox("لقد بدأ الديربي , يمكنك الانطلاق , حظآ موفقآ",p,0,255,0,true) 
    setElementFrozen(getPedOccupiedVehicle(p),false) 
    end end 
    else 
    endDerby() 
    setElementData(resourceRoot,"map","no") 
    outputChatBox("! لم يبدأ الديربي لعدم توفر الالعبين",getRootElement(),255,255,0,true) 
    setTimer(newDuel,60000,1) 
    end 
    end 
    setTimer(newDuel,3000,1) 
    function onStartLoadSpawns () 
    file = fileOpen("map.map") 
    localFile = fileOpen("map.xml") 
    fileWrite(localFile,"") 
    data = fileRead(file,999999) 
    fileWrite(localFile,data) 
    fileClose(localFile) 
    xml = xmlLoadFile("map.xml") 
    c = 0 
    for i,data in pairs(xmlNodeGetChildren(xml)) do 
    if  xmlNodeGetName(data) == "spawnpoint" then 
    c = c+1 
    v,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"vehicle"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ") 
    table.insert(spawns,{id = c,model = v,x = xx,y = yy,z = zz,rx = rxx,ry = ryy,rz = rzz}) 
    end 
    end 
    for i,data in pairs(xmlNodeGetChildren(xml)) do 
    if  xmlNodeGetName(data) == "object" then 
    m,xx,yy,zz,rxx,ryy,rzz = xmlNodeGetAttribute(data,"model"),xmlNodeGetAttribute(data,"posX"),xmlNodeGetAttribute(data,"posY"),xmlNodeGetAttribute(data,"posZ"),xmlNodeGetAttribute(data,"rotX"),xmlNodeGetAttribute(data,"rotY"),xmlNodeGetAttribute(data,"rotZ") 
    object = createObject(m,xx,yy,zz,rxx,ryy,rzz) 
    setElementDimension(object,30) 
    end end 
    end 
    setTimer(onStartLoadSpawns,3000,1) 
    function endDerby() 
    for i,p in pairs(getElementsByType("player"))do 
    if checkExistPlrOnDuel(p) then 
    killPed(p) 
    end end 
    for i,v in pairs(getElementsByType("vehicle"))do 
    if getElementData(v,"creatorDerby") then 
    destroyElement(v) 
    end end 
    end 
    setTimer(function() 
    for i,p in pairs(getElementsByType("player"))do 
    sea(p) 
    resetHan(p) 
    checkVeh(p) 
    checkModel(p) 
    end 
    end,1000,0) 
    outputChatBox("#CC0000#Derby Distruction Edited By #0069cc#mIDO",getRootElement(),0,0,0,true) 
    function sea(p) 
    if checkExistPlrOnDuel(p) then 
    x,y,z = getElementPosition(p) 
    if tonumber(z) <= 0 then 
    killPed(p) 
    end 
    end 
    end 
    function checkVeh(p) 
    if (tonumber(getElementDimension(p)) == 30) and not (isPedInVehicle(p))then 
    killPed(p) 
    end 
    end 
    function resetHan(p) 
    if checkExistPlrOnDuel(p) then 
    setVehicleHandling (getPedOccupiedVehicle(p), true ) 
    end 
    end 
    function checkModel(p) 
    if checkExistPlrOnDuel(p) and isPedInVehicle(p) then 
    if tonumber(getElementModel(getPedOccupiedVehicle(p))) ~= 411 then 
    killPed(p) 
    end end 
    end 
    

    source > hitElement

  2. groupstable = { 
        'Support'; 
        'Support staff'; 
        'Console' 
    } 
      
    groupstable_ = { 
        'lvl1'; 
        'lvl2'; 
        'lvl3'; 
        'lvl4'; 
        'lvl5'; 
        'lvl6' 
    } 
      
    function ifLocalPlayerHaveAccess(table) 
        if (table == 'Consoles') then 
            for _,group in ipairs (groupstable) do 
                if (isPlayerGroupName(group)) then 
                    return true 
                end 
            end 
        elseif (table == 'lvls') then 
            for _,group in ipairs (groupstable_) do 
                if (isPlayerGroupName(group)) then 
                    return true 
                end 
            end 
        end 
        return false 
    end 
      
    bindKey ( 'j', 'down', 
     function() 
        if (ifLocalPlayerHaveAccess('Consoles')) then 
            guiSetVisible(supportsystem,true) 
            showCursor(guiGetVisible(supportsystem)) 
            guiSetEnabled(aMessagesForm,true) 
            guiSetEnabled(aStaff,true) 
        elseif (ifLocalPlayerHaveAccess('lvls')) then 
            guiSetVisible(supportsystem,true) 
            showCursor(guiGetVisible(supportsystem)) 
            guiSetEnabled(aStaff,true) 
        else 
            guiSetVisible(supportsystem,true) 
            showCursor(guiGetVisible (supportsystem)) 
        end 
    end) 
    

    isPlayerGroupName لا تنـسى وضع الوظـيفة

  3. سفاح اعطيك الكود خاص ؟

    +++++++

    انا سويت ماركر والماركر ذا ينقل الاعبين الى داخل الماركر المحمي

    انا م ابي اطلع الاعبين من الماركر المحمي

    قصدك أنت سويت ماركر ينقل اللاعب الي دخله للماركر المحمي وما تبيه يطلع منه؟

  4. مشكور لعبة

    :-s

    Marker = createMarker(x, y, z, "cylinder", 10, 255, 0, 0, 150) 
      
    addEventHandler("onMarkerHit", Marker, 
     function (player) 
        if (getElementType (player) == "player" and not isPedInVehicle (player) and getPlayerAccount(player) and not isGuestAccount(getPlayerAccount(player))) then 
            if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Console")) then 
                setElementPosition( player, x, y, z) 
                outputChatBox ( "لا يمكنك الدخول ", player, 255, 0, 0, true ) 
            end 
        end 
    end) 
    

    بس باقي شي

    انا عندي ماركر يدخلني للاحداثيات داخل الماركرالي عنده الحماية وش اسوي

    ياليت توضح

  5. بعد التحقق then سطر 5 ناقصك

    وناقصك تتحقق من الالمنت الي دخل ان نوعه لاعب

    وانت مسويه يجيب حساب السورس والسورس هو الماركر

    والشات بوكس انت مسويه يجي للسورس والسورس بالحدث هذا هو الماركر يعني حوله للالمنت الي دخل

  6. تقدر تسوي ماركر يوم يدخله يحط عليه داتا

    وتسوي ماركر ثاني الي هو ما تبي أحد يدخله ويوم يدخله تتحقق اذا كان معاه الداتا يدخل عادي واذا ما كانت معاه ينقله للمكان الي تبيه

    createMarker -- two markers 
    'onMarkerHit' 
    setElementData 
    'onMarkerHit' -- 2 
    getElementData 
    setElementPosition 
      
    

  7. سوي جدول فيه الاحداثيات وحدث عند دخول اللاعب جيب قيمة عشوائية من الجدول

    math.random بأستخدام

    setCameraMatrix وحط الكاميرا ع الاحداثيات بأستخدام

    حل ابسط :

    https://wiki.multitheftauto.com/wiki/Table.random

    math.random الفنكشن الي طرحته بنفسه مستخدم في وظيفته الدالة

    يقدر يسويها بسطر واحد math.random واذا بتقولي اختصار اقولك لو هو استخدم الدالة

    اما لو استخدم الوظيفة الي طرحتها كذلك سطر واحد ولاكن زائد الوظيفة الي بيحطها بالسكربت حقه

  8. -- client --

    addEventHandler("onClientGUIClick", resourceRoot, 
     function() 
        if (source == gridlist) then 
            local sel = guiGridListGetSelectedItem(gridlist) 
            local text = guiGridListGetItemText(gridlist,sel,1) 
            local player = getPlayerFromName(text) 
            if (player) then 
                triggerServerEvent("getSerial", localPlayer, player) 
            end 
        end 
    end) 
      
      
    addEvent("setSerial",true) 
    addEventHandler("setSerial", root, 
     function(Name, Serial) 
        guiSetText(memo,'Player Name: '..Name..' \n Player Serial: '..Serial) 
    end) 
    

    -- server --

    addEvent("getSerial",true) 
    addEventHandler("getSerial", root, 
     function(player) 
        local playerName = getPlayerName(player) 
        local playerSerial = getPlayerSerial(player) 
        triggerClientEvent(source,"setSerial", source, playerName, playerSerial) 
    end) 
    

×
×
  • Create New...