Jump to content

حساب سريع


Recommended Posts

تقدر تستخدم النجمه كـ علامة ضرب في البرمجه

المعروف ان الثانية الواحده تساوي 1000 ملي ثانية

و الدقيقة تساوي 60 ثانية

يعني يصير الـ 10 دقائق كذا

10*60*1000

تقدر تحطها كذا في التايمر

setTimer(function() end, 10*60*1000, 1, end) 

Link to comment

ممكن طلب تحددولي الشطر الي فيه مدة بدأ مهمة السرق هي تبدأ كل 3 دقايق ابغاها كل 10 وأبغى اعرف السطر كم

TimerStart = {} 
TimerStop = {}
AllTable = {}
 
rRoot = getResourceRootElement(getThisResource())
r,g,b = 255,0,0 -- اللون
posX,posY = 0.2, 0.5 -- المكان على الشاشة
size = 2.0 -- الحجم
robbertimerStart = 3
robbertimerstop = 15
 
robbertime = robbertimerStart * 60 * 1000
robbertimeStop = robbertimerstop * 60 * 1000
 
function createTeamsOnStart ()
    outputChatBox ( "* * * تم تشغيل مود سرقة البنك ستبدأ المهمه بعد 3 دقائق * * * ", hitter, 0, 0, 255, true )
    TimerStart["timer"] = setTimer ( start_Roob, robbertime,1) ---time on start
    roobB = createObject (2634, 308.10000610352, 2516.3999023438, 17.5, 0, 0, 186) 
    for i,player in ipairs(getElementsByType("player")) do
    setElementData(player, "Marker_destoy", 0)
        setElementData(player, "MiissoinStart", false) 
    end
    AllowUseFunctionRoob() 
end
addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart)
 
addEvent ("roob", true)
function openRampLVSF ()
    setElementData( source, "Marker_destoy", tonumber( getElementData( source, "Marker_destoy" ) or 0 ) + 1 )
    textDisplayAddObserver ( RobberDisplay, source )
    setElementData(source, "Timeleft", 10)
    setPedAnimation (source, "ROB_BANK", "CAT_Safe_Rob" )
    setTimer(updateTimeLeft, 1000, getElementData(source, "Timeleft"), source)
end
addEventHandler ("roob", getRootElement(), openRampLVSF)
 
function updateTimeLeft(player)
    setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1)
    setTextRobber("Time remaining: [" .. getElementData(player, "Timeleft").. "] :الوقت المتبقي")
    playSoundFrontEnd ( player, 101 )  
    if tonumber(getElementData(player, "Timeleft")) == 0 then
        setPedAnimation (player, false)
        if isTimer(theTimer) and isTimer(theTime)  then
            killTimer(theTimer)
        end
        move()
        theTimer = setTimer(setTextRobber,50, 1 , "" ) 
    if tonumber(getElementData(player, "Marker_destoy")) == 6 then
    setElementData(player, "Marker_destoy", 0)
    makeobject(player)
    textDisplayAddObserver ( RobberDisplay, player )   
    end
    end
end
 
 
function makeobject(plr)
    notrolley = getAttachedElements ( plr )
    for k,v in pairs(notrolley) do
        if getElementType ( v ) == "object" then
            destroyElement ( v )
        end
    end
local x,y,z = getElementPosition ( plr )
object = createObject ( 1550, x, y, z )
if object then
attachElements ( object, plr, 0, -0.4, 0.4 )
--attachElements ( object, plr, -0.1, -0.20, 0.90, 0.000000, 45.000000, 0 )
local x,y,z = getElementPosition(plr)
setElementCollisionsEnabled(object, false)
end
outputChatBox ( "* * * [D] اذهب الى حرف دي الموجود بالخريطة للأخـذ المبلغ  * * * ", plr, 0, 0, 255, true )
outputChatBox ( "* * * Please GO To icon D in The Map To Get Money* * * ", plr, 0, 0, 255, true )
Finsh_Missoin(plr)
end
 
function dd(plr)
notrolley = getAttachedElements ( plr )
    for k,v in pairs(notrolley) do
        if getElementType ( v ) == "object" then
            destroyElement ( v )
        end
    end
end
   
function player_Quit ()
    notrolley = getAttachedElements ( source )
    for k,v in pairs(notrolley) do
        if getElementType ( v ) == "object" then
            destroyElement ( v )
        end
    end
     if tonumber(getElementData(source, "Marker_destoy")) >= 1 then
     
     end
end
addEventHandler ( "onPlayerQuit", getRootElement(), player_Quit )
 
function move()
setTimer (moveObject, 2500, 1, roobB, 1000, 308.10000610352, 2516.3999023438, 17.5) 
end    
 
local Doorentry = createMarker(598.90692138672, -1245.0686035156, 18.253646850586, "cylinder", 1.5, 255, 0, 0, 255 )
 
function Doore ( player )
    if ( source == Doorentry ) then
        if ( getElementType ( player ) == "player" ) then
            fadeCamera ( player, false, 1, 0, 0, 0 )
            setTimer (
                function ( player )
                    if ( player and isElement ( player ) ) then
                        fadeCamera ( player, true, 1 )
                        setElementPosition ( player, 316.66882324219, 2509.2736816406, 29.418315887451)
                    end
                end
                ,1000, 1, player
            )
            --[[
            local Team = getPlayerTeam ( player )
            if ( Team == getTeamFromName ( "Police" ) ) then
            else
                setPlayerTeam ( player, getTeamFromName ( "Robber" ) )
                textDisplayAddObserver ( RobberDisplay, player )               
            end 
            --]]
        end
    end
end
addEventHandler ( "onMarkerHit", getRootElement(), Doore )
 
-- 390.7548828125, 173.8486328125, 1008.3828125
 
local Exitdoor = createMarker( 319.14627075195, 2509.6701660156, 28.418315887451, "cylinder", 1.5, 255, 0, 0, 255 )
 
function Exitd( player )
    if (source == Exitdoor) then
        if getElementType(player) == "player" then
            fadeCamera ( player, false, 1, 0, 0, 0 )
            textDisplayRemoveObserver ( RobberDisplay, player )        
            setTimer ( fadeCamera, 1000, 1, player, true, 1 )
            setTimer ( setElementPosition, 1000, 1, player, 594.21179199219, -1248.2237548828, 18.187507629395)
        end
    end
end 
addEventHandler ("onMarkerHit", getRootElement() ,Exitd )
 
function close()
setTimer (moveObject, 500, 1, roobB, 1000, 306.10000610352, 2516, 17.299999237061) 
end
 
function startRobber ()
    if isTimer(TimerStart["timer"]) then killTimer(TimerStart["timer"]) end --kill timee
    --TimerStop["timer"] =  setTimer ( stop_Roob, robbertimeStop,1) -- time stop
    if marker then
    destroyElement ( marker )   
    end
    close() 
    marker = createMarker ( 306.18820, 2514.06616, 17.03035, "cylinder", 3, 0, 0, 0, 0 )
    addEventHandler("onMarkerHit", marker,onHit)   
end
 
function AllowUseFunctionRoob()
    bindRoob = 1
end
 
function onHit(hitter)
    if bindRoob == 1 then
    if ( hitter and getElementType(hitter) == "player" ) then
    outputChatBox ( "* * * [Tab] اضغط تاب لسرقة البنك * * * ", hitter, 0, 0, 255, true )
    outputChatBox ( "* * * Press [Tab] To Steal Bank  * * * ", hitter, 0, 0, 255, true )   
        bind_key( hitter )
        bindRoob = 0     
        setTimer(AllowUseFunctionRoob, 30000, 1)   
    end
    end
end
 
 
function bind_key ( player )
    bindKey ( player, "Tab", "down", "open_dooor" )
end
 
function unbind_key ( player )
    unbindKey ( player, "Tab", "down", "open_dooor" )
end
 
function updateTimeLeftDoor(player)
    setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1)
    setTextRobber("Will try to open the door:[" .. getElementData(player, "Timeleft").. "] :سيتم محاولة فتح الباب")
    playSoundFrontEnd ( player, 101 )  
    if tonumber(getElementData(player, "Timeleft")) == 0 then
        setElementData(player, "Timeleft", 0)      
        if isTimer(theTimer) and isTimer(theTime)  then
            killTimer(theTimer)
        end
        move()
        triggerClientEvent(player,"Make_Marker",root)      
        outputChatBox ( "* * * #C0C0C0[ إذهب للدوائر لسرقة البنك ]  * * * ", player, 255, 255, 255, true )    
        theTimer = setTimer(setTextRobber,50, 1 , "" )
        if isTimer(TimerStop["timer"]) then killTimer(TimerStop["timer"]) end --kill timee
        TimerStop["timer"] =  setTimer ( stop_Roob, robbertimeStop,1) -- time stop     
    end
end
 
function key_bind (player)
if marker then
removeEventHandler("onMarkerHit", marker,onHit)
destroyElement ( marker )
end
triggerClientEvent(root,"roob_bank",root)
outputChatBox ( "* * * * * * * * * * * * * * *", root, 255, 000, 000, true )
outputChatBox ( "#C0C0C0 يقوم بسرقه البنك [" .. getPlayerName(player) .. "] #C0C0C0 اللاعب", root, 255, 000, 000, true )
outputChatBox ( "#C0C0C0 Player [" .. getPlayerName(player) .. "]#C0C0C0  steals the bank", root, 255, 000, 000, true )
outputChatBox ( "* * * * * * * * * * * * * * *", root, 255, 000, 000, true )
setElementData(player, "MiissoinStart", true)
textDisplayAddObserver ( RobberDisplay, player )
setElementData(player, "Timeleft", 10)
setPlayerWantedLevel ( player, 6 )
setTimer(updateTimeLeftDoor, 1000, getElementData(player, "Timeleft"), player)
end
 
addEventHandler("onPlayerWasted", root,
    function()
    local missin = getElementData(source, "MiissoinStart")
    if missin then
    notrolley = getAttachedElements ( source )
    for k,v in pairs(notrolley) do
        if getElementType ( v ) == "object" then
            destroyElement ( v )
        end
    end
    textDisplayRemoveObserver ( RobberDisplay, source )
    if dropMarker and dropBlip then
    destroyElement ( dropMarker )
    destroyElement ( dropBlip )
    end
    removeEventHandler("onMarkerHit",dropMarker,onDrop) 
    local x,y,z = getElementPosition ( source )
    object_wast = createObject ( 1550, x, y, z )       
    marker_wast = createMarker ( x, y, z, "cylinder", 3, 0, 0, 0, 0 )   
    addEventHandler("onMarkerHit", marker_wast,onHiter) 
    setElementData(source, "MiissoinStart", false) 
        end
    end
)
 
function onHiter(hitter)
    if ( hitter and getElementType(hitter) == "player" ) then
        removeEventHandler("onMarkerHit",dropMarker,onDrop)
        destroyElement ( source )      
        wasted(hitter,true) 
   
Link to comment
ممكن طلب تحددولي الشطر الي فيه مدة بدأ مهمة السرق هي تبدأ كل 3 دقايق ابغاها كل 10 وأبغى اعرف السطر كم
TimerStart = {} 
TimerStop = {}
AllTable = {}
 
rRoot = getResourceRootElement(getThisResource())
r,g,b = 255,0,0 -- اللون
posX,posY = 0.2, 0.5 -- المكان على الشاشة
size = 2.0 -- الحجم
robbertimerStart = 3
robbertimerstop = 15
 
robbertime = robbertimerStart * 60 * 1000
robbertimeStop = robbertimerstop * 60 * 1000
 
function createTeamsOnStart ()
    outputChatBox ( "* * * تم تشغيل مود سرقة البنك ستبدأ المهمه بعد 3 دقائق * * * ", hitter, 0, 0, 255, true )
    TimerStart["timer"] = setTimer ( start_Roob, robbertime,1) ---time on start
    roobB = createObject (2634, 308.10000610352, 2516.3999023438, 17.5, 0, 0, 186) 
    for i,player in ipairs(getElementsByType("player")) do
    setElementData(player, "Marker_destoy", 0)
        setElementData(player, "MiissoinStart", false) 
    end
    AllowUseFunctionRoob() 
end
addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart)
 
addEvent ("roob", true)
function openRampLVSF ()
    setElementData( source, "Marker_destoy", tonumber( getElementData( source, "Marker_destoy" ) or 0 ) + 1 )
    textDisplayAddObserver ( RobberDisplay, source )
    setElementData(source, "Timeleft", 10)
    setPedAnimation (source, "ROB_BANK", "CAT_Safe_Rob" )
    setTimer(updateTimeLeft, 1000, getElementData(source, "Timeleft"), source)
end
addEventHandler ("roob", getRootElement(), openRampLVSF)
 
function updateTimeLeft(player)
    setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1)
    setTextRobber("Time remaining: [" .. getElementData(player, "Timeleft").. "] :الوقت المتبقي")
    playSoundFrontEnd ( player, 101 )  
    if tonumber(getElementData(player, "Timeleft")) == 0 then
        setPedAnimation (player, false)
        if isTimer(theTimer) and isTimer(theTime)  then
            killTimer(theTimer)
        end
        move()
        theTimer = setTimer(setTextRobber,50, 1 , "" ) 
    if tonumber(getElementData(player, "Marker_destoy")) == 6 then
    setElementData(player, "Marker_destoy", 0)
    makeobject(player)
    textDisplayAddObserver ( RobberDisplay, player )   
    end
    end
end
 
 
function makeobject(plr)
    notrolley = getAttachedElements ( plr )
    for k,v in pairs(notrolley) do
        if getElementType ( v ) == "object" then
            destroyElement ( v )
        end
    end
local x,y,z = getElementPosition ( plr )
object = createObject ( 1550, x, y, z )
if object then
attachElements ( object, plr, 0, -0.4, 0.4 )
--attachElements ( object, plr, -0.1, -0.20, 0.90, 0.000000, 45.000000, 0 )
local x,y,z = getElementPosition(plr)
setElementCollisionsEnabled(object, false)
end
outputChatBox ( "* * * [D] اذهب الى حرف دي الموجود بالخريطة للأخـذ المبلغ  * * * ", plr, 0, 0, 255, true )
outputChatBox ( "* * * Please GO To icon D in The Map To Get Money* * * ", plr, 0, 0, 255, true )
Finsh_Missoin(plr)
end
 
function dd(plr)
notrolley = getAttachedElements ( plr )
    for k,v in pairs(notrolley) do
        if getElementType ( v ) == "object" then
            destroyElement ( v )
        end
    end
end
   
function player_Quit ()
    notrolley = getAttachedElements ( source )
    for k,v in pairs(notrolley) do
        if getElementType ( v ) == "object" then
            destroyElement ( v )
        end
    end
     if tonumber(getElementData(source, "Marker_destoy")) >= 1 then
     
     end
end
addEventHandler ( "onPlayerQuit", getRootElement(), player_Quit )
 
function move()
setTimer (moveObject, 2500, 1, roobB, 1000, 308.10000610352, 2516.3999023438, 17.5) 
end    
 
local Doorentry = createMarker(598.90692138672, -1245.0686035156, 18.253646850586, "cylinder", 1.5, 255, 0, 0, 255 )
 
function Doore ( player )
    if ( source == Doorentry ) then
        if ( getElementType ( player ) == "player" ) then
            fadeCamera ( player, false, 1, 0, 0, 0 )
            setTimer (
                function ( player )
                    if ( player and isElement ( player ) ) then
                        fadeCamera ( player, true, 1 )
                        setElementPosition ( player, 316.66882324219, 2509.2736816406, 29.418315887451)
                    end
                end
                ,1000, 1, player
            )
            --[[
            local Team = getPlayerTeam ( player )
            if ( Team == getTeamFromName ( "Police" ) ) then
            else
                setPlayerTeam ( player, getTeamFromName ( "Robber" ) )
                textDisplayAddObserver ( RobberDisplay, player )               
            end 
            --]]
        end
    end
end
addEventHandler ( "onMarkerHit", getRootElement(), Doore )
 
-- 390.7548828125, 173.8486328125, 1008.3828125
 
local Exitdoor = createMarker( 319.14627075195, 2509.6701660156, 28.418315887451, "cylinder", 1.5, 255, 0, 0, 255 )
 
function Exitd( player )
    if (source == Exitdoor) then
        if getElementType(player) == "player" then
            fadeCamera ( player, false, 1, 0, 0, 0 )
            textDisplayRemoveObserver ( RobberDisplay, player )        
            setTimer ( fadeCamera, 1000, 1, player, true, 1 )
            setTimer ( setElementPosition, 1000, 1, player, 594.21179199219, -1248.2237548828, 18.187507629395)
        end
    end
end 
addEventHandler ("onMarkerHit", getRootElement() ,Exitd )
 
function close()
setTimer (moveObject, 500, 1, roobB, 1000, 306.10000610352, 2516, 17.299999237061) 
end
 
function startRobber ()
    if isTimer(TimerStart["timer"]) then killTimer(TimerStart["timer"]) end --kill timee
    --TimerStop["timer"] =  setTimer ( stop_Roob, robbertimeStop,1) -- time stop
    if marker then
    destroyElement ( marker )   
    end
    close() 
    marker = createMarker ( 306.18820, 2514.06616, 17.03035, "cylinder", 3, 0, 0, 0, 0 )
    addEventHandler("onMarkerHit", marker,onHit)   
end
 
function AllowUseFunctionRoob()
    bindRoob = 1
end
 
function onHit(hitter)
    if bindRoob == 1 then
    if ( hitter and getElementType(hitter) == "player" ) then
    outputChatBox ( "* * * [Tab] اضغط تاب لسرقة البنك * * * ", hitter, 0, 0, 255, true )
    outputChatBox ( "* * * Press [Tab] To Steal Bank  * * * ", hitter, 0, 0, 255, true )   
        bind_key( hitter )
        bindRoob = 0     
        setTimer(AllowUseFunctionRoob, 30000, 1)   
    end
    end
end
 
 
function bind_key ( player )
    bindKey ( player, "Tab", "down", "open_dooor" )
end
 
function unbind_key ( player )
    unbindKey ( player, "Tab", "down", "open_dooor" )
end
 
function updateTimeLeftDoor(player)
    setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1)
    setTextRobber("Will try to open the door:[" .. getElementData(player, "Timeleft").. "] :سيتم محاولة فتح الباب")
    playSoundFrontEnd ( player, 101 )  
    if tonumber(getElementData(player, "Timeleft")) == 0 then
        setElementData(player, "Timeleft", 0)      
        if isTimer(theTimer) and isTimer(theTime)  then
            killTimer(theTimer)
        end
        move()
        triggerClientEvent(player,"Make_Marker",root)      
        outputChatBox ( "* * * #C0C0C0[ إذهب للدوائر لسرقة البنك ]  * * * ", player, 255, 255, 255, true )    
        theTimer = setTimer(setTextRobber,50, 1 , "" )
        if isTimer(TimerStop["timer"]) then killTimer(TimerStop["timer"]) end --kill timee
        TimerStop["timer"] =  setTimer ( stop_Roob, robbertimeStop,1) -- time stop     
    end
end
 
function key_bind (player)
if marker then
removeEventHandler("onMarkerHit", marker,onHit)
destroyElement ( marker )
end
triggerClientEvent(root,"roob_bank",root)
outputChatBox ( "* * * * * * * * * * * * * * *", root, 255, 000, 000, true )
outputChatBox ( "#C0C0C0 يقوم بسرقه البنك [" .. getPlayerName(player) .. "] #C0C0C0 اللاعب", root, 255, 000, 000, true )
outputChatBox ( "#C0C0C0 Player [" .. getPlayerName(player) .. "]#C0C0C0  steals the bank", root, 255, 000, 000, true )
outputChatBox ( "* * * * * * * * * * * * * * *", root, 255, 000, 000, true )
setElementData(player, "MiissoinStart", true)
textDisplayAddObserver ( RobberDisplay, player )
setElementData(player, "Timeleft", 10)
setPlayerWantedLevel ( player, 6 )
setTimer(updateTimeLeftDoor, 1000, getElementData(player, "Timeleft"), player)
end
 
addEventHandler("onPlayerWasted", root,
    function()
    local missin = getElementData(source, "MiissoinStart")
    if missin then
    notrolley = getAttachedElements ( source )
    for k,v in pairs(notrolley) do
        if getElementType ( v ) == "object" then
            destroyElement ( v )
        end
    end
    textDisplayRemoveObserver ( RobberDisplay, source )
    if dropMarker and dropBlip then
    destroyElement ( dropMarker )
    destroyElement ( dropBlip )
    end
    removeEventHandler("onMarkerHit",dropMarker,onDrop) 
    local x,y,z = getElementPosition ( source )
    object_wast = createObject ( 1550, x, y, z )       
    marker_wast = createMarker ( x, y, z, "cylinder", 3, 0, 0, 0, 0 )   
    addEventHandler("onMarkerHit", marker_wast,onHiter) 
    setElementData(source, "MiissoinStart", false) 
        end
    end
)
 
function onHiter(hitter)
    if ( hitter and getElementType(hitter) == "player" ) then
       
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...