Jump to content

شالمشكلة


#Soking

Recommended Posts

addEventHandler ("onClientGUIClick", root, 
function() 
    if ( source == sendMoney ) then 
    amount = guiGetText(moneyEdit) 
    if ( tonumber ( amount ) ) then 
        if guiGridListGetSelectedItem(gridelist) ~= -1 then 
            local wc = getPlayerFromName(guiGridListGetItemText(gridelist,guiGridListGetSelectedItem(gridelist),1)) 
                local name = getPlayerName(wc) 
        --      if ( getElementData(localPlayer,'Money') >= amount )  then 
                 
                setElementData(wc,'Money',getElementData(wc,'Money') +amount ) 
                exports["guimessages"]:outputClient("#03FF07Successfully send Moneyto : #FF0368[ #03FFEF"..name.." #FF0368] ", 0, 255, 0) 
                    else 
                exports["guimessages"]:outputClient("#FF1003", 0, 255, 0) 
                end 
                    else 
                exports["guimessages"]:outputClient("#FF1003", 0, 255, 0) 
            end 
        end 
    end 
) 

يقلي الخطاء في الكود دا

if ( getElementData(localPlayer,'Money') >= amount )  then 

انا بدي اخليه يحدد لاعب ويكتب في الايدت بوكس عدد الفلوس و يرسل بس يقلي غلط فالكود دا

Link to comment
addEventHandler ("onClientGUIClick", root, 
function() 
    if ( source == sendMoney ) then 
    amount = tonumber ( guiGetText(moneyEdit) ) 
    if ( amount ) then 
        if guiGridListGetSelectedItem(gridelist) ~= -1 then 
            local wc = getPlayerFromName(guiGridListGetItemText(gridelist,guiGridListGetSelectedItem(gridelist),1)) 
                local name = getPlayerName(wc) 
                local data = tonumber ( getElementData(localPlayer,'Money') ) 
                if data and data >= amount   then 
                 
                setElementData(wc,'Money',getElementData(wc,'Money') +amount ) 
                exports["guimessages"]:outputClient("#03FF07Successfully send Moneyto : #FF0368[ #03FFEF"..name.." #FF0368] ", 0, 255, 0) 
                    else 
                exports["guimessages"]:outputClient("#FF1003", 0, 255, 0) 
                end 
                    else 
                exports["guimessages"]:outputClient("#FF1003", 0, 255, 0) 
            end 
        end 
    end 
) 

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