nony Posted August 8, 2012 Share Posted August 8, 2012 السلام عليكم ورحمه الله وبركاته يا شباب عندي كود ارسال الفلوس مايجي فيه اسماء الاعبين ذا الكود client.lua --------------------------------------------------------------------------------------- tab7 = guiCreateTab("Send Money",tabPanel) ---------------------------------------------------------------------------------------- setTimer( function() playerList = guiCreateGridList(2, 2, 250, 490, false, tab7) guiGridListSetSelectionMode(playerList, 2) local cl = guiGridListAddColumn(playerList, "Players List ...", 0.85) if ( cl and guiGetVisible(gui["_root"]) == true ) then for _,name in ipairs(getElementsByType("player")) do local rw = guiGridListAddRow(playerList) guiGridListSetItemText(playerList, rw, cl, getPlayerName(name), false, false) end addEventHandler("onClientGUIClick", playerList, onClickPlayerName) end end ,4000,0) nameEdit = guiCreateEdit(290,50,200,30,"",false,tab7) player = guiCreateLabel(365,30,300,100,' player: ',false,tab7) guiSetText ( player, getPlayerPing(source)) guiLabelSetColor(player,255,255,100) amountEdit = guiCreateEdit(335,115,100,30,"",false,tab7) money = guiCreateLabel(360,95,300,100,' money: ',false,tab7) guiSetText ( money, getPlayerPing(source)) guiLabelSetColor(money,255,255,100) sendBTN = guiCreateButton(320,165,130,36, "send", false,tab7) function onClickPlayerName () local name = guiGridListGetItemText(playerList, guiGridListGetSelectedItem(playerList), 1) guiSetText(nameEdit, name) end addEventHandler("onClientGUIClick",getRootElement(), function() if ( source == sendBTN ) then playerNick = guiGetText(nameEdit) amount = guiGetText(amountEdit) triggerServerEvent("onSendMoney", getLocalPlayer(), playerNick, amount) end end) server.lua ----------------------------------------- addEvent("onSendMoney", true) addEventHandler("onSendMoney", getRootElement(), function(who, player) local money = getPlayerMoney(source) if tonumber(player) >= 200 then if tonumber(player) <= money then toWho = getPlayerFromName(who) if toWho ~= false then givePlayerMoney(toWho, player) takePlayerMoney(source, player) name = getPlayerName(source) outputChatBox("* You have given money amount of: #00ff00$" .. player .. " #0099ccto: #ff0000" .. who, source, 0, 150, 255, true) outputChatBox("* ".. name .. " #ff0000has given you money amount of: #00ff00$" .. player .. " #ff0000!", toWho, 255, 0, 0, true) else outputChatBox("* Player did not exist !", source, 255, 0, 0) end else outputChatBox("* you dont have enough money !", source, 255, 0, 0) end else outputChatBox("* the Less amount must be #00ff00$200 !", source, 255, 0, 0) end end ) ------------------------------------------------ وش الخطأ في الكود؟؟؟ Link to comment
3NAD Posted August 8, 2012 Share Posted August 8, 2012 ججرب ذا -- Client Side --------------------------------------------------------------------------------------- tab7 = guiCreateTab("Send Money",tabPanel) ---------------------------------------------------------------------------------------- setTimer( function() playerList = guiCreateGridList(2, 2, 250, 490, false, tab7) guiGridListSetSelectionMode(playerList, 2) local cl = guiGridListAddColumn(playerList, "Players List ...", 0.85) if ( cl and guiGetVisible(tabPanel) == true ) then for _,name in ipairs(getElementsByType("player")) do local rw = guiGridListAddRow(playerList) guiGridListSetItemText(playerList, rw, cl, getPlayerName(name), false, false) end addEventHandler("onClientGUIClick", playerList, onClickPlayerName) end end ,4000,0) nameEdit = guiCreateEdit(290,50,200,30,"",false,tab7) player = guiCreateLabel(365,30,300,100,' player: ',false,tab7) guiSetText ( player, getPlayerPing(source)) guiLabelSetColor(player,255,255,100) amountEdit = guiCreateEdit(335,115,100,30,"",false,tab7) money = guiCreateLabel(360,95,300,100,' money: ',false,tab7) guiSetText ( money, getPlayerPing(source)) guiLabelSetColor(money,255,255,100) sendBTN = guiCreateButton(320,165,130,36, "send", false,tab7) function onClickPlayerName () local name = guiGridListGetItemText(playerList, guiGridListGetSelectedItem(playerList), 1) guiSetText(nameEdit, name) end addEventHandler("onClientGUIClick",getRootElement(), function() if ( source == sendBTN ) then playerNick = guiGetText(nameEdit) amount = guiGetText(amountEdit) triggerServerEvent("onSendMoney", getLocalPlayer(), playerNick, amount) end end) Link to comment
nony Posted August 8, 2012 Author Share Posted August 8, 2012 شكراااااااااا عناد الله يوفقك يا شنب ساعتني كثير تسلم يا غالي Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now