Jump to content

VIP Problem


ali

Recommended Posts

Posted

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

Posted

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) 

Posted

Next two what? that should work for all the items of the grid list.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

"the things happen" what does that mean? you are not explaining us anything.

Also, this line:

addEventHandler("onClientGUIDoubleClick", root, test) 

Should be:

addEventHandler("onClientGUIDoubleClick", root, test, false) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Post the whole script.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted (edited)

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
Posted

And the server side?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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 ) 
  

Posted

Post the whole client side, the one you posted has missing trigger events.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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