Jump to content

طلب كود


Recommended Posts

السلا عليكم

ابي تكلم بخصوص اعطاء رتبة من الكود

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