guiGridListInsertRowAfter | Multi Theft Auto: Wiki Skip to content

guiGridListInsertRowAfter

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This allows you to insert a new row after a specified row, and simultaneously set text. Good for inserting new rows in the middle of existing rows. To insert at the top use -1 as row index.

Syntax

guiGridListInsertRowAfter ( )

Code Examples

client

This example would create a gridlist then add the current players in the server and if anyone joins, it would insert a row at the bottom.

gridlist = guiCreateGridList(100,100,200,100,false)
guiGridListAddColumn(gridlist,"Players",0.50)
for i,v in ipairs(getElementsByType("player"))do
guiGridListSetItemText(gridlist,guiGridListAddRow(gridlist),1,getPlayerName(v),false,false)
end
addEventHandler("onClientPlayerJoin",root,function()
guiGridListSetItemText(gridlist,guiGridListInsertRowAfter(gridlist,guiGridListGetRowCount(gridlist)),1,getPlayerName(source),false,false)--Add row at the bottom of the gridlist and name it the players name
end)

See Also

GUI Functions