M-d-MR Posted February 22, 2013 Share Posted February 22, 2013 اهلا شباب انا استخدمت givePlayerMoney كيف اخلي الاعطاء على حساب الاعب وبعدها خرج من السيرفر nae متلا شخص سجل بالسيرفر واسم حسابه كيف اعطيه فلوس وهو بخارج السيرفر ؟ Link to comment
iPrestege Posted February 22, 2013 Share Posted February 22, 2013 setAccountData "onPlayerLogin" -- Server Event "onPlayerLogout" -- Server Event givePlayerMoney Link to comment
3NAD Posted February 22, 2013 Share Posted February 22, 2013 اذا انت مسوي حفظ فلوس في الحساب هات اسم الداتا حق الحفظ Link to comment
M-d-MR Posted February 22, 2013 Author Share Posted February 22, 2013 (edited) getAccountData(account,"money") انا اكتب الاسم في guiCreateMemo يعني addEvent ( "setMoney",true) addEventHandler ( "setMoney", getRootElement(), function() givePlayerMoney(source,1000) -- Memoاعطي لاعب بأسم حسابه حتى لو كان مو موجود اسم حساب الاعب احدده في sourceالحين ابي بدال -- Memoالى اسم الحساب الي احدده فيsourceانا مسوي كل شي بس ابي بدل end ) Edited February 22, 2013 by Guest Link to comment
iPrestege Posted February 22, 2013 Share Posted February 22, 2013 اطرح الكود كامل ..# Link to comment
M-d-MR Posted February 22, 2013 Author Share Posted February 22, 2013 اطرح الكود كامل ..# function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount(source))) then local accountData = getAccountData (theCurrentAccount, "money") if (accountData) then local playerMoney = getAccountData(theCurrentAccount, "money") setPlayerMoney(source, playerMoney) else setPlayerMoney(source, 0) end end end addEventHandler("onPlayerLogin", getRootElement(), playerLogin) function onQuit() if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then setAccountData(account,"money", tostring(getPlayerMoney(source))) end end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) Memo = guiCreateMemo(70,10,10,50,"Account Name",false,WND) triggerServerEvent ( "setMoney",localPlayer,guiGetText( Memo )) addEvent ( " setMoney",true) addEventHandler( "setMoney",getRootElement(), function() givePlayerMoney(account,1000) -- اسم الاعب من حسابهaccountابي محل end) Link to comment
3NAD Posted February 22, 2013 Share Posted February 22, 2013 -- Server Side addCommandHandler ( "setMoney", function ( thePlayer, _, toWho, aMoney ) if toWho and aMoney then local theAccount = getAccount ( toWho ) if theAccount then local theMoney = tonumber ( aMoney ) if theMoney and theMoney >= 0 then setAccountData ( theAccount, "money", theMoney ) outputChatBox ( "[setMoney]: Account [ "..getAccountName ( theAccount ).." ] And Money [ $"..theMoney.." ] Done !", thePlayer, 255, 255, 0 , true ) else outputChatBox ( "[setMoney]: Error, Add Real Number !!", thePlayer, 255, 0, 0 , true ) end else outputChatBox ( "[setMoney]: Error, Not Found This Account!!", thePlayer, 255, 0, 0 , true ) end else outputChatBox ( "/setMoney [account] [money]", thePlayer, 150, 150, 0, true ) end end ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now