Jump to content

[Help] Admin skin restrict


JuAnY

Recommended Posts

Posted

Hi, Im trying to do a resource to restrict players put the skin of an admin, is for "freeroam" gamemode, but this dont work: :roll:

function admskin(thePlayer) 
local account = getPlayerAccount(thePlayer) 
local accountName = getAccountName(account) 
if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then 
    if ( getElementModel ( thePlayer ) == 188 ) then 
        outputChatBox("Skin de admin correcto.",thePlayer,0,255,0) 
    else 
        outputChatBox("ADMIN SIN SKIN.",thePlayer,255,0,0) 
    end 
else 
    if ( getElementModel ( thePlayer ) == 188 ) then 
        outputChatBox("No puedes usar skin de ADMIN.",thePlayer,255,0,0) 
        setElementModel(thePlayer,14) 
    end 
end 
end 
addEventHandler("onElementModelChange",root,admskin) 

I need your help please :o

Posted

The element is the source, not a parameter. The first parameter is the old model.

function admskin(old) 
    if (getElementType(source) ~= 'player') then return end 
local account = getPlayerAccount(source) 
local accountName = getAccountName(account) 
if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then 
    if ( getElementModel ( source ) == 188 ) then 
        outputChatBox("Skin de admin correcto.",source,0,255,0) 
    else 
        outputChatBox("ADMIN SIN SKIN.",source,255,0,0) 
    end 
else 
    if ( getElementModel ( source ) == 188 ) then 
        outputChatBox("No puedes usar skin de ADMIN.",source,255,0,0) 
        setElementModel(source,14) 
    end 
end 
end 
addEventHandler("onElementModelChange",root,admskin) 

Posted

Thanks JR10 for the reply.

Now I get the message at line 13 but dont change the skin, the player still with the admin skin (188).

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