An easy way to select the last gridlist row:
local lastRow = guiGridListGetRowCount(gridlistItems["inventory"])
guiGridListSetSelectedItem( gridlistItems["inventory"], lastRow, column1 )
How do you know when you'll need to use this function? > By checking if the dropped item row is the last one in gridlist.
Você poderia colocar um setElementData no veículo quando ele é blindado pelo modo passivo (sem ser por área verde). E dai no mod da área verde, vc configura pra ignorar os veículos que entram e saem com essa data. Dessa forma, os veículos que não foram blindados pela área, não serão desblindados por ela.
Creio que seja mais ou menos esse:
Jogador blinda o veículo com o modo Passivo.
Jogador entra na área verde com o veículo blindado. (e a área tenta blindar o veículo de novo)
Jogador sai da área verde ainda no modo Passivo. (e a área desblinda o veículo)
Jogador fica no modo Passivo sem a blindagem. (Erro)
I don't really understand your problem. BUT, I think this should help:
row1, column1 = guiGridListGetSelectedItem(gridlistItems["inventory"])
if row1 and column1 then
guiGridListSetSelectedItem(gridlistItems["inventory"], row1, column1)
if row1 == -1 then guiGridListSetSelectedItem(gridlistItems["inventory"], 0, column1) end
end
Vou deixar aqui a mesma resposta que deixei pra ele na mensagem privada:
Se eu simplesmente perdoar sem levar em consideração a razão, com certeza ele vai fazer as mesmas coisas que fez antes. Caso encerrado.
You want to disable jumping?
Use this function: https://wiki.multitheftauto.com/wiki/ToggleControl
-- server side
function disablePedJumping(player)
if isElement(player) then
return toggleControl(player, "jump", false)
end
return false
end
createEffect -- for the smoke and sparks
fadeCamera/dxDrawRectangle -- for the white flash
setTime -- to change the server's time
setWeather -- optional weather