Jump to content

Give skin


Recommended Posts

hi everyone, this is the last thing in my admin panel, thanks for helping, I have admin panel of give skin, I need to disable some skins, my code get problem, anyone help :| ?

     --Set Skin 
local inValidSkins = {["94"] = true} -- replace teamName with the team you want 
  
addEvent("AdminPanel.setSkin", true) 
    function setSkin(plr, getText) 
        if plr and isElement(plr) then 
            if getText then 
                local skin = getElementModel(getText) 
                if not skin then 
                    skin = getText 
                end 
                if inValidSkins[getElementModel(skin)] then -- you can use getElementModel or simply replace it with getText 
                    outputChatBox("#00FF00Este team es solo para #FF0000[ADM]#00FF00 o#FF0000 [LIDER]", client, r, g, b, true) 
                    return 
                end 
                setElementModel(plr, skin) 
                outputChatBox("#FF0000" ..getPlayerName(client).."#00FF00 Ha combiar su skin a #0B00FF("..getElementModel(skin)..") ", plr, 0, 255, 0, true) 
            outputChatBox("#00FF00Combiar #FF0000"..getPlayerName(plr).."#00FF00 skin a #0B00FF("..getTeamName(skin)..") ", client, 0, 255, 0, true) 
        end 
    end 
end 
addEventHandler("AdminPanel.setSkin", root, setSkin)  

Link to comment
    --Set Skin 
local inValidSkins = {[94] = true} -- replace teamName with the team you want 
  
addEvent("AdminPanel.setSkin", true) 
    function setSkin(plr, getText) 
        if plr and isElement(plr) then 
            if getText then 
                local skin = getElementModel(getText) 
                if not skin then 
                    skin = getText 
                end 
                if inValidSkins[skin] then -- you can use getElementModel or simply replace it with getText 
                    outputChatBox("#00FF00Este team es solo para #FF0000[ADM]#00FF00 o#FF0000 [LIDER]", client, r, g, b, true) 
                    return 
                end 
                setElementModel(plr, skin) 
                outputChatBox("#FF0000" ..getPlayerName(client).."#00FF00 Ha combiar su skin a #0B00FF("..skin..") ", plr, 0, 255, 0, true) 
            outputChatBox("#00FF00Combiar #FF0000"..getPlayerName(plr).."#00FF00 skin a #0B00FF("..skin..") ", client, 0, 255, 0, true) 
        end 
    end 
end 
addEventHandler("AdminPanel.setSkin", root, setSkin) 

Link to comment

  • r,g,b : not defined in your code.
  • you don't need to use getElementModel.

local inValidSkins = {[94] = true}  
  
addEvent("AdminPanel.setSkin", true) 
    function setSkin(plr, getText) 
        if plr and isElement(plr) then 
            if tonumber(getText) then 
                if inValidSkins[tonumber(getText)] then  
                    outputChatBox("#00FF00Este team es solo para #FF0000[ADM]#00FF00 o#FF0000 [LIDER]", client, 255, 0, 0, true) 
                    return 
                end 
                setElementModel(plr, tonumber(getText)) 
                outputChatBox("#FF0000" ..getPlayerName(client).."#00FF00 Ha combiar su skin a #0B00FF("..getText..") ", plr, 0, 255, 0, true) 
            outputChatBox("#00FF00Combiar #FF0000"..getPlayerName(plr).."#00FF00 skin a #0B00FF("..getText..") ", client, 0, 255, 0, true) 
        end 
    end 
end 
addEventHandler("AdminPanel.setSkin", root, setSkin) 

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