Jump to content

setPlayerMoney


Recommended Posts

-- # Server Side ! 
  
PrestegeTimer = {   } 
  
canGiveM = true 
  
addEventHandler("onPlayerCommand",getRootElement(), 
function ( cmd ) 
        if ( cmd == "giveM" ) then 
            if canGiveM == false then outputChatBox('aze is started', source, 255, 0, 0, false) return end 
            for _,v in next,getElementsByType("player") do 
                givePlayerMoney ( v,2500 ) 
                outputChatBox("* The #1De[4]gle, Has Been Sent 2500 $ To All Players !",v) 
            end 
        elseif ( cmd == "aze" ) then 
if isTimer (  PrestegeTimer[source] ) then killTimer ( PrestegeTimer[source] ) canGiveM = true return end 
            canGiveM = false 
    PrestegeTimer[source] = setTimer ( 
        function ( source ) 
        for _,v in next,getElementsByType ( "player" ) do 
            givePlayerMoney ( v,2500 ) 
            outputChatBox("* The Server Has Been Sent 2500 $ To All Players !",v) 
        end 
    end,600000,0,v 
    ) 
    end 
end 
) 

Link to comment

اذا ما ضبط كود كينق عبادي جرب

ملاحظة: كود ملك لبرستيجج

-- # Server Side ! 
  
  
  
PrestegeTimer = {   } 
  
  
  
  
  
addEventHandler("onPlayerCommand",getRootElement(), 
  
function ( cmd ) 
  
        if ( cmd == "giveM" ) then 
  
            if getElementData(source,"CanSend") == false then return end 
  
setElementData(source,"CanSend",true) 
            for _,v in next,getElementsByType("player") do 
  
                givePlayerMoney ( v,2500 ) 
  
                outputChatBox("* The #1De[4]gle, Has Been Sent 2500 $ To All Players !",v) 
  
            end 
  
        elseif ( cmd == "aze" ) then 
  
if isTimer (  PrestegeTimer[source] ) then killTimer ( PrestegeTimer[source] ) end 
if getElementData(source,"CanSend" == true return end 
  
            setElementData(source,"CanSend",false) 
  
    PrestegeTimer[source] = setTimer ( 
  
        function ( source ) 
  
        for _,v in next,getElementsByType ( "player" ) do 
  
            givePlayerMoney ( v,2500 ) 
  
            outputChatBox("* The Server Has Been Sent 2500 $ To All Players !",v) 
  
        end 
  
    end,600000,0,v 
  
    ) 
  
    end 
  
end 
  
) 

^يلحس شوي^ :roll:

Link to comment

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

رح يسوي تايمرات كثيرة مرة .. وممكن يصير كل دقايق يوزع فلوس .. يعني التايمر ما رح يضل كل ساعة .. لأنه يصير أكثر من تايمر .. ومختلفة بأوقاتها .. لأنه الأخ برستيج مسوي جدول .. ولكل لاعب تايمر خاص فيه ..

لازم يلغي الجدول ويسوي تايمر للكل .. ولما أحد يسوي الكوماند إذا كان التايمر شغال يسوي كيل تايمر أو ريتيرن وبس #

Link to comment

جرب

addCommandHandler('aze', function( playerSource ) 
if isTimer( sendAll ) then  
killTimer( sendAll ) 
outputChatBox('تم ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) 
return end 
sendAll = setTimer( function() 
for i,v in ipairs ( getElementsByType( 'plyaer' ) ) do 
givePlayerMoney( v, 2500 ) 
outputChatBox("* The #1De[4]gle, Has Been Sent 2500 $ To All Players !", root, 0, 255, 0, false) 
end 
end,600000,0,v 
) 
  
addCommandHandler('giveM', function( playerSource ) 
if isTimer( sendAll ) then outputChatBox('يجب ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) return end 
for i,v in ipairs ( getElementsByType( 'plyaer' ) ) do 
givePlayerMoney( v, 2500 ) 
end 
end 
) 

تشغل التوزيع التلقائي واذا كتبتها مره ثانية تطفيه aze

Link to comment
-- # Server Side ! 
  
PrestegeTimer = {   } 
  
  
addEventHandler("onPlayerCommand",getRootElement(), 
function ( cmd ) 
        if ( cmd == "giveM" ) then 
            if getElementData(source,"CanSend") == false then return end 
            for _,v in next,getElementsByType("player") do 
                givePlayerMoney ( v,2500 ) 
                outputChatBox("* The #1De[4]gle, Has Been Sent 2500 $ To All Players !",v) 
            end 
        elseif ( cmd == "aze" ) then 
if isTimer (  PrestegeTimer[source] ) then killTimer ( PrestegeTimer[source] ) setElementData(source,"CanSend",true) return end 
            setElementData(source,"CanSend",false) 
    PrestegeTimer[source] = setTimer ( 
        function ( source ) 
        for _,v in next,getElementsByType ( "player" ) do 
            givePlayerMoney ( v,2500 ) 
            outputChatBox("* The Server Has Been Sent 2500 $ To All Players !",v) 
        end 
    end,600000,0,v 
    ) 
    end 
end 
) 

root أخي برستيج .. الحين بسطر 10 ليه تجيب كل اللاعبين من الجدول ورجة ؟ ليه ما تستخدم

وبسطر 19 مسوي نفس الشي ؟ جايب اللاعبين من الجدول ؟

+ بالفنكشن حق التايمر .. دام ما تبي تستخدمها ؟ source بسطر رقم 18 ليه معرف

+ أقدر أعرف الفايدة منه ؟ "v"بنهاية التايمر حاط أرقمنت زيادة بسطر رقم 23 إلي هو

------------------

جرب
addCommandHandler('aze', function( playerSource ) 
if isTimer( sendAll ) then  
killTimer( sendAll ) 
outputChatBox('تم ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) 
return end 
sendAll = setTimer( function() 
for i,v in ipairs ( getElementsByType( 'plyaer' ) ) do 
givePlayerMoney( v, 2500 ) 
outputChatBox("* The #1De[4]gle, Has Been Sent 2500 $ To All Players !", root, 0, 255, 0, false) 
end 
end,600000,0,v 
) 
  
addCommandHandler('giveM', function( playerSource ) 
if isTimer( sendAll ) then outputChatBox('يجب ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) return end 
for i,v in ipairs ( getElementsByType( 'plyaer' ) ) do 
givePlayerMoney( v, 2500 ) 
end 
end 
) 

تشغل التوزيع التلقائي واذا كتبتها مره ثانية تطفيه aze

؟ root طريقتكـ صحيحة لكن بسطر 7 + 16 ليه جايب كل اللاعبين من الجدول ؟ ليه ما تستخدم

Link to comment
جرب
addCommandHandler('aze', function( playerSource ) 
if isTimer( sendAll ) then  
killTimer( sendAll ) 
outputChatBox('تم ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) 
return end 
sendAll = setTimer( function() 
for i,v in ipairs ( getElementsByType( 'plyaer' ) ) do 
givePlayerMoney( v, 2500 ) 
outputChatBox("* The #1De[4]gle, Has Been Sent 2500 $ To All Players !", root, 0, 255, 0, false) 
end 
end,600000,0,v 
) 
  
addCommandHandler('giveM', function( playerSource ) 
if isTimer( sendAll ) then outputChatBox('يجب ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) return end 
for i,v in ipairs ( getElementsByType( 'plyaer' ) ) do 
givePlayerMoney( v, 2500 ) 
end 
end 
) 

تشغل التوزيع التلقائي واذا كتبتها مره ثانية تطفيه aze

عبادي كودك غلط التصحيح

  
addCommandHandler('aze', function( playerSource ) 
if isTimer( sendAll ) then  
killTimer( sendAll ) 
outputChatBox('تم ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) 
return end 
sendAll = setTimer( function() 
for i,v in ipairs ( getElementsByType( 'player' ) ) do 
givePlayerMoney( v, 2500 ) 
outputChatBox("* The #1De[4]gle, Has Been Sent 2500 $ To All Players !", root, 0, 255, 0, false) 
end 
end,600000,0,v 
) 
  
addCommandHandler('giveM', function( playerSource ) 
if isTimer( sendAll ) then outputChatBox('يجب ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) return end 
for i,v in ipairs ( getElementsByType( 'player' ) ) do 
givePlayerMoney( v, 2500 ) 
end 
end 
) 
  

Link to comment

 

؟ root طريقتكـ صحيحة لكن بسطر 7 + 16 ليه جايب كل اللاعبين من الجدول ؟ ليه ما تستخدم

انا متعود استخدم طريقة الجدول

وماتوقع في فرق ؟

rootأدري إنه مافي فرق بس أقصد بدل ما تمر على كل اللاعبين من الجدول تقدر تختصر بـ

يعني بدل ما تسوي كذا

for _, v in ipairs ( getElementsByType ( 'plyaer' ) ) do 
    givePlayerMoney ( v, 2500 ) 
    outputChatBox ( "* The #1De[4]gle, Has Been Sent 2500 $ To All Players !", v, 0, 255, 0, true ) 
end 

تسوي كذا ..

givePlayerMoney ( root, 2500 ) 
outputChatBox ( "* The #1De[4]gle, Has Been Sent 2500 $ To All Players !", root, 0, 255, 0, true ) 

+ أقدر أعرف الفايدة منه ؟ "v" ليه حاط أرقمنت زيادة بسطر 11 بنهاية التايمر إلي هو

-----------------

جرب
addCommandHandler('aze', function( playerSource ) 
if isTimer( sendAll ) then  
killTimer( sendAll ) 
outputChatBox('تم ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) 
return end 
sendAll = setTimer( function() 
for i,v in ipairs ( getElementsByType( 'plyaer' ) ) do 
givePlayerMoney( v, 2500 ) 
outputChatBox("* The #1De[4]gle, Has Been Sent 2500 $ To All Players !", root, 0, 255, 0, false) 
end 
end,600000,0,v 
) 
  
addCommandHandler('giveM', function( playerSource ) 
if isTimer( sendAll ) then outputChatBox('يجب ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) return end 
for i,v in ipairs ( getElementsByType( 'plyaer' ) ) do 
givePlayerMoney( v, 2500 ) 
end 
end 
) 

تشغل التوزيع التلقائي واذا كتبتها مره ثانية تطفيه aze

عبادي كودك غلط التصحيح

  
addCommandHandler('aze', function( playerSource ) 
if isTimer( sendAll ) then  
killTimer( sendAll ) 
outputChatBox('تم ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) 
return end 
sendAll = setTimer( function() 
for i,v in ipairs ( getElementsByType( 'player' ) ) do 
givePlayerMoney( v, 2500 ) 
outputChatBox("* The #1De[4]gle, Has Been Sent 2500 $ To All Players !", root, 0, 255, 0, false) 
end 
end,600000,0,v 
) 
  
addCommandHandler('giveM', function( playerSource ) 
if isTimer( sendAll ) then outputChatBox('يجب ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) return end 
for i,v in ipairs ( getElementsByType( 'player' ) ) do 
givePlayerMoney( v, 2500 ) 
end 
end 
) 
  

تقدر تقول لنا إيش الغلط يَ بطل؟ لأنه ماشوف فيه فرق بين كودكـ وكود عبادي خخ ..

Link to comment
time = nil 
  
addCommandHandler("aze", 
    function (player) 
        if isTimer(time) then 
            killTimer(time) 
            time = nil 
            outputChatBox("** The Giving Stoped !!",player,255,0,0) 
        else 
            time = setTimer(function () 
                for _,ply in ipairs(getElementsByType("player")) do 
                    givePlayerMoney(ply,2500) 
                    outputChatBox("** The Admin Has Sent 2500$ To All Players !",ply,0,255,0) 
                end 
            end,600000,0) 
        end 
    end 
) 
  
addCommandHandler("giveM", 
    function (player) 
        if isTimer(time) then 
            outputChatBox("** You Can't Send Now",player,255,0,0) 
        else 
            for _,pl in ipairs(getElementsByType("player")) do 
                givePlayerMoney(pl,2500) 
                outputChatBox("** The Admin Has Sent 2500$ To All Players !",pl,0,255,0) 
            end 
        end 
    end 
) 
  

المساعده رقم 600 ض2

Link to comment
جرب

addCommandHandler('aze', function( playerSource ) 
if isTimer( sendAll ) then  
killTimer( sendAll ) 
outputChatBox('تم ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) 
return end 
sendAll = setTimer( function() 
for i,v in ipairs ( getElementsByType( 'plyaer' ) ) do 
givePlayerMoney( v, 2500 ) 
outputChatBox("* The #1De[4]gle, Has Been Sent 2500 $ To All Players !", root, 0, 255, 0, false) 
end 
end,600000,0,v 
) 
  
addCommandHandler('giveM', function( playerSource ) 
if isTimer( sendAll ) then outputChatBox('يجب ايقاف التوزيع التلقائي', playerSource, 255, 255, 0, false) return end 
for i,v in ipairs ( getElementsByType( 'plyaer' ) ) do 
givePlayerMoney( v, 2500 ) 
end 
end 
) 

تشغل التوزيع التلقائي واذا كتبتها مره ثانية تطفيه aze

الغغلط = plyaer

التصحيح = player

^_^

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...