xTravax Posted November 24, 2012 Share Posted November 24, 2012 Hi i got script that one secret skin got godmode and now i want to make that only admins can use that skin how can i do it? Link to comment
Castillo Posted November 24, 2012 Share Posted November 24, 2012 Which script are you using to set skins? Link to comment
xTravax Posted November 24, 2012 Author Share Posted November 24, 2012 when player spawns it is cj everyone when join in server is cj but heres my script addEventHandler("onClientPlayerDamage", localPlayer, function() if getElementModel(source) == 287 then cancelEvent() end end) Link to comment
Castillo Posted November 24, 2012 Share Posted November 24, 2012 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
xTravax Posted November 24, 2012 Author Share Posted November 24, 2012 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
Castillo Posted November 24, 2012 Share Posted November 24, 2012 The script I posted will prevent them from having skin 287, because when they do "/ss 287" it'll change it back to the skin he had when used the command. About giving skin, you must use: onPlayerLogin isObjectInACLGroup aclGetGroup setElementModel Link to comment
xTravax Posted November 24, 2012 Author Share Posted November 24, 2012 i putted your and my script together so script.lua script2.lua <-- your script and in meta i tried server and client side and it didnt work Link to comment
Castillo Posted November 24, 2012 Share Posted November 24, 2012 Post your whole script. P.S: Is a server side script. 1 Link to comment
xTravax Posted November 24, 2012 Author Share Posted November 24, 2012 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
Castillo Posted November 24, 2012 Share Posted November 24, 2012 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
xTravax Posted November 24, 2012 Author Share Posted November 24, 2012 thanks it works now. Link to comment
xTravax Posted November 24, 2012 Author Share Posted November 24, 2012 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
Castillo Posted November 24, 2012 Share Posted November 24, 2012 I don't understand what do you mean. Link to comment
xTravax Posted November 24, 2012 Author Share Posted November 24, 2012 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
Castillo Posted November 24, 2012 Share Posted November 24, 2012 That doesn't make any sense, the timer will only change it once. Link to comment
xTravax Posted November 24, 2012 Author Share Posted November 24, 2012 well i dont understand then what to do Link to comment
Castillo Posted November 24, 2012 Share Posted November 24, 2012 What you can do is just don't let them change the skin when they use the command, but you'll need to edit the freeroam script. Link to comment
xTravax Posted November 24, 2012 Author Share Posted November 24, 2012 okey thanks! again 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