Jump to content

Group skin txd (shader)


Recommended Posts

Hello friends,

I checked forum topics for how to make  private group skins but  creating private group's skins topics are always unfinished.I'm just trying a simple way.The skin of the "SEALS" group should change when I start the resource.So I used a very simple code, but it had no effect.What can I do about it?Can someone help me ? thanks.

 

function ReplaceSkin(player) 
    if (player and isElement(player) and getElementType(player)) == "player" then 
		if getElementData(player,'Group') == 'Seals' then
        txd = engineLoadTXD ( "SL.txd" ) 
        engineImportTXD ( txd, 181) 
        end 
    end 
end   
addEventHandler("onClientResourceStart",resourceRoot, ReplaceSkin) 

 

Link to comment
addEventHandler ( "onClientResourceStart" , resourceRoot , function ( ) 
engineImportTXD ( engineLoadTXD ( "SL.txd" ) , 181) 
end ) 

addEventHandler ( "onClientElementModelChange", root , function ( old , new ) 
if ( getElementType ( source ) == "player" and new == 181 and getElementData ( source , "Group" ) ~= "Seals" ) then 
setTimer(setElementModel,500,1,source,old)
outputChatBox("* you can't use the skin",255,0,0,true)
end
end ) ; 

 

Link to comment

thanks for helping.I put a ped of 181 id on my local server right now and his skin changes with your codes friend.only those with the "seals" group should change their skin.I left the seals group and I can still use this skin.really ı am stuck on it. :/

Link to comment

Why don't you use the is object in aclgroup function? Create the groups you want on acl and use that function. I'm no programmer myself but i already saw alot of code as i'm a server owner so it's usually that function that is used to those kind of things.

Link to comment
43 minutes ago, SoManyTears said:

thanks for helping.I put a ped of 181 id on my local server right now and his skin changes with your codes friend.only those with the "seals" group should change their skin.I left the seals group and I can still use this skin.really ı am stuck on it. :/

use setElementModel -- 0 when you left from group 

Link to comment
addEventHandler ( "onClientResourceStart" , resourceRoot , function ( ) 
if ( getElementData ( localPlayer , "Group" ) == "Seals" ) then 
engineImportTXD ( engineLoadTXD ( "SL.txd" ) , 181) 
end
end )

addEventHandler ( "onClientElementDataChange" , root , function ( key , _ , new )
if ( getElementType ( source ) == "player" and key == "Group" and new ~= "Seals" ) then 
engineRestoreModel ( 181 )
end
end ) 

addEventHandler ( "onClientElementModelChange", root , function ( old , new ) 
if ( getElementType ( source ) == "player" and new == 181 and getElementData ( source , "Group" ) ~= "Seals" ) then 
setTimer(setElementModel,500,1,source,old)
outputChatBox("* you can't use the skin",255,0,0,true)
end
end ) ; 

try this

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