Jump to content

restriction skin to ACL group


Recommended Posts

  • 2 weeks later...
  On 06/03/2019 at 00:14, DarkBeautyDZ said:

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

Expand  

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
  On 15/03/2019 at 01:12, 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 )

 

Expand  

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
  On 15/03/2019 at 02:37, 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.

Expand  

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
  On 15/03/2019 at 02:48, R1S1NG said:

setPlayerSkin

Expand  
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 06/03/2019 at 00:14, DarkBeautyDZ said:

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

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