Jump to content

Special Skin only for Admins(for selected group)


xTravax

Recommended Posts

addEventHandler ( "onElementModelChange", root, 
    function ( old, new ) 
        if ( getElementType ( source ) == "player" ) then 
            if ( new == 287 ) then 
                if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) ) then 
                    setElementModel ( source, old ) 
                end 
            end 
        end 
    end 
) 

That should set to your old skin if you are not in "Admin" group.

Link to comment

no no man i dont need that

i got script for only skin 287 got godmode

so i want to make that normal players cant use skin 287 when they do /ss 287 dont work for them

but when admin connects and login to server he got automatic skin 287 and then people cant kill him

so i mean that admins when login they got automatically godmode and skin 287 can you do that?

Link to comment
addEventHandler("onClientPlayerDamage", localPlayer, 
function() 
    if getElementModel(source) == 287 then 
        cancelEvent() 
    end 
end) 

That is my script

script.lua (client side in meta)

addEventHandler ( "onElementModelChange", root, 
    function ( old, new ) 
        if ( getElementType ( source ) == "player" ) then 
            if ( new == 287 ) then 
                if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) ) then 
                    setElementModel ( source, old ) 
                end 
            end 
        end 
    end 
) 

This is your script

script2.lua (Server side in meta)

    

This is meta of both scripts

Link to comment
addEventHandler ( "onElementModelChange", root, 
    function ( old, new ) 
        if ( getElementType ( source ) == "player" ) then 
            if ( new == 287 ) then 
                if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) ) then 
                    setTimer ( setElementModel, 100, 1, source, old ) 
                end 
            end 
        end 
    end 
) 

I had to set a timer because it was not working for some weird reason, now it does.

Link to comment
thanks it works now.

EDIT!

man now when other players use /ss 287 they got changing between two skins 287 and cj at 1 milisecond it changes 122112 times that both skins so they cant play,,can you fix this?

EDIT 2 when i do it on myself it works good but on other players doesnt work

Link to comment

ok now i explain

when i im logged off

i do /ss 287 and it changes to army skin and then instantly puts back to cj and all good

but when my friend log outs he do /ss 287 he got instantly army and instantly cj and again instantly army and instantly cj like he binded /ss 278 so its changing that two skins very fast like cj change to army skin like 50 times in second and he cant walk or move and he laggs much

but maybe problem causes i added same script on two godmode scripts

i have this godmode with that skin only for admin on skin 287 and 108

but that shouldnt be a problem but it makes much lagg and etc

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