Jump to content

طلب كود


EdeN

Recommended Posts

Posted

ممكن تصححولي

outputChatBox("** [ Shop Panel By : #,~==[7MoDy]== ] ***",255,255,0) 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(0.3411,0.1146,0.3389,0.7435,"مود العصابات",true) 
              guiSetVisible(GUIEditor_Window[1], false) 
GUIEditor_Button[1] = guiCreateButton(20,251,423,26,"عصابة الاوله",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(33,532,409,25,"عصابة الثانيه",false,GUIEditor_Window[1]) 
GUIEditor_Image[1] = guiCreateStaticImage(22,36,413,207,"1.png",false,GUIEditor_Window[1]) 
GUIEditor_Image[2] = guiCreateStaticImage(35,299,399,224,"2.png",false,GUIEditor_Window[1]) 
  
  
  
bindKey("F2", "down", function() 
guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) 
showCursor(guiGetVisible(GUIEditor_Window[1])) 
guiSetInputEnabled(guiGetVisible(GUIEditor_Window[1])) 
end) 
  
    function () 
        if ( source == GUIEditor_Button[1] ) then 
            BuyWeapon(50,30,50,"AK47") 
                    elseif ( source == GUIEditor_Button[2] ) then 
            BuyWeapon(50,31,50,"M4") 
  
            function () 
            setElementModel( 
             
            function onGuiClick(button, state, absoluteX, absoluteY) 
     if source == GUIEditor_Button[1] then 
          setElementPosition(localPlayer,2180.7160644531,2002.0021972656,108203125) 
          setPedRotation(localPlayer,91.98) 
     end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 
  
function onGuiClick(button, state, absoluteX, absoluteY) 
     if source == GUIEditor_Button[2] then 
          setElementPosition(localPlayer,2019.7319335938,1916.6751708984,12.34109210968) 
          setPedRotation(localPlayer,91.98) 
     end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 
  

Posted

جرب ذا

-- client side --

addEventHandler("onClientGUIClick",getRootElement(), 
function () 
    if ( source == GUIEditor_Button[1] ) then 
        setPlayerNametagColor(getLocalPlayer(),255,0,0) 
        setElementModel(getLocalPlayer(),46) 
    elseif ( source == GUIEditor_Button[2] ) then 
        setPlayerNametagColor(getLocalPlayer(),0,255,0) 
        setElementModel(getLocalPlayer(),285) 
    end 
end) 
  

Posted
جرب ذا

-- client side --

addEventHandler("onClientGUIClick",getRootElement(), 
function () 
    if ( source == GUIEditor_Button[1] ) then 
        setPlayerNametagColor(getLocalPlayer(),255,0,0) 
        setElementModel(getLocalPlayer(),46) 
    elseif ( source == GUIEditor_Button[2] ) then 
        setPlayerNametagColor(getLocalPlayer(),0,255,0) 
        setElementModel(getLocalPlayer(),285) 
    end 
end) 
  

هو شغلته بس انه مايطلع ولا شيء

Posted

client

addEventHandler("onClientGUIClick",root, 
function( ) 
    if ( source == GUIEditor_Button[1] ) then 
        triggerServerEvent("Changing1",localPlayer) 
    elseif ( source == GUIEditor_Button[2] ) then 
        triggerServerEvent("Changing2",localPlayer) 
    end 
end) 

server

addEvent("Changing1",true) 
addEventHandler("Changing1",root, 
function( ) 
    setPlayerNametagColor(client,255,0,0) 
    setElementModel(client,46) 
end) 
  
addEvent("Changing2",true) 
addEventHandler("Changing2",root, 
function( ) 
    setPlayerNametagColor(client,0,255,0) 
    setElementModel(client,285) 
end) 

Posted
client
addEventHandler("onClientGUIClick",root, 
function( ) 
    if ( source == GUIEditor_Button[1] ) then 
        triggerServerEvent("Changing1",localPlayer) 
    elseif ( source == GUIEditor_Button[2] ) then 
        triggerServerEvent("Changing2",localPlayer) 
    end 
end) 

server

addEvent("Changing1",true) 
addEventHandler("Changing1",root, 
function( ) 
    setPlayerNametagColor(client,255,0,0) 
    setElementModel(client,46) 
end) 
  
addEvent("Changing2",true) 
addEventHandler("Changing2",root, 
function( ) 
    setPlayerNametagColor(client,0,255,0) 
    setElementModel(client,285) 
end) 

مش شغال :shock:

Posted

سيرفر

  
addEvent("Changing1",true) 
addEventHandler("Changing1",root, 
    function( ) 
        setPlayerNametagColor(source,255,0,0) 
        setElementModel(source,46) 
    end 
) 
      
addEvent("Changing2",true) 
addEventHandler("Changing2",root, 
    function( ) 
        setPlayerNametagColor(source,0,255,0) 
        setElementModel(source,285) 
    end 
)    
  

Posted
سيرفر
  
addEvent("Changing1",true) 
addEventHandler("Changing1",root, 
    function( ) 
        setPlayerNametagColor(source,255,0,0) 
        setElementModel(source,46) 
    end 
) 
      
addEvent("Changing2",true) 
addEventHandler("Changing2",root, 
    function( ) 
        setPlayerNametagColor(source,0,255,0) 
        setElementModel(source,285) 
    end 
)    
  

مش شغال

Posted
حط كود الكلينت كامل

مع كود السيرفر كامل

كلنت

outputChatBox("** [ Gang Panel By : #,~==[7MoDy]== ] ***",255,255,0) 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(0.3411,0.1146,0.3389,0.7435,"مود العصابات",true) 
              guiSetVisible(GUIEditor_Window[1], false) 
GUIEditor_Button[1] = guiCreateButton(20,251,423,26,"عصابة الاوله",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(33,532,409,25,"عصابة الثانيه",false,GUIEditor_Window[1]) 
GUIEditor_Image[1] = guiCreateStaticImage(22,36,413,207,"1.png",false,GUIEditor_Window[1]) 
GUIEditor_Image[2] = guiCreateStaticImage(35,299,399,224,"2.png",false,GUIEditor_Window[1]) 
  
  
  
bindKey("F2", "down", function() 
guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) 
showCursor(guiGetVisible(GUIEditor_Window[1])) 
guiSetInputEnabled(guiGetVisible(GUIEditor_Window[1])) 
end) 
  
    function () 
        if ( source == GUIEditor_Button[1] ) then 
            BuyWeapon(50,30,50,"AK47") 
                    elseif ( source == GUIEditor_Button[2] ) then 
            BuyWeapon(50,31,50,"M4") 
  
            function () 
            setElementModel( 
            
           function BuyWeapon(money,id,ammo,name) 
    local m1 = getPlayerMoney(getLocalPlayer()) 
    if ( m1 >= money ) then 
        takePlayerMoney(money) 
        triggerServerEvent("onBuy",getLocalPlayer(),id,ammo) 
        outputChatBox("* You Are Bought " .. name .. "",0,255,0,true) 
    else 
        outputChatBox("* You Don't Have Enough Money",255,0,0,true) 
    end 
end 
  

سيرفر

            function onGuiClick(button, state, absoluteX, absoluteY) 
     if source == GUIEditor_Button[1] then 
          setElementPosition(localPlayer,2180.7160644531,2002.0021972656,108203125) 
          setPedRotation(localPlayer,91.98) 
     end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 
  
function onGuiClick(button, state, absoluteX, absoluteY) 
     if source == GUIEditor_Button[2] then 
          setElementPosition(localPlayer,2019.7319335938,1916.6751708984,12.34109210968) 
          setPedRotation(localPlayer,91.98) 
     end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 
  
  
addEvent("onBuy",true) 
addEventHandler("onBuy",getRootElement(), 
    function (id,ammo) 
        giveWeapon(source,id,ammo) 
    end 
) 
  

Posted (edited)

جرب

-- Client 
outputChatBox("** [ Gang Panel By : #,~==[7MoDy]== ] ***",255,255,0) 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(0.3411,0.1146,0.3389,0.7435,"مود العصابات",true) 
guiSetVisible(GUIEditor_Window[1], false) 
GUIEditor_Button[1] = guiCreateButton(20,251,423,26,"عصابة الاوله",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(33,532,409,25,"عصابة الثانيه",false,GUIEditor_Window[1]) 
GUIEditor_Image[1] = guiCreateStaticImage(22,36,413,207,"1.png",false,GUIEditor_Window[1]) 
GUIEditor_Image[2] = guiCreateStaticImage(35,299,399,224,"2.png",false,GUIEditor_Window[1])               
  
function Open() 
    if ( guiGetVisible(GUIEditor_Window[1]) == true ) then 
        guiSetVisible(GUIEditor_Window[1],false) 
        showCursor(false) 
        guiSetInputEnabled ( false ) 
    else 
        guiSetVisible(GUIEditor_Window[1],true) 
        showCursor(true) 
        guiSetInputEnabled ( true )  
    end 
end  bindKey ( "F2", "down", Open ) 
  
function Click() 
    if ( source == GUIEditor_Button[1] ) then 
        triggerServerEvent("onSelection1",localPlayer) 
    elseif ( source == GUIEditor_Button[2] ) then 
        triggerServerEvent("onSelection2",localPlayer) 
    end 
end addEventHandler("onClientGUIClick",root,Click) 
  

+

-- Server 
addEvent("onSelection1",true)  
function theFirst() 
    setPlayerNametagColor(source,255,0,0) 
    setElementModel(source,46) 
    giveWeapon(source,30,50) 
end addEventHandler("onSelection1", root, theFirst) 
     
addEvent("onSelection2",true)      
function theSecond() 
    setPlayerNametagColor(source,0,255,0) 
    setElementModel(source,285) 
    giveWeapon(source,31,50) 
end addEventHandler("onSelection2", root, theSecond) 
  

Edited by Guest
Posted

طبعاً ماله تأثير و الكود بيشتغل بس للتنبيه فقط

واحد فقط argument في له guiGetVisible الكود

و أنت حاط أثنين

if guiGetVisible(GUIEditor_Window[1],true) then 

Posted
حط كود الكلينت كامل

مع كود السيرفر كامل

كلنت

outputChatBox("** [ Gang Panel By : #,~==[7MoDy]== ] ***",255,255,0) 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(0.3411,0.1146,0.3389,0.7435,"مود العصابات",true) 
              guiSetVisible(GUIEditor_Window[1], false) 
GUIEditor_Button[1] = guiCreateButton(20,251,423,26,"عصابة الاوله",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(33,532,409,25,"عصابة الثانيه",false,GUIEditor_Window[1]) 
GUIEditor_Image[1] = guiCreateStaticImage(22,36,413,207,"1.png",false,GUIEditor_Window[1]) 
GUIEditor_Image[2] = guiCreateStaticImage(35,299,399,224,"2.png",false,GUIEditor_Window[1]) 
  
  
  
bindKey("F2", "down", function() 
guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) 
showCursor(guiGetVisible(GUIEditor_Window[1])) 
guiSetInputEnabled(guiGetVisible(GUIEditor_Window[1])) 
end) 
  
    function () 
        if ( source == GUIEditor_Button[1] ) then 
            BuyWeapon(50,30,50,"AK47") 
                    elseif ( source == GUIEditor_Button[2] ) then 
            BuyWeapon(50,31,50,"M4") 
  
            function () 
            setElementModel( 
            
           function BuyWeapon(money,id,ammo,name) 
    local m1 = getPlayerMoney(getLocalPlayer()) 
    if ( m1 >= money ) then 
        takePlayerMoney(money) 
        triggerServerEvent("onBuy",getLocalPlayer(),id,ammo) 
        outputChatBox("* You Are Bought " .. name .. "",0,255,0,true) 
    else 
        outputChatBox("* You Don't Have Enough Money",255,0,0,true) 
    end 
end 
  

سيرفر

            function onGuiClick(button, state, absoluteX, absoluteY) 
     if source == GUIEditor_Button[1] then 
          setElementPosition(localPlayer,2180.7160644531,2002.0021972656,108203125) 
          setPedRotation(localPlayer,91.98) 
     end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 
  
function onGuiClick(button, state, absoluteX, absoluteY) 
     if source == GUIEditor_Button[2] then 
          setElementPosition(localPlayer,2019.7319335938,1916.6751708984,12.34109210968) 
          setPedRotation(localPlayer,91.98) 
     end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 
  
  
addEvent("onBuy",true) 
addEventHandler("onBuy",getRootElement(), 
    function (id,ammo) 
        giveWeapon(source,id,ammo) 
    end 
) 
  

onClientGUIClick

كلنت بس وانت حاطها سيرفر ؟؟؟

Posted
جرب
-- Client 
outputChatBox("** [ Gang Panel By : #,~==[7MoDy]== ] ***",255,255,0) 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(0.3411,0.1146,0.3389,0.7435,"مود العصابات",true) 
guiSetVisible(GUIEditor_Window[1], false) 
GUIEditor_Button[1] = guiCreateButton(20,251,423,26,"عصابة الاوله",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(33,532,409,25,"عصابة الثانيه",false,GUIEditor_Window[1]) 
GUIEditor_Image[1] = guiCreateStaticImage(22,36,413,207,"1.png",false,GUIEditor_Window[1]) 
GUIEditor_Image[2] = guiCreateStaticImage(35,299,399,224,"2.png",false,GUIEditor_Window[1])               
  
function Open() 
    if ( guiGetVisible(GUIEditor_Window[1]) == true ) then 
        guiSetVisible(GUIEditor_Window[1],false) 
        showCursor(false) 
        guiSetInputEnabled ( false ) 
    else 
        guiSetVisible(GUIEditor_Window[1],true) 
        showCursor(true) 
        guiSetInputEnabled ( true )  
    end 
end  bindKey ( "F2", "down", Open ) 
  
function Click() 
    if ( source == GUIEditor_Button[1] ) then 
        triggerServerEvent("onSelection1",localPlayer) 
    elseif ( source == GUIEditor_Button[2] ) then 
        triggerServerEvent("onSelection2",localPlayer) 
    end 
end addEventHandler("onClientGUIClick",root,Click) 
  

+

-- Server 
addEvent("onSelection1",true)  
function theFirst() 
    setPlayerNametagColor(source,255,0,0) 
    setElementModel(source,46) 
    giveWeapon(source,30,50) 
end addEventHandler("onSelection1", root, theFirst) 
     
addEvent("onSelection2",true)      
function theSecond() 
    setPlayerNametagColor(source,0,255,0) 
    setElementModel(source,285) 
    giveWeapon(source,31,50) 
end addEventHandler("onSelection2", root, theSecond) 
  

عناد الي عطيتني مو كامل بس شغل

انا الحين اكمله

مشكور

عناد

تابل

عاشق

طلال

مستر طلال

العقرب

Tete omar

Posted
العفو اي مشكله ثانيه لا يردك غير الكيبورد

تســـلـــــــــــــــــــــــــــــــــــ :) ـم

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