Jump to content

طلب


Recommended Posts

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

مم عليش عدلته لك عع السريع

* 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
مثال لتوزيع الفلوس لكل الاعبين

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

كلنت

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

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