The moVer Posted April 7, 2015 Share Posted April 7, 2015 السلام عليكم اليوم ابي كود كيف اوزع فلوس من لكلاينت لكل السيرفر ملاحظة : يوزع لكل السيرفر Link to comment
' A F . Posted April 7, 2015 Share Posted April 7, 2015 توزيع الفلوس في الكلنت = وهمي Link to comment
</Mr.Tn6eL> Posted April 7, 2015 Share Posted April 7, 2015 سيرفر فقط triggerServerEvent getElementsByType givePlayerMoney Link to comment
TAPL Posted April 8, 2015 Share Posted April 8, 2015 شلون جربت وما ظبط طيب الحين ردك بأيش يفيدنا؟ حط الكود الي جربته!!! Link to comment
The moVer Posted April 9, 2015 Author Share Posted April 9, 2015 --Client Side GUIEditor = { button = {}, label = {}, checkbox = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() win = guiCreateWindow(162, 62, 474, 440, "-:توزيع فلوس:-", false) guiWindowSetSizable(win, false) guiSetAlpha(win, 0.98) guiSetVisible (win, false) GUIEditor.button[1] = guiCreateButton(289, 320, 134, 76, "توزيع", false, win) GUIEditor.edit[1] = guiCreateEdit(71, 61, 287, 54, "", false, win) GUIEditor.label[1] = guiCreateLabel(379, 71, 62, 33, "المبلغ:", false, win) GUIEditor.button[3] = guiCreateButton(10, 26, 24, 25, "X", false, win) GUIEditor.edit[2] = guiCreateEdit(75, 169, 283, 55, "", false, win) GUIEditor.checkbox[2] = guiCreateCheckBox(331, 245, 17, 15, "", false, false, win) GUIEditor.label[3] = guiCreateLabel(378, 183, 135, 78, "السبب:", false, win) GUIEditor.label[4] = guiCreateLabel(378, 239, 147, 71, "اظهار السبب:", false, win) GUIEditor.label[5] = guiCreateLabel(20, 365, 143, 75, "By:#1Ta[R]ek__)", false, win) guiSetFont(GUIEditor.label[5], "default-bold-small") end ) function we() triggerServerEvent("aa", localPlayer) end addCommandHandler ( "توزيع", we ) addEvent("openWnd", true) addEventHandler("openWnd", root, function() guiSetVisible(win, true) showCursor(true) end) addEventHandler ("onClientGUIClick", resourceRoot, function () if (source == GUIEditor.button[3]) then guiSetVisible(win, false) showCursor(false) end end) local localPlayerName = getPlayerName(getLocalPlayer()) addEventHandler ("onClientGUIClick", resourceRoot, function ( ) if (source == GUIEditor.button[1]) then if(guiCheckBoxGetSelected(GUIEditor.checkbox[2]))then triggerServerEvent("wz3", localPlayer) outputChatBox("#C0FF00you have been given #FF0000"..guiGetText ( GUIEditor.edit[1] ).."$ #C0FF00from #FF0000"..localPlayerName.. " #C0FF00because #0000FF[#FF0000"..guiGetText ( GUIEditor.edit[2] ).."#0000FF]", 255, 0, 0, true ) guiSetVisible(win, false) showCursor(false) else givePlayerMoney ( guiGetText ( GUIEditor.edit[1] ) ) guiSetVisible(win, false) showCursor(false) end end end) addEvent("notadmin", true) addEventHandler("notadmin", root, function() outputChatBox("you have to be an admin") end) --Server Side addEvent("aa", true) addEventHandler("aa", root, function() local accName = getAccountName(getPlayerAccount(client)) if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then triggerClientEvent(client, "openWnd", client) else triggerClientEvent(client, "notadmin", client) end end) addEvent("wz3", true) addEventHandler("wz3", root, function ( player ) givePlayerMoney ( player , guiGetText ( GUIEditor.edit[1] ) ) end) عتدي سؤال ثاني اذا كان الكلام الي بالشات كوده بالكلاينت هل يعطي الكلام لكل السيرفر؟؟ Link to comment
' A F . Posted April 9, 2015 Share Posted April 9, 2015 مم عليش عدلته لك عع السريع * Client : addEventHandler("onClientGUIClick",root, function ( ) if ( source == GUIEditor.button[1] ) then if ( guiCheckBoxGetSelected(GUIEditor.checkbox[2])) then local money = guiGetText(GUIEditor.edit[1]) triggerSererEvent("wz3",localPlayer, money) outputChatBox("#C0FF00you have been given #FF0000"..money.."$ #C0FF00from #FF0000"..localPlayerName.. " #C0FF00because #0000FF[#FF0000"..guiGetText ( GUIEditor.edit[2] ).."#0000FF]", 255, 0, 0, true ) elseif ( source == GUIEditor.button[3] ) then guiSetVisible(win, false) showCursor(false) end end end) * Server : addEvent("wz3", true) addEventHandler("wz3", root, function ( money ) givePlayerMoney ( source , money ) end) Link to comment
yazan Posted April 9, 2015 Share Posted April 9, 2015 لزم لوب للعبين يلي بسيرفر يا برو بعدين توزع لهم Link to comment
</Mr.Tn6eL> Posted April 9, 2015 Share Posted April 9, 2015 مثال لتوزيع الفلوس لكل الاعبين for k,v in ipairs(getElementsByType("player")) do givePlayerMoney(v, 1000) end Link to comment
The moVer Posted April 9, 2015 Author Share Posted April 9, 2015 يا شباب انا ما اعرف بالوب والقيم بسطولي المور لساتني مبتدأ Link to comment
The moVer Posted April 11, 2015 Author Share Posted April 11, 2015 مثال لتوزيع الفلوس لكل الاعبين for k,v in ipairs(getElementsByType("player")) do givePlayerMoney(v, 1000) end جربت كذا ما ظبط addEvent("wz3", true) addEventHandler("wz3", root, function ( ) for k,v in ipairs(getElementsByType("player")) do givePlayerMoney(v, guiGetText ( GUIEditor.edit[1] )) end end) انا ما ابي الف ابي المبلغ الموجود بالايدت بوكس Link to comment
shwaeki Posted April 12, 2015 Share Posted April 12, 2015 كلنت triggerServerEvent("wz3",localPlayer, tonumber(guiGetText(GUIEditor.edit[1]))) سيرفر addEvent("wz3", true) addEventHandler("wz3", root, function ( Money ) for k,v in ipairs(getElementsByType("player")) do givePlayerMoney(v, Money) 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