Jump to content

Why not working admin skin script?


Turbe$Z

Recommended Posts

addEventHandler ( "onElementModelChange", root, 
	function ( oldModel, newModel ) 
		local account = getPlayerAccount ( source ) 
		local accountName = getAccountName ( account ) 
		if ( newModel == 60 and not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then 
			outputChatBox ( "Bocsi, de ez admin skin. Te nem használhatod! :(", source, r, g, b ) 
			setElementData ( source, oldModel ) 
		end 
	end 
) 

outputChatBox is working fine, but the player can change his skin to 60 O.o no errors/warnings in debugscript :S How to fix this?

Link to comment
  • Moderators

You wanted to use setElementModel instead of setElementData :

addEventHandler ( "onElementModelChange", root, 
	function ( oldModel, newModel ) 
		local account = getPlayerAccount ( source ) 
		local accountName = getAccountName ( account ) 
		if ( newModel == 60 and not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then 
			outputChatBox ( "Bocsi, de ez admin skin. Te nem használhatod! :(", source, r, g, b ) 
			setElementModel ( source, oldModel ) 
		end 
	end 
)

 

Link to comment
2 minutes ago, Citizen said:

You wanted to use setElementModel instead of setElementData :


addEventHandler ( "onElementModelChange", root, 
	function ( oldModel, newModel ) 
		local account = getPlayerAccount ( source ) 
		local accountName = getAccountName ( account ) 
		if ( newModel == 60 and not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then 
			outputChatBox ( "Bocsi, de ez admin skin. Te nem használhatod! :(", source, r, g, b ) 
			setElementModel ( source, oldModel ) 
		end 
	end 
)

 

 i tried this, but still not working :S

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