Jump to content

Question


xeon17

Recommended Posts

Whitch functions should i use to crate a Gang Level script , extample:

Lider , Sub-Lider , Comandant , Member , Guest.

Everyone level have pemmsions , i can manage the pemmsions extample : command /gang kick

if getElementData = Lider then

THE KICK SCRIPT.

I no understand much about getElementData or setElementData or should i use setAccountData etc etc.

Sorry for my bad english , i hope someone understand me '-'

Link to comment

Try with these functions:

  
aclGetGroup(); -- [url=https://wiki.multitheftauto.com/wiki/AclGetGroup]https://wiki.multitheftauto.com/wiki/AclGetGroup[/url] 
aclCreateGroup(); -- [url=https://wiki.multitheftauto.com/wiki/AclCreateGroup]https://wiki.multitheftauto.com/wiki/AclCreateGroup[/url] 
isObjectInACLGroup(); -- [url=https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup]https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup[/url] 
  
-- Example code 
local gangs = {"Lider", "Sub-lider"} 
for i = 1, #gangs do 
    if not aclGetGroup(gangs[i]) then 
        aclCreateGroup(gangs[i]) 
    end 
end 
function example (player, cmd, gcmd) 
    local account = getPlayerAccount(player) 
    if not isGuestAccount(account) then 
        local accountname = getAccountName(account) 
        if isObjectInACLGroup("user." ..accountname, aclGetGroup("Lider")) then -- Check if player's in Lider's acl group (gang) 
            if gcmd == "kick" then 
                -- Player used /gang kick 
            end 
        end 
    end 
end 
addCommandHandler("gang", example) 
  

Edited by Guest
Link to comment

Yes i know it works with ACL , but i thinked something other if is possible.

to Crate extample some Element or Account data , Lider , Sub , Comandant , Member , Guest.

i created allerdy a great Gang System :D extample when player create a gang it give him ElementData or Account data Lider.

Link to comment

[lua] 

addEventHandler("onPlayerWasted", getRootElement(),

function ()

local accName  = getAccountName ( getPlayerAccount ( source ) )

if isObjectInACLGroup ( "user."..accName, aclGetGroup ( "Admin" ), ) then

setAccountData ( getPlayerAccount(source), "example.hh", "Noob")

if getAccountData ( getPlayerAccount(source), "example.hh") == "Noob" then

outputChatBox ("R.I.P; Admin: "..accName.." has died",getRootElement(), 255, 255, 0, false )

end

end

end)[/lua

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