Jump to content

[HELP]GRIDLIST SPAM


HUNGRY:3

Recommended Posts

Posted (edited)

hello i'm trying to get the all of the player guns and put it in the gridlist

but when i add another gun it doesn't go in

code:

  
client = getLocalPlayer() 
  
function addwep() 
local invrow = guiGridListAddRow(gridlist) 
local wep = getPedWeapon(client) 
if (wep) then 
guiGridListSetItemText ( gridlist, invrow, invcol, getWeaponNameFromID(wep), false, false ) 
else 
if guiGridListGetItemText (gridlist, invrow, invcol) == getWeaponNameFromID(wep) then 
guiGridListRemoveRow(gridlist,getWeaponNameFromID(wep)) 
end 
end 
end 
addEventHandler ( "onClientResourceStart", getRootElement(), addwep ) 

Edited by Guest
Posted

You mean when you create a weapon for player, it doesn't show in the grid list? That's because you have to refresh the grid list.

Posted

There are 12 slots (including 0) and with second argument on getPedWeapon you can make that.

for i=0, 12 do 
    outputChatBox(getPedWeapon(player, i)) 
end 

Posted

all of them are 0 xD

function test(player) 
for i=0, 12 do 
    outputChatBox(getPedWeapon(player, i)) 
end 
end 
addCommandHandler("seeguns",test) 
  

Posted

Ok GTX one more question i did some thing in the script that gets the weapon name not the id but the question is i want to change "fist" in grid to "none"

which function should i use and which event?

Thanks.

Posted (edited)

You can compare strings like:

if getWeaponIDFromName(int) == "Fist" then 
    str = "None" 
end 

Edited by Guest
Posted
You can compare strings like:
if getWeaponFromName(int) == "Fist" then 
    str = "None" 
end 

thanks but getWeaponFromName Doesn't exist but I changed it and it works :D

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