Jump to content

restriction skin to ACL group


Recommended Posts

  • 2 weeks later...
On 05/03/2019 at 21:14, DarkBeautyDZ said:

yeah so the players who have admin can select the skin , but the other players can't

sorry for the long time

i have a script for you

if the player get the skin of the staff or another group, he die and the skin exit of them.

for example put in AclGetGroup the group of the acl like ("Admin")

function skin ( )
    if ( getElementType ( source ) == "player" ) then
        if ( not isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Put here the group of acl" ) ) ) then
            if ( getElementModel ( source ) == 11 ) then
                killPed ( source )
            end
        end
    end
end
addEventHandler ( "onElementModelChange", root, skin )

 

Edited by R1S1NG
Link to comment
1 hour ago, R1S1NG said:

sorry for the long time

i have a script for you

if the player get the skin of the staff or another group, he die and the skin exit of them.

for example put in AclGetGroup the group of the acl like ("Admin")


function skin ( )
    if ( getElementType ( source ) == "player" ) then
        if ( not isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Put here the group of acl" ) ) ) then
            if ( getElementModel ( source ) == 11 ) then
                killPed ( source )
            end
        end
    end
end
addEventHandler ( "onElementModelChange", root, skin )

 

I think that giving kill in ped is not very efficient, because if he does not have a system that seven a random skin after death would not do anything.

Link to comment
14 minutes ago, Jonas^ said:

I think that giving kill in ped is not very efficient, because if he does not have a system that seven a random skin after death would not do anything.

the player die infinite, it's good to player know for the next time don't get this skin more

function skin ( )
    if ( getElementType ( source ) == "player" ) then
        if ( not isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Put here the group of acl" ) ) ) then
            if ( getElementModel ( source ) == 11 ) then
                killPed ( source )
                setPlayerSkin(playerSource, 0)
            end
        end
    end
end
addEventHandler ( "onElementModelChange", root, skin )

or just setPlayerSkin to any skin id

Edited by R1S1NG
Link to comment
10 hours ago, R1S1NG said:

setPlayerSkin

Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions.

Please use setElementModel instead.

 

 

On 05/03/2019 at 20:14, DarkBeautyDZ said:

the players who have admin can select the skin , but the other players can't

local restrictedModels = {
    [11] = true
}

function skinCheck ( oldModel, newModel )
    if getElementType( source ) == "player" then
         -- check if the new model is in the restricted table.
        if restrictedModels[newModel] then
            -- if not in the acl
            if not isObjectInACLGroup( "user."..getAccountName( getPlayerAccount( source ), aclGetGroup( "Admin" ))) then
                -- revert to the previous skin
                setElementModel( source, oldModel )
            end
        end
    end
end
addEventHandler ( "onElementModelChange", root, skinCheck )

 

Edited by Mr.Loki
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...