Minotaur Posted June 11, 2013 Share Posted June 11, 2013 How to i do the skin only for the admins? Please anybody help me Link to comment
PaiN^ Posted June 11, 2013 Share Posted June 11, 2013 'onElementModelChange' if not isObjectInACLGroup aclGetGroup setElementModel Link to comment
Minotaur Posted June 11, 2013 Author Share Posted June 11, 2013 and write to skin id after set element model? so? i think this is not good 'onElementModelChange' if not isObjectInACLGroup aclGetGroup setElementModel 1 And thank you! Link to comment
Minotaur Posted June 12, 2013 Author Share Posted June 12, 2013 I noob in scripting i hope anobody help me Link to comment
aymeness81 Posted June 12, 2013 Share Posted June 12, 2013 addEventHandler("onElementModelChange", root, function () if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setElementModel(source, model_id) else outputChatBox("Only Admin Members can take this skin", 0, 255, 0) cancelEvent() end end) Link to comment
Minotaur Posted June 12, 2013 Author Share Posted June 12, 2013 My console say:Error skin/skin.lua:3 attempt to concatenate global 'accName' ( a nil value ) what is the problem? Link to comment
aymeness81 Posted June 12, 2013 Share Posted June 12, 2013 try this. addEventHandler("onElementModelChange", root, function (thePlayer) local account = getPlayerAccount(thePlayer) local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then setElementModel(thePlayer, 1) else outputChatBox("Only Admin Members can take this skin", 0, 255, 0) cancelEvent() end end) Link to comment
Minotaur Posted June 12, 2013 Author Share Posted June 12, 2013 Not good 5 problem but i thank you for your help Link to comment
xXMADEXx Posted June 12, 2013 Share Posted June 12, 2013 You can use a command, and when the player uses the command you can check to see if the player is in the admin ACL... Here is a function i made a while back that might help you. function isPlayerInACL(player,acl) local account = getAccountName(getPlayerAccount(player)) if(isObjectInACLGroup("user."..account,aclGetGroup(acl))) then return true else return false end end Link to comment
Minotaur Posted June 12, 2013 Author Share Posted June 12, 2013 I created this i think it would be good but i have one problem: '' expected near 'setElementModel' function isPlayerInACL(player,acl) end local account = getAccountName(getPlayerAccount(player)) if (isObjectInACLGroup("user."..account,aclGetGroup(acl))) then end return true setElementModel ( thePlayer, 1 ) else outputChatBox("Only Admin Members can take this skin", 0, 255, 0) return false end end Link to comment
aymeness81 Posted June 12, 2013 Share Posted June 12, 2013 This one , you must type the command /adminskin and you may choose your skin id then if the plaayer is aclgroup "Admin" then he will be given this skin, good luck function lol ( player, command ) if ( not isObjectInACLGroup( "user."..getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Admin" ) ) ) then return end setElementModel(player, your_skin_id) outputChatBox("here is your admin skin", player, 133, 133, 133) end addCommandHandler ( "adminskin", lol ) Link to comment
Minotaur Posted June 12, 2013 Author Share Posted June 12, 2013 this is good but i have one problem the players can be change this skin themselves for example: im in not logged in type /ss 1 this skin is my Link to comment
aymeness81 Posted June 12, 2013 Share Posted June 12, 2013 You need to be logged in to get yourself in an ACL Group... Link to comment
denny199 Posted June 12, 2013 Share Posted June 12, 2013 You need to change freeroam for that. Link to comment
Minotaur Posted June 12, 2013 Author Share Posted June 12, 2013 I dont understand little more Link to comment
Castillo Posted June 12, 2013 Share Posted June 12, 2013 addEventHandler ( "onElementModelChange", root, function ( oldModel, newModel ) local account = getPlayerAccount ( source ) local accountName = getAccountName ( account ) if ( newModel == 1 and not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then outputChatBox ( "This skin is restricted to the Admin group.", source, 0, 255, 0 ) setElementData ( source, oldModel ) end end ) That'll set the skin back to what he had if he's not in the Admin group and the skin he's trying to use is 1. Link to comment
xXMADEXx Posted June 12, 2013 Share Posted June 12, 2013 Here: addCommandHandler ( "skin", function ( p ) if ( isPlayerInACL ( p, "Admin" ) ) then setElementModel ( p, 1 ) end end ) function isPlayerInACL(player,acl) local account = getAccountName(getPlayerAccount(player)) if(isObjectInACLGroup("user."..account,aclGetGroup(acl))) then return true else return false end end 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