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) 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Si no nos decis cual es el problema exacto, no podemos ayudarte.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
if ( colt >= 40 <= 998 ) then 

Eso no tiene sentido.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

"maxsSlots" que devuelve?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Se supone que un numero al igual que Slots

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

No pregunte a que se supone que devuelva, sino que devuelve.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

De nada.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Recently Browsing   0 members

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