SoManyTears Posted May 15, 2020 Share Posted May 15, 2020 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
-Ilker. Posted May 15, 2020 Share Posted May 15, 2020 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
SoManyTears Posted May 15, 2020 Author Share Posted May 15, 2020 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
Gribixtugaz Posted May 15, 2020 Share Posted May 15, 2020 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
-Ilker. Posted May 15, 2020 Share Posted May 15, 2020 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
SoManyTears Posted May 15, 2020 Author Share Posted May 15, 2020 the only problem here is the txd file works for everyone.not just for the "seals" group.If someone who understands me , please help. Link to comment
-Ilker. Posted May 15, 2020 Share Posted May 15, 2020 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now