XPro Posted July 25, 2015 Share Posted July 25, 2015 (edited) السلا عليكم ابي تكلم بخصوص اعطاء رتبة من الكود aclGroupAddObject لاني لقيتي بالويكي مثال واحد يتعلق بالكومند الي هو ذا function giveAdminRights (playerSource, commandName, accountName) --add the function giveAdminRights and specify its arguments if accountName then --if there was an accountName entered then aclGroupAddObject (aclGetGroup("Admin"), "user."..accountName) --add an ACL object using the form "user.[accountName]" to the ACL group "Admin" outputChatBox ("Account '"..accountName.."' succesfully added to the admin group", playerSource) --output a notification to the player who entered the command that the acocunt was successfully added else --else output an error message and the correct syntax of the command to the player who entered it outputChatBox ("No account name specified.", playerSource) outputChatBox ("Correct syntax: /giveAccountAdminRights [accountName]", playerSource) end end addCommandHandler ("giveAccountAdminRights", giveAdminRights) --add a command "giveAccountAdminRights" and attch the function "giveAdminRights" to it انا حاليا ابي مثال اخر ما يتعلق بالكومند مثلا هذا الكود ما يهم طبيعة الكود المهم السطر7 الي يعطي رتبة addEventHandler ( "onPlayerWasted", root, function ( _, killer , accountName ) if killer then if ( killer ~= source ) then local accountName = getPlayerAccount(killer) if accountName then aclGroupAddObject (aclGetGroup("Moderator"), "user."..accountName) outputChatBox ( "* work", root, 255, 0, 0, true ) else outputChatBox ( "* not Work", root, 255, 0, 0, true ) end end end end ) المشكلة بالكود بضبط في السطر ذاك الدي بق يقول attemp to conactenate local 'accountName' (a userdata value) --- انت لا تشوفو عن طبيعة الكود المنوب لان ذي مو الفكرة المغزى من الكود ما راح اطبقو اتعلم اعطاء رتبة من الكود بس Edited July 25, 2015 by Guest Link to comment
TAPL Posted July 25, 2015 Share Posted July 25, 2015 يجيب المنت الحساب getPlayerAccount فنكشن عشان تجيب اسم الحساب من المنت الحساب getAccountName تحتاج تستخدم الفنكشن Link to comment
XPro Posted July 25, 2015 Author Share Posted July 25, 2015 برو قيمر ما يهم ذيك ذاك خطا مانتبهت افتها بس لما كنت راح اضع الكود هنا + مشكور تابل جاري التجريب 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