[KilleR] Posted July 9, 2016 Share Posted July 9, 2016 السلام عليكم اولا : ياخوان لاحد ياخذ وينسبه كانه حقه لاني انلحس مخي وقعدت وقت اسويه انا سويت لوحه تحويل وفيها قريد ليست بوتون ايديت سويت كل شي بس مايحول local key = "F4" -- لوحتني هنا bindKey( key, "down",function() guiSetVisible (GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1]) ) showCursor ( guiGetVisible (GUIEditor.window[1]) ) end) function update () guiGridListClear(GUIEditor.gridlist[1]) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) addEventHandler ("onClientGUIClick",buttonName, function () local selected = guiGridListGetSelectedItem (GUIEditor.gridlist[1]) if selected ~= -1 and tonumber(guiGetText(GUIEditor.edit[1])) then local plrName = guiGridListGetItemText (GUIEditor.gridlist[1],selected,1) local plr = getPlayerFromName (plrName) if plr then triggerServerEvent ("Tran",localPlayer,guiGetText(GUIEditor.edit[1]),plr,plrName) end end end,false) سيرفر addEvent ("Tran",true) addEventHandler ("Tran",root, function (plr,name) if getPlayerMoney(source) >= tonumber() then givePlayerMoney(plr,tonumber() takePlayerMoney (source,tonumber() outputChatBox("تم التحويل",source,0,255,0,true) end end) Link to comment
Ahmed Ly Posted July 9, 2016 Share Posted July 9, 2016 local key = "F4" -- ---Client bindKey( key, "down",function() guiSetVisible (GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1]) ) showCursor ( guiGetVisible (GUIEditor.window[1]) ) end) function update () guiGridListClear(GUIEditor.gridlist[1]) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) addEventHandler ("onClientGUIClick",root, function () if source == buttonName then local selected = guiGridListGetSelectedItem (GUIEditor.gridlist[1]) local w = guiGetText(GUIEditor.edit[1]) if w == "" then return end local plrName = guiGridListGetItemText (GUIEditor.gridlist[1],selected,1) local plr = getPlayerFromName (plrName) triggerServerEvent ("Tran",localPlayer,w,plr) end end ) ---Server addEvent ("Tran",true) addEventHandler ("Tran",root, function (w,plr) if getPlayerMoney(source) >= tonumber(w) then givePlayerMoney(plr,tonumber(w)) takePlayerMoney (source,tonumber(w) outputChatBox("تم التحويل",source,0,255,0,true) end end end ) Link to comment
ZoOoRLS Posted July 9, 2016 Share Posted July 9, 2016 local key = "F4" -- ---Client bindKey( key, "down",function() guiSetVisible (GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1]) ) showCursor ( guiGetVisible (GUIEditor.window[1]) ) end) function update () guiGridListClear(GUIEditor.gridlist[1]) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) addEventHandler ("onClientGUIClick",root, function () if source == buttonName then local selected = guiGridListGetSelectedItem (GUIEditor.gridlist[1]) local w = guiGetText(GUIEditor.edit[1]) if w == "" then return end local plrName = guiGridListGetItemText (GUIEditor.gridlist[1],selected,1) local plr = getPlayerFromName (plrName) triggerServerEvent ("Tran",localPlayer,w,plr) end end ) ---Server addEvent ("Tran",true) addEventHandler ("Tran",root, function (w,plr) if getPlayerMoney(source) >= tonumber(w) then givePlayerMoney(plr,tonumber(w)) takePlayerMoney (source,tonumber(w)) outputChatBox("تم التحويل",source,0,255,0,true) end end) جرب كان ناقص قوس ء وفيه إند زائدههء Link to comment
Ahmed Ly Posted July 9, 2016 Share Posted July 9, 2016 GUIEditor = { gridlist = {}, window = {}, button = {}, edit = {} } GUIEditor.window[1] = guiCreateWindow(212, 86, 239, 424, "", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(14, 34, 215, 249, false, GUIEditor.window[1]) cc = guiGridListAddColumn(GUIEditor.gridlist[1], "Players", 0.9) GUIEditor.button[1] = guiCreateButton(48, 305, 155, 50, "ارسل", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.edit[1] = guiCreateEdit(62, 376, 145, 38, "", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1],false) local key = "F4" -- ---Client bindKey( key, "down",function() guiSetVisible (GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1]) ) showCursor ( guiGetVisible (GUIEditor.window[1]) ) end) function update () guiGridListClear(GUIEditor.gridlist[1]) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) addEventHandler ("onClientGUIClick",root, function () if source == GUIEditor.button[1] then local selected = guiGridListGetSelectedItem (GUIEditor.gridlist[1]) local w = guiGetText(GUIEditor.edit[1]) if w ~= "" then local plrName = guiGridListGetItemText (GUIEditor.gridlist[1],selected,cc) if plrName == "" then outputChatBox("يجب عليك اختار الاعبين من القائمه الموجود في لوحه",0,255,0) return end local plr = getPlayerFromName (plrName) triggerServerEvent ("Tran",localPlayer,w,plr) end end end ) addEvent ("Tran",true) addEventHandler ("Tran",root, function (w,plr) if getPlayerMoney(source) >= tonumber(w) then if source == plr then outputChatBox("لا يمكن ارسل المال الي نفسك",source,0,255,0) return end givePlayerMoney(plr,tonumber(w)) takePlayerMoney (source,tonumber(w)) outputChatBox("تم التحويل",source,0,255,0) else outputChatBox("ليس لديك المال الكافي",source,0,255,0) end end ) Link to comment
[KilleR] Posted July 9, 2016 Author Share Posted July 9, 2016 لم يزبط معنا لوحتي GUIEditor = { gridlist = {}, label = {}, window = {}, } GUIEditor = { edit = {}, button = {}, window = {}, label = {}, gridlist = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(188, 165, 311, 361, "Send Money", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFE9E9") GUIEditor.gridlist[1] = guiCreateGridList(13, 30, 126, 317, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Player", 0.9) GUIEditor.button[1] = guiCreateButton(149, 88, 142, 34, "Send", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(139, 53, 162, 35, "==================", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(139, 136, 162, 35, "==================", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(145, 168, 156, 36, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(139, 222, 162, 35, "==================", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(139, 273, 162, 35, "==================", false, GUIEditor.window[1]) GUIEditor.label[5] = guiCreateLabel(139, 322, 162, 35, "==================", false, GUIEditor.window[1]) end ) Link to comment
Ahmed Ly Posted July 9, 2016 Share Posted July 9, 2016 ---Client GUIEditor = { edit = {}, button = {}, window = {}, label = {}, gridlist = {} } GUIEditor.window[1] = guiCreateWindow(188, 165, 311, 361, "Send Money", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFE9E9") GUIEditor.gridlist[1] = guiCreateGridList(13, 30, 126, 317, false, GUIEditor.window[1]) cc = guiGridListAddColumn(GUIEditor.gridlist[1], "Player", 0.9) GUIEditor.button[1] = guiCreateButton(149, 88, 142, 34, "Send", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(139, 53, 162, 35, "==================", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(139, 136, 162, 35, "==================", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(145, 168, 156, 36, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(139, 222, 162, 35, "==================", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(139, 273, 162, 35, "==================", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1],false) local key = "F4" -- ---Client bindKey( key, "down",function() guiSetVisible (GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1]) ) showCursor ( guiGetVisible (GUIEditor.window[1]) ) end) function update () guiGridListClear(GUIEditor.gridlist[1]) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) addEventHandler ("onClientGUIClick",root, function () if source == GUIEditor.button[1] then local selected = guiGridListGetSelectedItem (GUIEditor.gridlist[1]) local w = guiGetText(GUIEditor.edit[1]) if w ~= "" then local plrName = guiGridListGetItemText (GUIEditor.gridlist[1],selected,cc) if plrName == "" then outputChatBox("يجب عليك اختار الاعبين من القائمه الموجود في لوحه",0,255,0) return end local plr = getPlayerFromName (plrName) triggerServerEvent ("Tran",localPlayer,w,plr) end end end ) ------ --Server addEvent ("Tran",true) addEventHandler ("Tran",root, function (w,plr) if getPlayerMoney(source) >= tonumber(w) then if source == plr then outputChatBox("لا يمكن ارسل المال الي نفسك",source,0,255,0) return end givePlayerMoney(plr,tonumber(w)) takePlayerMoney (source,tonumber(w)) outputChatBox("تم التحويل",source,0,255,0) else outputChatBox("ليس لديك المال الكافي",source,0,255,0) end end ) Link to comment
[KilleR] Posted July 9, 2016 Author Share Posted July 9, 2016 ماظبط اذا ماحددت لاعب يقول حدد واذا حولت لخويي مايحول Link to comment
' A F . Posted July 10, 2016 Share Posted July 10, 2016 Client Side : GUIEditor = { label = { } , window = { } , gridlist = { } , edit = { } , button = { } , Key = "f4" }; addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(188, 165, 311, 361, "Send Money", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFE9E9") guiSetVisible ( GUIEditor.window [ 1 ] , false ) GUIEditor.gridlist[1] = guiCreateGridList(13, 30, 126, 317, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Player", 0.9) GUIEditor.button[1] = guiCreateButton(149, 88, 142, 34, "Send", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(139, 53, 162, 35, "==================", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(139, 136, 162, 35, "==================", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(145, 168, 156, 36, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(139, 222, 162, 35, "==================", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(139, 273, 162, 35, "==================", false, GUIEditor.window[1]) GUIEditor.label[5] = guiCreateLabel(139, 322, 162, 35, "==================", false, GUIEditor.window[1]) guiSetInputEnabled ( false ) end ) function RefreshGridlist ( aElement , Col ) if ( getElementType ( aElement ) == "gui-gridlist" ) then guiGridListClear ( aElement ) Col = Col or 1 for i,v in ipairs ( getElementsByType("player") ) do local aRow = guiGridListAddRow ( aElement ) guiGridListSetItemText ( aElement , aRow , Col , getPlayerName ( v ) , false , false ) end end end bindKey(GUIEditor["Key"],"down", function ( ) guiSetVisible ( GUIEditor.window [ 1 ] , not guiGetVisible ( GUIEditor.window [ 1 ] ) ) showCursor ( guiGetVisible ( GUIEditor.window [ 1 ] ) ) guiSetInputEnabled ( guiGetVisible ( GUIEditor.window [ 1 ] ) ) RefreshGridlist ( GUIEditor.gridlist [ 1 ] ) end ); function Update ( ) RefreshGridlist ( GUIEditor.gridlist [ 1 ] ) end addEventHandler ("onClientPlayerJoin",root,Update) addEventHandler ("onClientPlayerChangeNick",root,Update) addEventHandler ("onClientPlayerQuit",root,Update) --------------------- addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == GUIEditor.button[1] ) then local InfoSelected = { guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) }; if ( InfoSelected [ 1 ] ~= -1 and guiGetText ( GUIEditor.edit[1] ) ~= "" ) then triggerServerEvent("SendMoney",getLocalPlayer(),guiGridListGetItemText(GUIEditor.gridlist[1],InfoSelected[1],InfoSelected[2]),guiGetText(GUIEditor.edit[1])) else outputChatBox("Please Select a Player or Write Money",255,0,0,true) end end end ) Server Side : addEvent("SendMoney",true) addEventHandler("SendMoney",root, function ( aPlayer , aPrice ) if ( getPlayerFromName ( aPlayer ) and tonumber ( aPrice ) ) then if ( getPlayerFromName ( aPlayer ) == source ) then return outputChatBox("* You Can't Send For YourSelf !",source,255,0,0,true) end if ( getPlayerMoney ( source ) >= tonumber ( aPrice ) ) then givePlayerMoney ( getPlayerFromName ( aPlayer ) , tonumber ( aPrice ) ) takePlayerMoney ( source , tonumber ( aPrice ) ) else outputChatBox("* You Don't Have "..aPrice.."",source,255,0,0,true) end 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