Jump to content

admin


MiniGoveya

Recommended Posts

Posted

@Citizen

If I write in chatbox !admins there say

Level 1: Citizen

Level 5: proracer

Level 10: MiniGoveya.<3

etc..

@proracer

Thank you :)

Btw, just need that?

Posted

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.

Posted

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" /> 
    

Posted

Sorry for double post,

If I have a script called, "mta.zip" and I want that admins level X can use it I must add on acl of this admin group this line:

        "resource.mta.zip" /> 

???

Posted

yea.. its a command but its in a folder.

EDIT: So it mut be object name="resource.mta" ???

EDIT2: Is there any way to put whole the resources for admin levels on 1 folder? and make it for files instead of millions of folders?

Posted

Lol, of course, every resource can have as many scripts as you want, and you don't need a new folder for every .lua script o,o.

P.S: Show me your "command" script.

Posted

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" /> 
    

Posted

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"

Posted
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 ;)

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