Jump to content

Whats wrong with my script...


Recommended Posts

Hi there,

I feel like a noob, you talk about creating moving fences and i fail at making a Health Window :(

I made this script:

function clientsideResourceStart () 
  
        -- Create the grid list element 
        local HealthStat = guiCreateGridList ( 0.45, 0.45, 0.15, 0.2, true ) 
        local column = guiGridListAddColumn( HealthStat, "Health", 0.85 ) 
        local playerHealth = getElementHealth ( getLocalPlayer() ) 
    local row = guiGridListAddRow ( HealthStat ) 
    local row = guiGridListAddRow ( HealthStat ) 
    local row = guiGridListAddRow ( HealthStat ) 
    local row = guiGridListAddRow ( HealthStat ) 
  
    guiGridListSetItemText ( HealthStat, 1, 1, "You are Alive/Dead", false, false ) 
    guiGridListSetItemText ( HealthStat, 2, 1, "Your current Health: " .. playerHealth, false, false ) 
    guiGridListSetItemText ( HealthStat, 3, 1, "Your current Armor: ", false, false )   --guiGridListSetItemText ( HealthStat, 3, 1, "Your current Armor: ", false, false ) 
     
setTimer ( HealthStatRefresh, 500, 100 ) -- Should work 50 seconds afer starting resource 
  
  
end 
addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart, showLocalHealth, getElementHealth, HealthStatRefresh ) 
  
function HealthStatRefresh () 
    if ( HealthStat ) then 
        guiGridListClear ( HealthStat ) 
        local row = guiGridListAddRow ( HealthStat ) 
        local row = guiGridListAddRow ( HealthStat ) 
        local row = guiGridListAddRow ( HealthStat ) 
        local row = guiGridListAddRow ( HealthStat ) --lol, dunno why, but i made 4 rows 
        local playerHealth = getElementHealth ( getLocalPlayer() ) 
        guiGridListSetItemText ( HealthStat, 2, 1, "Your current Health: " .. playerHealth, false, false )   
    end 
end 
     
  

Its showing the Health Status fine, but only one time (when the resource is started), when the player looses Health, it still shows Health: 100... when restarting the script, it shows the right Health Status..

So obviously the Refresh part doesnt work, sry if its a clear and easy fault, but i didnt detect it.

And btw. I know this is very crappy scripted, but i did my best ;) and the position of the window will be changed soon :D

Thank You

Link to comment

  
  
    local row = guiGridListAddRow ( HealthStat ) 
    local row = guiGridListAddRow ( HealthStat ) 
    local row = guiGridListAddRow ( HealthStat ) 
    local row = guiGridListAddRow ( HealthStat ) 
  
  

WTF?

 

  
setTimer ( HealthStatRefresh, 500, 100 ) -- Should work 50 seconds afer starting resource 
  

500 = 2 times per second, for 50 sec use 50000.

100 = execute 100 times only, use 0 instead. (Each 50 sec until you stop it)

 

Remember that you can't use functions before you've made them - move all your functions to the top or over the first place they're used.

Link to comment

onClientPlayerDamage

onPlayerDamage

2 events

1 server-side, 1 client-side

1 simple solution

Anyway, so add something like this:

function updateHealth() 
    guiGridListSetItemText ( HealthStat, 2, 1, "Your current Health: " .. getElementHealth(getLocalPlayer()), false, false ) 
end 

Don't forget to add the addEventHandler in clientsideResourceStart function!

Link to comment

Yeah, than you guys, now the script is working perfectly:

     
function clientsideResourceStart () 
  
        -- Create the grid list element 
        local HealthStat = guiCreateGridList ( 0.45, 0.45, 0.15, 0.15, true ) 
        local column = guiGridListAddColumn( HealthStat, "Health", 0.85 ) 
        local playerHealth = getElementHealth ( getLocalPlayer() ) 
    local row = guiGridListAddRow ( HealthStat ) 
    local row = guiGridListAddRow ( HealthStat ) 
    local row = guiGridListAddRow ( HealthStat ) 
    local row = guiGridListAddRow ( HealthStat ) 
  
    guiGridListSetItemText ( HealthStat, 1, 1, "You are Alive/Dead", false, false ) 
    guiGridListSetItemText ( HealthStat, 2, 1, "Your current Health: " .. getElementHealth(getLocalPlayer()), false, false ) 
    guiGridListSetItemText ( HealthStat, 3, 1, "Your current Armor: ", false, false )   --guiGridListSetItemText ( HealthStat, 3, 1, "Your current Armor: ", false, false ) 
     
function updateHealth() 
    if ( HealthStat ) then 
        guiGridListClear ( HealthStat ) 
         
        local row = guiGridListAddRow ( HealthStat ) 
        local row = guiGridListAddRow ( HealthStat ) 
        local row = guiGridListAddRow ( HealthStat ) 
        local row = guiGridListAddRow ( HealthStat ) 
         
        local playerHealth = getElementHealth ( getLocalPlayer() ) 
         
        guiGridListSetItemText ( HealthStat, 1, column, "You are Alive/Dead", false, false ) 
        guiGridListSetItemText ( HealthStat, 2, column, "Your current Health: " .. getElementHealth(getLocalPlayer()), false, false ) 
        guiGridListSetItemText ( HealthStat, 3, column, "Your current Armor: ", false, false ) 
    end 
end 
  
  
  
setTimer ( updateHealth, 500, 0 )  
  
  
end 
addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart, showLocalHealth, getElementHealth, updateHealth ) 
  

WTF?

Some examples in the wiki are grving these commands. And only with guiGridListAddRow the Status is working right ;)

This script is unfinished, but the main thing is done.

Btw.: I could disable everything without the clock (i said is in my other Topic). But when you get idle in Stealth, he will disable Everything, also the clock... So i should have alook on the Stealth code ...

Link to comment
Btw.: I could disable everything without the clock (i said is in my other Topic). But when you get idle in Stealth, he will disable Everything, also the clock... So i should have alook on the Stealth code ...

In EVERY gamemode the clock is disabled while idling for a while. :P

Link to comment

So you want the entire HUD replaced by the GUI? Clever. :P

Anyway, it would be no clock disappear untill DP3. This apparently has been confirmed by Ransom:

hiding the clock is an arg in dp3

I've opened an issue requesting frozen time for real time in the dev reports, but its low priority so no guarentees.

Source: LINK

EDIT: Just in case you didn't know, I was talking about the first line ^^

Link to comment
No, what I'm saying is that it's just done by GTA or MTA, not by a command! Searching for the command used... Good luck! xD

Lol, thank you. Thats sad. I could place a Gui over the clock, but i want to set the Gui's Alpha ^^. So it wouldnt look good if there is a clock in the background.-.

separate gui elements can have different alpha settings can't they? if so, just make the rest of the gui with alpha transparency, but in that top right hand corner, make it solid. if it's done in the right way, it could still look pretty neat...maybe? :)

Link to comment

Thanks for replies Guys :D (uuh.. Metaphers)

I think, i wont die because of this clock issue. Thanks for giving information about the Alpha :D I will make a Gui overlaying the CLock. In the Gui Informations like Game-Time and Real-Time should be shown ;). But until then its a long way through several Guides and Tutorials :D

ATM i try to colour the Health Status (if >30% => colour = red, etc...)

BTW. Is it possible to change the scale and colour of a text that is in a GridList?: eg this one:

guiGridListSetItemText ( HealthStat, 2, 1, "Your current Health: ", false, false ) 

i want to use this Function

textitem textCreateTextItem ( [string text, float x, float y, string priority, int red = 255, int green = 0, int blue = 0, int alpha = 255, float scale = 1, string alignX = "left", string alignY = "top"] ) 

MEans: Is it possible to set the font/colour of only ONE row? I could only edit the whole GUI:

guiSetFont (HealthStat, "sa-gothic" ) --This works only for the whole column "HealthStat". Is it posssible to make these settings on only one row? 

Edit: rofl. thats crazy:

for getting shown Player's Health correntcly, i needed 3 days.

for getting shown Player's Armor correctly, i needed 20 seconds :D

Link to comment

Yo Guys, i got the next problem:

The updateWeapon function doesnt work :(

NO command works at the end of this script, and i ask me why.. :D

I hoe you can follow/understand my steps, i didnt make explanations :?

Oh, and please ignore the spammed EventHandler, i have to clean it a lil bit ;)

--THE WEAPON FUNCTION: 
 
    local WeaponStat = guiCreateGridList ( 0.45, 0.02, 0.15, 0.12, true, window )
        local column2 = guiGridListAddColumn( WeaponStat, "Weapon", 0.85 )
   
    local row1 = guiGridListAddRow ( WeaponStat )
    local row2 = guiGridListAddRow ( WeaponStat )
    local row3 = guiGridListAddRow ( WeaponStat )
    local row4 = guiGridListAddRow ( WeaponStat )
    local row5 = guiGridListAddRow ( WeaponStat )
    local row6 = guiGridListAddRow ( WeaponStat )
   
    guiGridListSetItemText ( WeaponStat, row1, column2, "Your current Weapon: ", false, false )
    guiGridListSetItemText ( WeaponStat, row3, column2, "Your current Ammo: ", false, false )   
 
 
    local ammot0 = getPlayerTotalAmmo ((getLocalPlayer()), 0)
 
    local ammot1 = getPlayerTotalAmmo ((getLocalPlayer()), 1)
 
    local ammot2 = getPlayerTotalAmmo ((getLocalPlayer()), 2)
 
    local ammot3 = getPlayerTotalAmmo ((getLocalPlayer()), 3)
 
    local ammot4 = getPlayerTotalAmmo ((getLocalPlayer()), 4)
 
    local ammot5 = getPlayerTotalAmmo ((getLocalPlayer()), 5)
 
    local ammot6 = getPlayerTotalAmmo ((getLocalPlayer()), 6)
 
    local ammot7 = getPlayerTotalAmmo ((getLocalPlayer()), 7)
 
    local ammot8 = getPlayerTotalAmmo ((getLocalPlayer()),
 
    local ammot9 = getPlayerTotalAmmo ((getLocalPlayer()), 9)
 
    local ammot10 = getPlayerTotalAmmo ((getLocalPlayer()), 10)
 
    local ammot11 = getPlayerTotalAmmo ((getLocalPlayer()), 11)
   
    local ammot12 = getPlayerTotalAmmo ((getLocalPlayer()), 12)
   
    local ammo0 = getPlayerAmmoInClip ((getLocalPlayer()), 0)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo0.. " - " ..ammot0 - ammo0.."  ", false, false )
   
    local ammo1 = getPlayerAmmoInClip ((getLocalPlayer()), 1)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo1.. " - " ..ammot1 - ammo1.."  ", false, false )
   
    local ammo2 = getPlayerAmmoInClip ((getLocalPlayer()), 2)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo2.. " - " ..ammot2 - ammo2.."  ", false, false )
 
    local ammo3 = getPlayerAmmoInClip ((getLocalPlayer()), 3)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo3.. " - " ..ammot3 - ammo3.."  ", false, false )
 
    local ammo4 = getPlayerAmmoInClip ((getLocalPlayer()), 4)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo4.. " - " ..ammot4 - ammo4.."  ", false, false )
 
    local ammo5 = getPlayerAmmoInClip ((getLocalPlayer()), 5)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo5.. " - " ..ammot5 - ammo5.."  ", false, false )
 
    local ammo6 = getPlayerAmmoInClip ((getLocalPlayer()), 6)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo6.. " - " ..ammot6 - ammo6.."  ", false, false )
 
    local ammo7 = getPlayerAmmoInClip ((getLocalPlayer()), 7)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo7.. " - " ..ammot7 - ammo7.."  ", false, false )
 
    local ammo8 = getPlayerAmmoInClip ((getLocalPlayer()),
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo8.. " - " ..ammot8 - ammo8.."  ", false, false )
 
    local ammo9 = getPlayerAmmoInClip ((getLocalPlayer()), 9)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo9.. " - " ..ammot9 - ammo9.."  ", false, false )
 
    local ammo10 = getPlayerAmmoInClip ((getLocalPlayer()), 10)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo10.. " - " ..ammot10 - ammo10.."  ", false, false )
   
    local ammo11 = getPlayerAmmoInClip ((getLocalPlayer()), 11)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo11.. " - " ..ammot11 - ammo11.."  ", false, false )
 
    local ammo12 = getPlayerAmmoInClip ((getLocalPlayer()), 12)
    guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo12.. " - " ..ammot12 - ammo12.."  ", false, false )
   
    local weaponType = getPlayerWeapon ( getLocalPlayer())
    if ( weaponType == 0 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "        None" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo0.. "  ", false, false )
    elseif ( weaponType == 1 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Brass Knuckles" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo0.. " - " ..ammot0 - ammo0.."  ", false, false )
    elseif ( weaponType == 2 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     GolfClub" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo0.. " - " ..ammot0 - ammo0.."  ", false, false )
    elseif ( weaponType == 3 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Nightstick" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "        1 - 0 ", false, false )
    elseif ( weaponType == 4 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "       Knife" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "        1 - 0 ", false, false )
    elseif ( weaponType == 5 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Baseball Bat" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "        1 - 0 ", false, false )
    elseif ( weaponType == 6 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "      Shovel" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "        1 - 0 ", false, false )  
    elseif ( weaponType == 7 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Pool Cue" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "        1 - 0 ", false, false )
    elseif ( weaponType == 8 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "      Katana" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "        1 - 0 ", false, false )
    elseif ( weaponType == 9 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Chainsaw" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "        1 - 0 ", false, false )
    elseif ( weaponType == 15 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "        Cane" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "        1 - 0 ", false, false )
    elseif ( weaponType == 22 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "      Pistol" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo2.. " - " ..ammot2 - ammo2.."  ", false, false )
    elseif ( weaponType == 23 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Silenced Pistol" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo2.. " - " ..ammot2 - ammo2.."  ", false, false )
    elseif ( weaponType == 24 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Desert Eagle" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo2.. " - " ..ammot2 - ammo2.."  ", false, false )
    elseif ( weaponType == 25 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Shotgun" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo3.. " - " ..ammot3 - ammo3.."  ", false, false )
    elseif ( weaponType == 26 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Sawn-Off Shotgun" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo3.. " - " ..ammot3 - ammo3.."  ", false, false )
    elseif ( weaponType == 27 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     SPAZ-12 Combat Shotgun" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo3.. " - " ..ammot3 - ammo3.."  ", false, false )
    elseif ( weaponType == 28 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "         Uzi" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo4.. " - " ..ammot4 - ammo4.."  ", false, false )
    elseif ( weaponType == 29 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "         MP5" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo4.. " - " ..ammot4 - ammo4.."  ", false, false )
    elseif ( weaponType == 32 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "       Tec-9" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo4.. " - " ..ammot4 - ammo4.."  ", false, false )
    elseif ( weaponType == 30 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "       AK-47" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo5.. " - " ..ammot5 - ammo5.."  ", false, false )
    elseif ( weaponType == 31 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "          M4" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo5.. " - " ..ammot5 - ammo5.."  ", false, false )
    elseif ( weaponType == 33 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Coutry Rifle" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo6.. " - " ..ammot6 - ammo6.."  ", false, false )  
    elseif ( weaponType == 34 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Sniper Rifle" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo6.. " - " ..ammot6 - ammo6.."  ", false, false )
    elseif ( weaponType == 35 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Rocket Launcher" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo7.. " - " ..ammot7 - ammo7.."  ", false, false )
    elseif ( weaponType == 36 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Heat-Seeking RPG" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo7.. " - " ..ammot7 - ammo7.."  ", false, false )
    elseif ( weaponType == 37 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Flamethrower" , false, false )  
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo7.. " - " ..ammot7 - ammo7.."  ", false, false )
    elseif ( weaponType == 38 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Minigun, You shouldn't have this ;)" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo7.. " - " ..ammot7 - ammo7.."  ", false, false )
    elseif ( weaponType == 16 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Grenade" , false, false )  
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo8.. " - " ..ammot8 - ammo8.."  ", false, false )
    elseif ( weaponType == 17 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Tear Gas" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo8.. " - " ..ammot8 - ammo8.."  ", false, false )
    elseif ( weaponType == 18 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Molotov Cocktail" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo8.. " - " ..ammot8 - ammo8.."  ", false, false )
    elseif ( weaponType == 39 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Satchel Charges" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo8.. " - " ..ammot8 - ammo8.."  ", false, false )
    elseif ( weaponType == 40 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Satchel Detonator" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo12.. " - " ..ammot12 - ammo12.."  ", false, false )
    elseif ( weaponType == 41 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Spraycan" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo9.. " - " ..ammot9 - ammo9.."  ", false, false )
    elseif ( weaponType == 42 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Fire Extringuisher" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo9.. " - " ..ammot9 - ammo9.."  ", false, false )
    elseif ( weaponType == 43 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "      Camera" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo9.. " - " ..ammot9 - ammo9.."  ", false, false )
    elseif ( weaponType == 10 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Long Purple Dildo" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo11.. " - " ..ammot11 - ammo11.."  ", false, false )
    elseif ( weaponType == 11 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Short tan Dildo" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo11.. " - " ..ammot11 - ammo11.."  ", false, false )
    elseif ( weaponType == 12 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Vibrator" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo11.. " - " ..ammot11 - ammo11.."  ", false, false )
    elseif ( weaponType == 14 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Flowers" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo11.. " - " ..ammot11 - ammo11.."  ", false, false )
    elseif ( weaponType == 44 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Night-Vision Goggles" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo11.. " - " ..ammot11 - ammo11.."  ", false, false )
    elseif ( weaponType == 45 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Infrared Goggles" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo11.. " - " ..ammot11 - ammo11.."  ", false, false )
    elseif ( weaponType == 46 ) then
        guiGridListSetItemText ( WeaponStat, row2, column2, "     Parachute" , false, false )
        guiGridListSetItemText ( WeaponStat, row4, column2, "  " ..ammo11.. " - " ..ammot11 - ammo11.."  ", false, false )
 
 
 
end
 
end
 
function updateWeapon()
   
    if ( WeaponStat ) then
        guiGridListClear ( WeaponStat )
       
    local row1 = guiGridListAddRow ( WeaponStat )
    local row2 = guiGridListAddRow ( WeaponStat )
    local row3 = guiGridListAddRow ( WeaponStat )
    local row4 = guiGridListAddRow ( WeaponStat )
    local row5 = guiGridListAddRow ( WeaponStat )
    local row6 = guiGridListAddRow ( WeaponStat )
   
    guiGridListSetItemText ( WeaponStat, row1, column2, "Your current Weapon: ", false, false )
    guiGridListSetItemText ( WeaponStat, row3, column2, "Your current Ammo: ", false, false )   
 
 
    local ammot0 = getPlayerTotalAmmo ((getLocalPlayer()), 0)
 
    local ammot1 = getPlayerTotalAmmo ((getLocalPlayer()), 1)
 
    local ammot2 = getPlayerTotalAmmo ((getLocalPlayer()), 2)
 
    local ammot3 = getPlayerTotalAmmo ((getLocalPlayer()), 3)
 
    local ammot4 = getPlayerTotalAmmo ((getLocalPlayer()), 4)
 
    local ammot5 = getPlayerTotalAmmo ((getLocalPlayer()), 5)
 
    local ammot6 = getPlayerTotalAmmo ((getLocalPlayer()), 6)
 
    local ammot7 = getPlayerTotalAmmo ((getLocalPlayer()), 7)
 
    local ammot8 = getPlayerTotalAmmo ((getLocalPlayer()),
 
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...