Plate Posted May 27, 2013 Posted May 27, 2013 Hola tengo un problema con este script es que no funciona no tengo idea de por que function checkSkills() local colt = getPedStat ( localPlayer, 69 ) if ( colt >= 40 <= 998 ) then local row = guiGridListAddRow(skillGrid) guiGridListSetItemText(skillGrid, row, 1, "Pistol Skill 3", false, false) elseif (colt < 40 ) then local row = guiGridListAddRow(skillGrid) guiGridListSetItemText(skillGrid, row, 1, "Pistol Skill 2", false, false) local silenced = getPedStat(localPlayer, 70) if ( silenced < 500) then local row = guiGridListAddRow(skillGrid) guiGridListSetItemText(skillGrid, row, 1, "Silenced Skill 2", false, false) elseif ( silenced >= 500 <= 998) then local row = guiGridListAddRow(skillGrid) guiGridListSetItemText(skillGrid, row, 1, "Silenced Skill 3", false, false) end end end addEvent("onClientWeaponShop", true) addEventHandler("onClientWeaponShop", getRootElement(), checkSkills)
Castillo Posted May 27, 2013 Posted May 27, 2013 Si no nos decis cual es el problema exacto, no podemos ayudarte.
Plate Posted May 27, 2013 Author Posted May 27, 2013 (edited) Gracias solid otra duda por que los maxsSlots no funcionan y esto de slots si me aparece function getSlots() local slots = getElementData(localPlayer, "Slots") local maxsSlots = getElementData(localPlayer, "maxSlots") guiSetText(texto, "Inventario Lleno") guiLabelSetColor(texto, 255, 0, 0, 255) guiSetText(usedSlot, " "..slots.."") guiSetText(slots, " /"..maxsSlots.."") end me dice esto Bad Argumento guiSetText[ expected gui-element at argument 1 got number "20" pero 20 son los slots no los max slots Edited May 27, 2013 by Guest
Castillo Posted May 27, 2013 Posted May 27, 2013 No pregunte a que se supone que devuelva, sino que devuelve.
Plate Posted May 27, 2013 Author Posted May 27, 2013 Me duvuelve un numero usando esto function check() local slots = getElementData(localPlayer, "maxSlots") outputChatBox(slots) end addCommandHandler("2", check) pero si uso el otro no sirve
Castillo Posted May 27, 2013 Posted May 27, 2013 function getSlots() local slots = getElementData(localPlayer, "Slots") local maxsSlots = getElementData(localPlayer, "maxSlots") guiSetText(texto, "Inventario Lleno") guiLabelSetColor(texto, 255, 0, 0, 255) guiSetText(usedSlot, " "..slots.."") guiSetText(slots, " /"..maxsSlots.."") end "slots" es un numero y lo estas usando como elemento, supongo que ya tendras una label o algo llamado "slots", pero si definis otra variable con el mismo nombre, no servira.
Plate Posted May 27, 2013 Author Posted May 27, 2013 function getSlots() local slots = getElementData(localPlayer, "Slots") local maxsSlots = getElementData(localPlayer, "maxSlots") guiSetText(texto, "Inventario Lleno") guiLabelSetColor(texto, 255, 0, 0, 255) guiSetText(usedSlot, " "..slots.."") guiSetText(slots, " /"..maxsSlots.."") end "slots" es un numero y lo estas usando como elemento, supongo que ya tendras una label o algo llamado "slots", pero si definis otra variable con el mismo nombre, no servira. Ah no me di cuenta :facepalm: muchas gracias solid por tu ayuda
Recommended Posts