TorNix~|nR Posted July 10, 2016 Posted July 10, 2016 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) ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003
Tox Posted July 10, 2016 Posted July 10, 2016 --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)
TorNix~|nR Posted July 10, 2016 Author Posted July 10, 2016 get problem Bad argument @ 'getElementModel' [Expected element at argument 1, got string '94'] ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003
Walid Posted July 10, 2016 Posted July 10, 2016 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) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
TorNix~|nR Posted July 10, 2016 Author Posted July 10, 2016 Thanks walid, works fine ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003
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