Jump to content

[help] Skills and Stats [solved]


#RooTs

Recommended Posts

Hello, is there any way to join all the ability in one variable?

I've tried everything friends :cry::cry:

Example:

local stats01 = getPedStat (localPlayer,tonumber(69) ) 
local stats02 = getPedStat (localPlayer,tonumber(73) ) 
local stats03 = getPedStat (localPlayer,tonumber(78) ) 
local stats04 = getPedStat (localPlayer,tonumber(70) ) 
local stats05 = getPedStat (localPlayer,tonumber(74) ) 
local stats06 = getPedStat (localPlayer,tonumber(77) ) 
local stats07 = getPedStat (localPlayer,tonumber(71) ) 
local stats08 = getPedStat (localPlayer,tonumber(72) ) 
local stats09 = getPedStat (localPlayer,tonumber(75) ) 
local stats10 = getPedStat (localPlayer,tonumber(76) ) 
local stats11 = getPedStat (localPlayer,tonumber(79) ) 
local stats12 = getPedStat (localPlayer,tonumber(23) ) 
  
--my attempt 
local allstats = 1000*stats01/1000*stats02/1000*stats03/1000*stats04/1000*stats05/1000*stats06/1000*stats07/1000*stats08/1000*stats09/1000*stats10/1000*stats11/1000*stats12 
  
dxDrawRectangle(cx*77, cy*530, cx*220/allstats, cy*7, tocolor(103, 188, 107  , 255), false) 
dxDrawText (allstats.."%", cx*69, cy*505, cx*150, cy*10, tocolor ( 0, 0, 0, 200 ), 1,"default-bold","left","top",false,false,false, true) 
  
  

Edited by Guest
Link to comment
i think you need something like this
local stats = {69,73,78,70,74,77,71,72,75,76,79,23,} 
  
for i , v in ipairs (stats) do  
check = getPedStat (localPlayer,tonumber(v))/1000 
end 

@SkatCh, I did the table, so I think there's something most wrong aii

  
local stats = 
{  
{69,73,78,70,74,77,71,72,75,76,79,23}, 
} 
  
for _, v in ipairs (stats) do  
check = getPedStat (localPlayer,tonumber(v)) 
end 
  
dxDrawText (check.."%", cx*69, cy*505, cx*150, cy*10, tocolor ( 0, 0, 0, 200 ), 1,"default-bold","left","top",false,false,false, true) 
dxDrawText (check , cx*68, cy*504, cx*150, cy*10, tocolor ( 255, 165, 0, 255 ), 1,"default-bold","left","top",false,false,false, true) 
  
  
  

Link to comment

Why you change it copy and past my code

local stats = {69,73,78,70,74,77,71,72,75,76,79,23} 
  
  
for i, v in ipairs (stats) do 
check = getPedStat (localPlayer,tonumber(v)) 
end 
  
dxDrawText (check.."%", cx*69, cy*505, cx*150, cy*10, tocolor ( 0, 0, 0, 200 ), 1,"default-bold","left","top",false,false,false, true) 
dxDrawText (check , cx*68, cy*504, cx*150, cy*10, tocolor ( 255, 165, 0, 255 ), 1,"default-bold","left","top",false,false,false, true) 

Link to comment
Why you change it copy and past my code
local stats = {69,73,78,70,74,77,71,72,75,76,79,23} 
  
  
for i, v in ipairs (stats) do 
check = getPedStat (localPlayer,tonumber(v)) 
end 
  
dxDrawText (check.."%", cx*69, cy*505, cx*150, cy*10, tocolor ( 0, 0, 0, 200 ), 1,"default-bold","left","top",false,false,false, true) 
dxDrawText (check , cx*68, cy*504, cx*150, cy*10, tocolor ( 255, 165, 0, 255 ), 1,"default-bold","left","top",false,false,false, true) 

@SkatCh no work :?

Link to comment
post full code here.
local screenW,screenH = guiGetScreenSize() 
local resW, resH = 1280, 720 
local cx, cy =  (screenW/resW), (screenH/resH) 
function Test ( ) 
local stats = {69,73,78,70,74,77,71,72,75,76,79,23} 
  
  
for i, v in ipairs (stats) do 
check = getPedStat (localPlayer,tonumber(v)) 
end 
  
dxDrawText (check.."%", cx*69, cy*505, cx*150, cy*10, tocolor ( 0, 0, 0, 200 ), 1,"default-bold","left","top",false,false,false, true) 
dxDrawText (check , cx*68, cy*504, cx*150, cy*10, tocolor ( 255, 165, 0, 255 ), 1,"default-bold","left","top",false,false,false, true) 
end 
addEventHandler("onClientRender", root, Test) 

Link to comment

are you sure it's working fine

local screenW,screenH = guiGetScreenSize() 
local resW, resH = 1280, 720 
local cx, cy =  (screenW/resW), (screenH/resH) 
local stats = {69,73,78,70,74,77,71,72,75,76,79,23} 
  
function Test ( ) 
for i, v in ipairs (stats) do 
check = getPedStat (localPlayer,tonumber(v)) 
end 
dxDrawText (check.."%", cx*69, cy*505, cx*150, cy*10, tocolor ( 0, 0, 0, 200 ), 1,"default-bold","left","top",false,false,false, true) 
dxDrawText (check , cx*68, cy*504, cx*150, cy*10, tocolor ( 255, 165, 0, 255 ), 1,"default-bold","left","top",false,false,false, true) 
end 
addEventHandler("onClientRender", root, Test) 

i can see it near to the radar

0029329c94.jpg

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