Jump to content

Send player money script help


Recommended Posts

    GUIEditor_Window = {} 
    GUIEditor_Label = {} 
    GUIEditor_Edit = {} 
    GUIEditor_Grid = {} 
    GUIEditor_Image = {} 
      
    GUIEditor_Window[1] = guiCreateWindow(298,259,646,337,"SendMoney..By tete",false) 
    guiSetAlpha(GUIEditor_Window[1],1) 
    guiWindowSetSizable(GUIEditor_Window[1],false) 
    guiSetVisible(GUIEditor_Window[1], false) 
    GUIEditor_Image[1] = guiCreateStaticImage(50,-132,5,5,"images/500.PNG",false,GUIEditor_Window[1]) 
    GUIEditor_Grid[1] = guiCreateGridList(9,20,209,308,false,GUIEditor_Window[1]) 
    guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
    GUIEditor_Label[1] = guiCreateLabel(357,204,114,16,"Max 10$",false,GUIEditor_Window[1]) 
    GUIEditor_Label[2] = guiCreateLabel(462,287,165,44,"Tete",false,GUIEditor_Window[1]) 
    guiLabelSetColor(GUIEditor_Label[2],0,255,0) 
    guiSetFont(GUIEditor_Label[2],"sa-header") 
    GUIEditor_Label[3] = guiCreateLabel(532,276,113,31,"Send money by",false,GUIEditor_Window[1]) 
    guiLabelSetColor(GUIEditor_Label[3],255,0,0) 
    GUIEditor_Edit[1] = guiCreateEdit(302,164,235,37,"",false,GUIEditor_Window[1]) 
    GUIEditor_Label[4] = guiCreateLabel(330,125,136,21,"",false,GUIEditor_Window[1]) 
    guiLabelSetHorizontalAlign(GUIEditor_Label[4],"right",false) 
    GUIEditor_Label[5] = guiCreateLabel(468,126,97,25,"Send money for:",false,GUIEditor_Window[1]) 
    GUIEditor_Image[2] = guiCreateStaticImage(246,256,121,47,"images/500.PNG",false,GUIEditor_Window[1]) 
    GUIEditor_Image[3] = guiCreateStaticImage(443,73,153,39,"images/500.PNG",false,GUIEditor_Window[1]) 
      
        function clientsideResourceStart () 
                local playerList = GUIEditor_Grid[1] 
                local column =  guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.85) 
                if ( column ) then 
                        for id, playeritem in ipairs(getElementsByType("player")) do 
                                local row = guiGridListAddRow ( playerList ) 
                                                            local morsal = GUIEditor_Label[4] 
                                guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), morsal,false, false ) 
                        end 
                end 
        end 
        addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart ) 
      
    bindKey('f7','down',function() 
        guiSetVisible(GUIEditor_Window[1],not(guiGetVisible(GUIEditor_Window[1]))) 
        showCursor(guiGetVisible(GUIEditor_Window[1])) 
    end) 
  

guiLabelSetHorizontalAlign(GUIEditor_Label[4],"right",false) GUIEditor_Label[5] = guiCreateLabel(468,126,97,25,"Send money for:",false,GUIEditor_Window[1])

Here i want the player name

just like

when i choose the player from the gridlist

it show up in GUIEditor_Label[4]

like Send money for: Dennies

Link to comment
onClientGUIClick
guiGridListGetSelectedItem 
guiGridListGetItemText 
guiSetText 

Sorry like this ?

  
    function clientsideResourceStart () 
            local playerList = GUIEditor_Grid[1] 
            local column =  guiGridListAddColumn(GUIEditor_Grid[1],"الاعبين",0.85) 
            if ( column ) then  
                    for id, playeritem in ipairs(getElementsByType("player")) do 
                            local row = guiGridListAddRow ( playerList ) 
                            guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ),false, false ) 
                            local playerName = guiGridListGetItemText ( playerList, guiGridListGetSelectedItem ( playerList ), 1 ) 
                            GUIEditor_Label[4] ( playerName ) 
                    end 
            end 
    end 

Link to comment

Sorry, that doesn't make any sense.

You have to make a function and attach the "onClientGUIClick" event handler to it, then get the selected item from the grid list with: guiGridListGetSelectedItem, check if he really selected something and then get the selected item text with: guiGridListGetItemText, after this you set the GUI-label text to the selected item text with: guiSetText.

It's all explained, now you have to read it over and over until you understand.

Link to comment
Sorry, that doesn't make any sense.

You have to make a function and attach the "onClientGUIClick" event handler to it, then get the selected item from the grid list with: guiGridListGetSelectedItem, check if he really selected something and then get the selected item text with: guiGridListGetItemText, after this you set the GUI-label text to the selected item text with: guiSetText.

It's all explained, now you have to read it over and over until you understand.

Wow ! i did it thanks !!!!!!! i dunno what should do with out your help : D

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