Jump to content

طلب فنكشنات توزيع


SycroX

Recommended Posts

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

يجيه فلوس و لما يجي يكتبها تاني يقولو انو كتبها قبل كدا و ما يقدر يكتبها تاني

  
addCommandHandler 
givePlayerMoney 
????? 
  

Link to comment
?كيف يعني

اسوي كومند لما يكتبها

يعطيه فلوس و داتا

و اسوي تحقق لو جا كتبها تاني و معه الداتا ما يعطيه ؟

--------

طيب لو حبيت اسوي توزيع غيرو ؟

اول مايكتب سوي تحقق من الداتا

بعدين عطه داتا لو اخذ الفلوس ذذ

Link to comment

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

وعشان تمسح الداتا استخدم الوظائف التالية

getAccounts -- تجيب جميع الحسابات 
getAccountData -- تحدد الحسابات اللي فيه داتا 
setAccountData -- تمسح الداتا من الحسابات 

Link to comment

شف ذا المثال وتعلم منه

وافضلك تسويها بـ

setAccountData 

getAccountData 

انا سويته لك بالمنت داتا

تفضل سيرفر

ThisAmount = 8000 
  
addCommandHandler("Money", 
  
    function( player ) 
  
    if ( getElementData ( player, "ThisMoney" ) == true ) then 
     
        outputChatBox ("لقد اخذت مسبقا", player, 0, 255, 0 ) 
         
        else 
         
        givePlayerMoney( player , ThisAmount ) 
         
        setElementData ( player , "ThisMoney", true ) 
  
        outputChatBox (" تم اعطاؤك ".. ThisAmount .." تصرفهم بالعافية ", player, 255, 0, 0) 
         
    end 
end     ); 
Link to comment

سويته لك ع السريع ب الاكاونت داتا

-- # Server Side !  
-- # Created By iMr_,Omar  
  
money = 15000 
  
addCommandHandler('gm', function ( plr ) -- gm = give money  
if ( not isGuestAccount ( getPlayerAccount ( plr ) ) ) then  
if ( getAccountData (getPlayerAccount(plr),'MoneyData') ~= true ) then  
givePlayerMoney ( plr , money )  
outputChatBox("* You Have : "..money,plr,255,255,255,true) 
else 
outputChatBox("Can't Use This !",plr,255,255,255,true) 
end 
else 
outputChatBox('Please Login !',plr,255,255,255,true) 
end 
end 
) 
  
addEventHandler('onResourceStop',resourceRoot, function (   ) 
for k,v in ipairs ( getAccounts() ) do  
setAccountData ( v , 'MoneyData' , false ) 
end 
end) 

Link to comment
سويته لك ع السريع ب الاكاونت داتا
-- # Server Side !  
-- # Created By iMr_,Omar  
  
money = 15000 
  
addCommandHandler('gm', function ( plr ) -- gm = give money  
if ( not isGuestAccount ( getPlayerAccount ( plr ) ) ) then  
if ( getAccountData (getPlayerAccount(plr),'MoneyData') ~= true ) then  
givePlayerMoney ( plr , money )  
outputChatBox("* You Have : "..money,plr,255,255,255,true) 
else 
outputChatBox("Can't Use This !",plr,255,255,255,true) 
end 
else 
outputChatBox('Please Login !',plr,255,255,255,true) 
end 
end 
) 
  
addEventHandler('onResourceStop',resourceRoot, function (   ) 
for k,v in ipairs ( getAccounts() ) do  
setAccountData ( v , 'MoneyData' , false ) 
end 
end) 

اخوي عمر انا جربت كودك لو كتب الكوماند اكثر من مره يبقا يعطيه ولو طفيت السكربت وشغلته يبقى يعطيه

المهم تفضل بعد التعديل البسيط على كود عمر

money = 15000 
  
addCommandHandler('gm', function ( plr ) -- gm = give money 
  
    if ( not isGuestAccount ( getPlayerAccount ( plr ) ) ) then 
  
    if ( getAccountData (getPlayerAccount(plr),'MoneyData') ~= true ) then 
  
    givePlayerMoney ( plr , money ) 
  
    outputChatBox("* You Have : "..money,plr,255,255,255,true) 
  
    setAccountData ( getPlayerAccount(plr) , 'MoneyData' , true ) 
  
    else 
  
    outputChatBox("Can't Use This !",plr,255,255,255,true) 
  
    end 
  
    else 
  
    outputChatBox('Please Login !',plr,255,255,255,true) 
  
        end 
    end     ); 
  
addEventHandler('onResourceStop',resourceRoot, function (   ) 
  
for k,v in ipairs ( getAccounts() ) do 
  
setAccountData ( v , 'MoneyData' , true ) 
  
    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...