Jump to content

وين كبار المبرمجين


Recommended Posts

السلام عليكم

انا سويت لوحه و بيها 2 قريد ليست و 2 بوتون

الأول به اسامى اللاعبين الموجودين فى السيرفر

الثانى سويت به الأسلحه

البوتون الأول يعطى اللاعب الى انت محدده من القائمه

البوتون الثانى يعطى الكل السلاح الى انت محدده

انا الحين كل شئ تمام فى القريد ليست ابى فنكشنات حق الأزرار

كلنت و سيرفر لو سمحت

معليش طولت فى الحديث

================================

هذا زر تحويل الى لاعب واحد

كلينت

addEventHandler("onClientGUIClick",root, 
 function () 
 if source == GUIEditor.button[1] then 
    swep = guiGridListGetItemText (wep, guiGridListGetSelectedItem (wep), 1)  
    sply = guiGetText(nameEdit) 
    samo = guiGetText (amo) 
    triggerServerEvent("player", getLocalPlayer(), swep, sply, samo ) 
  end 
 end 
) 
  

سيرفر

addEvent("player", true) 
addEventHandler("player", getRootElement(), 
function(swep, sply, samo) 
  
if tonumber(samo) >= 1 then 
  
players = getPlayerFromName(sply) 
  
givePedWeapon (players, swep, samo ) 
  
end 
end 
) 

اتمنى حل

Edited by Guest
Link to comment

هذا زر تحويل الى لاعب واحد

كلينت

addEventHandler("onClientGUIClick",root, 
 function () 
 if source == GUIEditor.button[1] then 
    swep = guiGridListGetItemText (wep, guiGridListGetSelectedItem (wep), 1)  
    sply = guiGetText(nameEdit) 
    samo = guiGetText (amo) 
    triggerServerEvent("player", getLocalPlayer(), swep, sply, samo ) 
  end 
 end 
) 
  

سيرفر

addEvent("player", true) 
addEventHandler("player", getRootElement(), 
function(swep, sply, samo) 
  
if tonumber(samo) >= 1 then 
  
players = getPlayerFromName(sply) 
  
givePedWeapon (players, swep, samo ) 
  
end 
end 
) 

اتمنى حل

Link to comment

Client side #

addEventHandler ("onClientGUIClick", resourceRoot,  
    function () 
        if (source == GUIEditor.button[1]) then 
            local swep = guiGridListGetItemText (wep, guiGridListGetSelectedItem (wep), 1) 
            local sply = guiGetText (nameEdit) 
            local samo = guiGetText (amo) 
            if (swep and swep ~= "") then 
                local plrName = getPlayerFromName (spy) 
                if (sply ~= "") then 
                    if (tonumber (samo) ~= nil) then 
                        if (plrName) then 
                            triggerServerEvent ("player", localPlayer, plrName, swep, samo) 
                        else 
                            outputChatBox ("Player not found.", 255, 0, 0) 
                        end 
                    else 
                        outputChatBox ("Only numbers are allowed.", 255, 0, 0) 
                    end 
                else 
                    outputChatBox ("You must write a name.", 255, 0, 0) 
                end 
            else 
                outputChatBox ("You must select a weapon.", 255, 0, 0) 
            end 
        end 
    end 
) 

Server side #

addEvent ("player", true) 
addEventHandler ("player", root,  
      function (plr, weapon, ammo) 
            if tonumber (ammo) >= 1 then 
                  giveWeapon (plr, weapon, ammo) 
            end 
      end 
) 
Link to comment
Client side #

addEventHandler ("onClientGUIClick", resourceRoot,  
    function () 
        if (source == GUIEditor.button[1]) then 
            local swep = guiGridListGetItemText (wep, guiGridListGetSelectedItem (wep), 1) 
            local sply = guiGetText (nameEdit) 
            local samo = guiGetText (amo) 
            if (swep and swep ~= "") then 
                local plrName = getPlayerFromName (spy) 
                if (sply ~= "") then 
                    if (tonumber (samo) ~= nil) then 
                        if (plrName) then 
                            triggerServerEvent ("player", localPlayer, plrName, swep, samo) 
                        else 
                            outputChatBox ("Player not found.", 255, 0, 0) 
                        end 
  
                    else 
                        outputChatBox ("Only numbers are allowed.", 255, 0, 0) 
                    end 
                else 
                    outputChatBox ("You must write a name.", 255, 0, 0) 
                end 
            else 
                outputChatBox ("You must select a weapon.", 255, 0, 0) 
            end 
        end 
    end 
) 

Server side #

addEvent ("player", true) 
addEventHandler ("player", root,  
      function (plr, weapon, ammo) 
            if tonumber (ammo) >= 1 then 
                  giveWeapon (plr, weapon, ammo) 
            end 
      end 
) 

مشككككككوووووور الكود شغال 100%

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