Jump to content

Send Mony Help


Evil-Cod3r

Recommended Posts

Hi all i Made this

what i do now ??

how To Make it work ?

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
GUIEditor_Progress = {} 
GUIEditor_Grid = {} 
  
GUIEditor_Window[1] = guiCreateWindow(402,321,553,243,"Send Money By Evil-Cod3r [V1.0]",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Label[1] = guiCreateLabel(420,25,107,19,"Your Money :",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(214,33,131,18,"Player:",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[2],0,255,0) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Edit[1] = guiCreateEdit(209,57,211,35,"",false,GUIEditor_Window[1]) 
GUIEditor_Edit[2] = guiCreateEdit(207,127,223,37,"",false,GUIEditor_Window[1]) 
GUIEditor_Label[3] = guiCreateLabel(210,104,159,24,"Amount:",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[3],0,0,255) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Button[1] = guiCreateButton(212,174,168,40,"Send !",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Progress[1] = guiCreateProgressBar(398,185,135,22,false,GUIEditor_Window[1]) 
  
GUIEditor_Label[4] = guiCreateLabel(755,172,5,5,"",false) 
  
GUIEditor_Grid[1] = guiCreateGridList(406,346,202,208,false) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.2) 

Link to comment

You only have the GUI code, which is the easy part, now you need to learn on how to make the rest.

Functions that you may need:

guiGridListAddRow 
guiGridListGetSelectedItem 
guiGridListGetItemText 
guiGridListSetItemText 
getElementsByType 
getPlayerName 
triggerServerEvent 
getPlayerMoney 
takePlayerMoney 
givePlayerMoney 
getPlayerFromName 

Link to comment

i tryed like this ?

clientSide----- 
function Money () 
outputChatBox ( ".:[ Money Send Gui ! |#666666 By Evil-Cod3r #FFFF1A]:.", getRootElement(), 255, 255, 255, true ) 
Window = guiCreateWindow(426,69,681,298,"[send Mony] V2.0 By Evil-Cod3r",false) 
guiWindowSetMovable(Window,false) 
guiWindowSetSizable(Window,false) 
GUIEditor_Label[1] = guiCreateLabel(496,21,86,17,"Your Money :",false,Window) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"clear-normal") 
GUIEditor_Label[2] = guiCreateLabel(317,240,5,5,"",false,Window) 
GUIEditor_Label[3] = guiCreateLabel(217,61,190,20,"Players :",false,Window) 
guiLabelSetColor(GUIEditor_Label[3],0,0,255) 
guiSetFont(GUIEditor_Label[3],"clear-normal") 
GUIEditor_Edit[1] = guiCreateEdit(216,85,224,36,"50",false,Window) 
GUIEditor_Label[4] = guiCreateLabel(215,140,211,29,"Cash :",false,Window) 
guiLabelSetColor(GUIEditor_Label[4],255,0,0) 
guiSetFont(GUIEditor_Label[4],"clear-normal") 
GUIEditor_Edit[2] = guiCreateEdit(213,162,241,41,"100",false,Window) 
GUIEditor_Label[5] = guiCreateLabel(493,270,177,18,"Less Cash To Send is 200 !",false,Window) 
guiLabelSetColor(GUIEditor_Label[5],255,0,255) 
guiSetFont(GUIEditor_Label[5],"clear-normal") 
GUIEditor_Image[1] = guiCreateStaticImage(481,61,168,158,"images/M.png",false,Window) 
playerGridList = guiCreateGridList(12,27,199,262,false,Window) 
guiGridListSetSelectionMode(playerGridList,2) 
guiGridListAddColumn(playerGridList,"Players :",0.2) 
Go = guiCreateButton(220,230,218,31,"Send !",false,Window) 
guiSetFont(Go,"clear-normal") 
triggerServerEvent ( "onMoneyTrasf", getLocalPlayer() ) 
end 
addEventHandler( "onClientResourceStart", getRootElement( ), Money) 

ServerSide ----

  
    function trasferMoney(theReicivitor, theInviator, amount) 
           local target = tostring(theReicivitor) 
            local account = getPlayerAccount(theInviator) 
             if not (isGuestAccount(account)) then 
                 if (target) then 
                     if (amount) then 
                         local targetPlayer = getPlayerFromName(target) 
                         local amount = math.floor(tonumber(amount)) 
                         if (targetPlayer) then 
                             local targetAccount = getPlayerAccount(targetPlayer) 
                             if not (isGuestAccount(targetAccount)) then 
                                 if not (source == targetPlayer) then 
                                        if (amount > 0) then 
                                        local sourceCash = getAccountData(account, "cash") 
                                         if (tonumber(sourceCash) > amount) then 
                                             setTimer(outputChatBox,50,1,"* #FFFFFF"..getPlayerName(source).. " #FFB200Has Send Mony " ..tostring(amount).. "$ to #FFFFFF"..getPlayerName(targetPlayer).."#FFB200!", getRootElement(), unpack(scriptcol[1])) 
                                            addStat(account, "cash", -amount) 
                                            addStat(targetAccount, "cash", amount) 
                                         else 
                                             outputChatBox("* You Don't Have That Money!", source, unpack(scriptcol[2])) 
                                              end 
                                            else 
                                         outputChatBox("* Invalid number! Please enter a number > 0!", source, unpack(scriptcol[2]))                     
                                     end 
                                 else 
                                     outputChatBox("* You Can't Transfer Money To Yourself!", source, unpack(scriptcol[2]))                           
                                    end 
                              else 
                                outputChatBox(targetError, source, unpack(scriptcol[2]))                           
                             end 
                         else 
                                      outputChatBox("* Could not find player!", source, unpack(scriptcol[2]))                         
                         end 
                         else 
                        outputChatBox("* Error: Please enter an amount! SYNTAX: !donate ", source, unpack(scriptcol[2]))                       
                    end 
                else 
                    outputChatBox("* Error: Please enter a player name! SYNTAX: !donate ", source, unpack(scriptcol[2]))                   
                 end 
                else 
                outputChatBox(registerError, source, unpack(scriptcol[2]))             
             end                     
   end 
 addEvent("onMoneyTrasf", true) 
 addEventHandler("onMoneyTrasf", getRootElement(), trasferMoney) 

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