Jump to content

admin


MiniGoveya

Recommended Posts

Well, firstly, you need to create your ACL groups, Admin1, Admin2, etc, and then you can easily script this.

Level10list = "" 
Level9list = "" 
Level8list = "" 
Level7list = "" 
  
function createAdminList() 
    Level10list = "" 
    Level9list = "" 
    Level8list = "" 
    Level7list = "" 
    for k, v in ipairs(getElementsByType("player")) do 
        if not isGuestAccount(getPlayerAccount(v)) then 
            if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin")) then 
                Level10list = Level10list .. " " .. getPlayerName(v) 
            elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin9")) then 
                Level9list = Level9list .. " " .. getPlayerName(v) 
            elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin8")) then 
                Level8list = Level8list .. " " .. getPlayerName(v) 
            elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin7")) then 
                Level7list = Level7list .. " " .. getPlayerName(v) 
            end 
        end 
    end 
end 
  
function adminList(sourcePlayer) 
createAdminList() 
    if (Level10list == "") then 
        outputChatBox("There is no level 10 Admins !", sourcePlayer, 255, 0, 0 ) 
    else 
        outputChatBox("Admins Level 10 : " .. tostring(Level10list), getRootElement (), 255, 255, 0, true) 
    end 
    if (Level9list == "") then 
        outputChatBox("There is no level 9 Admins !", sourcePlayer, 255, 0, 0 ) 
    else 
        outputChatBox("Admins Level 9 : " .. tostring(Level9list), getRootElement (), 255, 255, 0, true) 
    end 
    if (Level8list == "") then 
        outputChatBox("There is no level 8 Admins !", sourcePlayer, 255, 0, 0 ) 
    else 
        outputChatBox("Admins Level 8 : " .. tostring(Level8list), getRootElement (), 255, 255, 0, true) 
    end 
    if (Level7list == "") then 
        outputChatBox("There is no level 7 Admins !", sourcePlayer, 255, 0, 0 ) 
    else 
        outputChatBox("Admins Level 7 : " .. tostring(Level7list), getRootElement (), 255, 255, 0, true) 
    end  
end 
  
function checkCommand ( message, messageType ) 
    if ( messageType == 0 ) then 
        if ( message == "!admins"  ) then 
            setTimer( adminList, 100, 1, source ) 
        end 
    end 
end 
addEventHandler ( "onPlayerChat", getRootElement(), checkCommand ) 

Should work, it is server side.

Link to comment

Oooohh thank you bro!

Hey, shouldn't I delete this things?

  
        "resource.BaseMode" /> 
        "resource.admin" /> 
        "resource.webadmin" /> 
     

Or should I put it on every new acl? let me know because I don't understand that part. 8-)

I ask this because this acl don't have nothing of that:

    "SuperModerator"> 
        "Moderator" /> 
        "SuperModerator" /> 
    

Link to comment

Ok I have this lvl 5, he can push himself or others, so here is the code

function push( playerSource, command ) 
player=getLocalPlayer(playerSource) 
    if isPedInVehicle(player) then 
        local vehicle=getPedOccupiedVehicle(player) 
          x,y,z=getElementVelocity(vehicle) 
             setElementVelocity ( vehicle, x, y, z+0.25)  
       end 
    end 
addCommandHandler ( "push", push ) 

this is the acl of lvl 5

    "Admin5"> 
        "Admin1" />  
        "Admin2" /> 
        "Admin3" /> 
        "Admin4a" /> 
        "Admin4b" /> 
        "Admin4c" /> 
        "Admin5" /> 
    

Link to comment

Hmm then the code would be:

function push( playerSource, command ) 
player=getLocalPlayer(playerSource) 
 if ( hasObjectPermissionTo ( playerSource, "function.Push", true ) ) then 
    if isPedInVehicle(player) then 
        local vehicle=getPedOccupiedVehicle(player) 
          x,y,z=getElementVelocity(vehicle) 
             setElementVelocity ( vehicle, x, y, z+0.25) 
       end 
    end 
end 
addCommandHandler ( "push", push ) 

???

P.S.: I think its clients ide xD

EDIT: I really don't know what to put in "function.Push"

Link to comment
function push( playerSource, command ) 
player=playerSource 
 if ( hasObjectPermissionTo ( playerSource, "command.push", true ) ) then 
    if isPedInVehicle(player) then 
        local vehicle=getPedOccupiedVehicle(player) 
          x,y,z=getElementVelocity(vehicle) 
           setElementVelocity ( vehicle, x, y, z+0.25) 
       end 
    end 
end 
addCommandHandler ( "push", push ) 

Then you can add a new command into the ACL in your desired group.

Also, you have to move it server side ;)

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