ABO.SR7777A Posted September 7, 2012 Share Posted September 7, 2012 السلام عليكم شباب انا عندي شوب وعندي كود اركبه بس يجيني مخربط تحويل الفلوس ماعرف له هذااذ هو -------------setTimer( function() playerList = guiCreateGridList(6, 6, 140, 460, false, tab4) guiGridListSetSelectionMode(playerList, 2) local cl = guiGridListAddColumn(playerList, "Players List ...", 0.85) if ( cl and guiGetVisible(GUIEditor_Window[1] ) == 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(160,150,200,30,"",false,tab4) amountEdit = guiCreateEdit(160,200,100,30,"",false,tab4) sendBTN = guiCreateButton(150,280,130,36, "send", false,tab4) -- 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) سيرفر ======= 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
===[PRO]=== Posted September 7, 2012 Share Posted September 7, 2012 server addEvent("onSendMoney", true) addEventHandler("onSendMoney", getRootElement(), function(playerNick, amount) local money = getPlayerMoney(source) if tonumber(amount) >= 200 then if money >= amount then toWho = getPlayerFromName(playerNick) if toWho ~= false then givePlayerMoney(toWho, amount ) takePlayerMoney(source, amount ) name = getPlayerName(source) outputChatBox("* You have given money amount of: #00ff00$" .. amount .. " #0099ccto: #ff0000" .. playerNick, source, 0, 150, 255, true) outputChatBox("* ".. name .. " #ff0000has given you money amount of: #00ff00$" .. amount.. " #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("* 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 ) client: setTimer( function() playerList = guiCreateGridList(6, 6, 140, 460, false, tab4) guiGridListSetSelectionMode(playerList, 2) local cl = guiGridListAddColumn(playerList, "Players List ...", 0.85) if ( cl and guiGetVisible(GUIEditor_Window[1] ) == true ) then for _,name in ipairs(getElementsByType("player")) do local rw = guiGridListAddRow(playerList) guiGridListSetItemText(playerList, rw, cl, getPlayerName(name), false, false) end end end ,4000,0) nameEdit = guiCreateEdit(160,150,200,30,"",false,tab4) amountEdit = guiCreateEdit(160,200,100,30,"",false,tab4) sendBTN = guiCreateButton(150,280,130,36, "send", false,tab4) -- function onClickPlayerName () local name = guiGridListGetItemText(playerList, guiGridListGetSelectedItem(playerList), 1) guiSetText(nameEdit, name) end addEventHandler("onClientGUIClick", playerList, onClickPlayerName) addEventHandler("onClientGUIClick",getRootElement(), function() if ( source == sendBTN ) then playerNick = guiGetText(nameEdit) amount = guiGetText(amountEdit) triggerServerEvent("onSendMoney", getLocalPlayer(), playerNick, amount) end end) 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