Jump to content

I have modded skin, but i want only for the admins


Minotaur

Recommended Posts

addEventHandler("onElementModelChange", root, 
function () 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
    setElementModel(source, model_id) 
    else 
    outputChatBox("Only Admin Members can take this skin", 0, 255, 0) 
    cancelEvent() 
end 
end) 

Link to comment

try this.

addEventHandler("onElementModelChange", root, 
function (thePlayer) 
    local account = getPlayerAccount(thePlayer) 
    local accountName = getAccountName(account) 
      if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then 
    setElementModel(thePlayer, 1) 
    else 
    outputChatBox("Only Admin Members can take this skin", 0, 255, 0) 
    cancelEvent() 
end 
end) 

Link to comment

You can use a command, and when the player uses the command you can check to see if the player is in the admin ACL... Here is a function i made a while back that might help you.

function isPlayerInACL(player,acl) 
    local account = getAccountName(getPlayerAccount(player)) 
    if(isObjectInACLGroup("user."..account,aclGetGroup(acl))) then 
        return true 
    else 
        return false 
    end 
end 

Link to comment

I created this i think it would be good but i have one problem: '' expected near 'setElementModel'

    function isPlayerInACL(player,acl) 
     end 
    local account = getAccountName(getPlayerAccount(player)) 
    if (isObjectInACLGroup("user."..account,aclGetGroup(acl))) then 
 end 
        return true 
setElementModel ( thePlayer, 1 ) 
    else 
        outputChatBox("Only Admin Members can take this skin", 0, 255, 0) 
        return false 
     end 
end 

Link to comment

This one , you must type the command /adminskin and you may choose your skin id then if the plaayer is aclgroup "Admin" then he will be given this skin, good luck ;)

function lol ( player, command ) 
   if ( not isObjectInACLGroup( "user."..getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Admin" ) ) ) then return end 
 setElementModel(player, your_skin_id) 
outputChatBox("here is your admin skin", player, 133, 133, 133) 
end 
addCommandHandler ( "adminskin", lol ) 

Link to comment
addEventHandler ( "onElementModelChange", root, 
    function ( oldModel, newModel ) 
        local account = getPlayerAccount ( source ) 
        local accountName = getAccountName ( account ) 
        if ( newModel == 1 and not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then 
            outputChatBox ( "This skin is restricted to the Admin group.", source, 0, 255, 0 ) 
            setElementData ( source, oldModel ) 
        end 
    end 
) 

That'll set the skin back to what he had if he's not in the Admin group and the skin he's trying to use is 1.

Link to comment

Here:

addCommandHandler ( "skin", function ( p ) 
    if ( isPlayerInACL ( p, "Admin" ) ) then 
        setElementModel ( p, 1 ) 
    end 
end ) 
function isPlayerInACL(player,acl) 
    local account = getAccountName(getPlayerAccount(player)) 
    if(isObjectInACLGroup("user."..account,aclGetGroup(acl))) then 
        return true 
    else 
        return false 
    end 
end 

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