Jump to content

VIP Problem


ali

Recommended Posts

this is a part of my script

    stuff = { 
                {"Special Skin"}, 
                {"Jetpack"}, 
                {"Sniper Bullet"}, 
            } 
  
for i,v in ipairs(stuff) do 
         row = guiGridListAddRow(grid) 
         -- 
         guiGridListSetItemText(grid, row, 1, tostring(v[1]), false, false) 
         guiGridListSetItemData(grid, row, 1, tostring(v[2])) 
    end 
      
  

i want that when a player double clicks on anyone of the rows it triggers a server event

Link to comment

this is it:

function test() 
    if (source == gridList) then 
        local object = guiGridListGetItemText(gridList, guiGridListGetSelectedItem(gridList), 1) 
        if (guiGridListGetSelectedItem(gridList) ~= -1) then     
            triggerServerEvent("eventInServer", getLocalPlayer(), object) 
        end 
    end 
end 
addEventHandler("onClientGUIDoubleClick", root, test) 

Link to comment

Client side

GUIEditor_Image = {} 
  
panel = guiCreateWindow(252,61,636,489,"VIP Panel",false) 
grid = guiCreateGridList(10,22,617,184,false,panel) 
guiGridListSetSelectionMode(grid,2) 
  
guiGridListAddColumn(grid,"VIP stuff ",0.2) 
  
GUIEditor_Image[1] = guiCreateStaticImage(10,213,613,267,"images/ali.jpg",false,panel) 
guiSetVisible(panel, false) 
showCursor(false) 
  
  
  
  
function show () 
visible = guiGetVisible(panel) 
if visible == false then 
guiSetVisible(panel, true) 
showCursor(true) 
else  
guiSetVisible(panel, false) 
showCursor(false) 
end 
end 
addCommandHandler("open",show ) 
  
    stuff = { 
                {"Special Skin"}, 
                {"Jetpack"}, 
                {"Sniper Bullet"}, 
            } 
  
for i,v in ipairs(stuff) do 
         row = guiGridListAddRow(grid) 
         -- 
         guiGridListSetItemText(grid, row, 1, tostring(v[1]), false, false) 
         guiGridListSetItemData(grid, row, 1, tostring(v[2])) 
    end 

Notice( i removed sparrow's info )

Edited by Guest
Link to comment
function skins() 
setElementModel( source, 255 ) 
end 
addEvent("Skin",true) 
addEventHandler("Skin", getRootElement(), skins ) 
  
function Jet() 
if doesPedHaveJetPack ( source ) then 
 removePedJetPack ( source )  
else 
givePedJetPack ( source )   
end 
end 
addEvent("JetPack",true) 
addEventHandler("JetPack", getRootElement(), Jet ) 
  
function wep ( ) 
giveWeapon( source, 34, 5 ) 
end 
addEvent("Sniper", true) 
addEventHandler("Sniper", getRootElement(), wep ) 
  

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