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
2vjs7it.jpg
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.

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
Posted

You mean like it duplicates? Use

guiGridListClear 

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
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 

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
Posted

all of them are 0 xD

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

2vjs7it.jpg
Posted

Then the slots are empty.

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
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.

2vjs7it.jpg
Posted (edited)

You can compare strings like:

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

Edited by Guest

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
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

2vjs7it.jpg
Posted

Fail. :D Edited it. And you're welcome!

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast

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