Jump to content

طلب بعض الفنشكات :D


#Soking

Recommended Posts

سلام عليكم ورحمه الله ويركاته

بدي فنكشات كالاتي

لو كان في البحر

ومعاه سياره

وفي تيم معين و Data معينه

يعطيه فلوس

وبدي التحقق يكون كل ٣٠ ثانيه باستمرار بدي الفنشكات وانا بحاول اسويه

Link to comment

اها شكرا :D

بس مايعطي فلوسس :oops:

الكود لو تبونه

setTimer ( function() 
if isElementInWater() then 
for i, player in ipairs(getElementsByType("player")) do 
if ( isElement(player) ) then 
if isPedInVehicle(source) then 
if getPlayerTeam(source) ~= getTeamFromName("Fish") then end 
local Fix = math.random(5000,10000) 
setElementData(source, "Money", getElementData(source, "Money")+Fix) 
exports["guimessages"]:outputServer( source,""..Fix.."", 0, 225, 0 ) 
end 
end 
end 
end 
end, 4000,0) 

Link to comment

setTimer( 
    function() 
        for _, Player in ipairs( getElementsByType( "player" ) ) do 
            if ( isPedInVehicle( Player ) and isElementInWater( getPedOccupiedVehicle( Player ) ) and getPlayerTeam( Player ) == ( getTeamFromName( "Fish" ) or nil ) ) then 
                local Money, Resource = math.random( 5000, 10000 ), getResourceFromName( "guimessages" ) 
                setElementData( Player, "Money", getElementData( Player, "Money" ) + Money ) 
                if ( Resource and getResourceState( Resource ) == "running" ) then call( Resource, "outputServer", Player, Money, 0, 225, 0 ) end 
            end 
        end 
    end, 
4000, 0 ) 
Edited by Guest
Link to comment

^

setTimer( 
    function() 
        for _, Player in ipairs( getElementsByType( "player" ) ) do 
            if ( isPedInVehicle( Player ) and isElementInWater( getPedOccupiedVehicle( Player ) ) and getPlayerTeam( Player ) == getTeamFromName( "Fish" ) ) then 
                local Money, Resource = math.random( 5000, 10000 ), getResourceFromName( "guimessages" ) 
                setElementData( Player, "Money", getElementData( Player, "Money" ) + Money ) 
                if ( Resource and getResourceState( Resource ) == "running" ) then call( Resource, "outputServer", Player, Money, 0, 225, 0 ) end 
            end 
        end 
    end, 
4000, 0 ) 
Link to comment

^

setTimer(
    function()
        for _, Player in ipairs( getElementsByType( "player" ) ) do
            if ( isPedInVehicle( Player ) and isElementInWater( getPedOccupiedVehicle( Player ) ) and getPlayerTeam( Player ) == ( getTeamFromName( "Fish" ) or nil ) ) then
                local Money, Resource = math.random( 5000, 10000 ), getResourceFromName( "guimessages" )
                setElementData( Player, "Money", getElementData( Player, "Money" ) + Money )
                if ( Resource and getResourceState( Resource ) == "running" ) then call( Resource, "outputServer", Player, Money, 0, 225, 0 ) end
            end
        end
    end,
4000, 0 )

. توني منتبه لها جاي بصححها إلا أنت رديت ض1 على العموم مشكور على التصحيح

Edited by Guest
Link to comment

numb = 30 -- عدد الثواني 
  
setTimer( 
    function() 
        for _, Player in ipairs( getElementsByType( "player" ) ) do -- لوب على جميع الاعبين عشان تجيبهم كامل 
            if ( isPedInVehicle( Player ) and isElementInWater( getPedOccupiedVehicle( Player ) ) and getPlayerTeam( Player ) == getTeamFromName( "Fish" ) ) then -- هنا تتحقق اذا الاعب في الماء و في سيارة و في تيم اسمه Fish يكمل الحدث 
                local Money, Resource = math.random( 5000, 10000 ), getResourceFromName( "guimessages" ) -- تعريف الفلوس و اسم المود 
                setElementData( Player, "Money", getElementData( Player, "Money" ) + Money ) -- يزيد فلوسه على حسب الي عنده 
                if ( Resource and getResourceState( Resource ) == "running" ) then 
                call ( Resource, "outputServer", Player, Money, 0, 225, 0 ) 
            else 
                outputChatBox ( Money, Player, 0, 255, 0, true ) -- هنا يتحقق اذا الريسورس (guimesssages) شغال ولا لا اذا كان مشغل يضع رسالة منه اذا كنت مو مشغل يطلع كلام شات 
                end 
            end 
        end 
    end, 
numb * 1000, 0 ) -- الصفر يكرر التايمر 
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...