~>XNuTeN Posted August 25, 2014 Share Posted August 25, 2014 السلام عليكم ورحمة الله وبركاته اخباركم يا مزز الزبدة معي كود حفظ الفلوس ابي اخليه يحفظ نك " اسم الاعب" مثلا بس مثلا انا كان نكي NuTeN ابيه ينحفظ لمن اسجل دخولي يصير نكي NuTeN function onPlayerQuit ( ) -- when a player leaves, store his current money amount in his account data local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then -- if the player is logged in local playermoney = getPlayerMoney ( source ) -- get the player money setAccountData ( playeraccount, "piraterpg.money", playermoney ) -- save it in his account end end function onPlayerLogin (_, playeraccount ) -- when a player logins, retrieve his money amount from his account data and set it if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "piraterpg.money" ) -- make sure there was actually a value saved under this key (check if playermoney is not false). -- this will for example not be the case when a player plays the gametype for the first time if ( playermoney ) then setPlayerMoney ( source, playermoney ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) هذا حق الفلوس ابي اخليه حق نكات Link to comment
shwaeki Posted August 25, 2014 Share Posted August 25, 2014 من ذا بيست addEventHandler('onPlayerQuit',root, -- اذا خرج اللاعب function() -- وظيفه local vAcc = getPlayerAccount(source) -- نجيب حسابه if not vAcc or isGuestAccount(vAcc) then return end -- اذا كان مو مسجل الدخول نقفل الوظيفه setAccountData(vAcc,'Name',getPlayerName(source)) -- نسوي داتا لإسمه end -- اغلاق ) -- اغلاق addEventHandler('onPlayerLogin',root, -- اذا اللاعب سجل دخوله function(_,acc) -- وظيفه local v_Data = getAccountData(acc,'Name') -- نجيب الداتا if ( v_Data ) then -- تحقق setPlayerName(source,v_Data) -- نعطيه الاسم end -- اغلاق end -- اغلاق ) -- اغلاق Link to comment
AboShanab Posted August 25, 2014 Share Posted August 25, 2014 addEventHandler ( "onPlayerLogin", root, function ( _, acc ) if ( getAccountData ( acc, "oldPlayerNick" ) ) then if ( getPlayerName ( source ) ~= getAccountData ( acc, "oldPlayerNick" ) ) then setPlayerName ( source, getAccountData ( acc, "oldPlayerNick" ) ) end else setAccountData ( acc, "oldPlayerNick", getPlayerName ( source ) ) end end) Link to comment
~>XNuTeN Posted August 25, 2014 Author Share Posted August 25, 2014 من ذا بيست addEventHandler('onPlayerQuit',root, -- اذا خرج اللاعب function() -- وظيفه local vAcc = getPlayerAccount(source) -- نجيب حسابه if not vAcc or isGuestAccount(vAcc) then return end -- اذا كان مو مسجل الدخول نقفل الوظيفه setAccountData(vAcc,'Name',getPlayerName(source)) -- نسوي داتا لإسمه end -- اغلاق ) -- اغلاق addEventHandler('onPlayerLogin',root, -- اذا اللاعب سجل دخوله function(_,acc) -- وظيفه local v_Data = getAccountData(acc,'Name') -- نجيب الداتا if ( v_Data ) then -- تحقق setPlayerName(source,v_Data) -- نعطيه الاسم end -- اغلاق end -- اغلاق ) -- اغلاق شكرا لك يا بعدي ضبط طيب لو ابي اخليه مع التاج كيف اسويه .....!!! المود حق القلاب addEventHandler('onClientGUIClick',guiRoot, function() if ( source == GUIEditor.button[28] ) then setElementData(localPlayer,'nick',getPlayerName(localPlayer)) outputChatBox('* تم إزالة اللقب !',0,255,0,false) elseif ( source == GUIEditor.button[29] ) then setElementData(localPlayer,'nick',guiGetText(GUIEditor.edit[10])) outputChatBox('* تم اعطاك اللقب !',0,255,0,false) elseif ( source == GUIEditor.edit[10] ) then guiSetText(GUIEditor.edit[10],'') end end ) Link to comment
~>XNuTeN Posted August 25, 2014 Author Share Posted August 25, 2014 يعني يصير التاج كذا addEventHandler('onPlayerChat',root, function() if ( isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(source)),aclGetGroup('Console')) ) then setElementData(source,'rank','#C11B17# [الحلو <~]') end end) Link to comment
shwaeki Posted August 25, 2014 Share Posted August 25, 2014 شوف هاد الموضوع و تعلم منة viewtopic.php?f=164&t=62247 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