Jump to content

problema con getPedStat


Plate

Recommended Posts

Posted

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) 

Posted (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 by Guest
Posted

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

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

Posted
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 :D

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...