Jump to content

ما الخطأ


Mars2

Recommended Posts

كلنت

--[[------------------------------------------------- 
Notes: 
  
> This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running. 
    To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there. 
--]]------------------------------------------------- 
  
  
GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(457, 210, 333, 303, "شراء الاسلحة", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.staticimage[1] = guiCreateStaticImage(10, 25, 138, 113, ":guieditor/images/pp.png", false, GUIEditor.window[1]) 
        GUIEditor.button[1] = guiCreateButton(9, 148, 139, 38, "1000/15000$", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(265, 252, 58, 41, "x", false, GUIEditor.window[1])     
    end 
) 
  
  
  
addEventHandler('onClientGUIClick', root,ss,  
   function ( )  
   local money = getPlayerMoney(thePlayer) 
        if money > 15000) 
    if ( source == GUIEditor.button[1] ) then  
    triggerServerEvent('M4', localPlayer)  
   end  
end  
)  
  
  
  

سيرفر

    addEvent('M4', true)   
    addEventHandler('M4', root,  
    function ( )  
        takePlayerMoney ( 15000 ) 
        giveWeapon( source, 31, 1000 )  
        outputChatBox('تم اعطائك سلاح 1000 طقلة', source, 255, 0 ,0 )  
    end 
     
    ) 

لما اجي اشتري سلاح من اللوحة ما يشتري

Link to comment

الخطاء هنا

addEventHandler('onClientGUIClick', root,ss, 
   function ( ) 
   local money = getPlayerMoney(thePlayer) 
        if money > 15000) 
    if ( source == GUIEditor.button[1] ) then 
    triggerServerEvent('M4', localPlayer) 
   end 
end 
) 

سوي كذا

addEventHandler('onClientGUIClick', root,  
   function ( ) 
   local money = getPlayerMoney(getLocalPlayer () ) 
        if money > 15000) 
    if ( source == GUIEditor.button[1] ) then 
    triggerServerEvent('M4', localPlayer) 
   end 
end 
) 

Link to comment

Client

GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {} 
} 
        GUIEditor.window[1] = guiCreateWindow(457, 210, 333, 303, "شراء الاسلحة", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.staticimage[1] = guiCreateStaticImage(10, 25, 138, 113, ":guieditor/images/pp.png", false, GUIEditor.window[1]) 
        GUIEditor.button[1] = guiCreateButton(9, 148, 139, 38, "1000/15000$", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(265, 252, 58, 41, "x", false, GUIEditor.window[1])     
  
   function ss( thePlayer ) -- ( نسيت الوظيفة | ss | thePlayer ) 
    if ( source == GUIEditor.button[1] ) then -- لازم ترتب صح 
   local money = getPlayerMoney( ) 
        if ( money > 15000 ) -- قوس ناقص 
    triggerServerEvent('M4', localPlayer) 
   end 
end 
end -- اند ناقصة عشان الفنشكن 
addEventHandler('onClientGUIClick', root,ss) -- "ss" لازم يكون تحت عشان الوظيفة  
  

Server

   addEvent('M4', true)   
    addEventHandler('M4', root, 
    function ( ) 
        takePlayerMoney ( source , 15000 ) -- سورس ناقص 
        giveWeapon( source, 31, 1000 ) 
        outputChatBox('تم اعطائك سلاح 1000 طقلة', source, 255, 0 ,0 ) 
    end 
    ) 
Edited by Guest
Link to comment
كلنت
--[[------------------------------------------------- 
Notes: 
  
> This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running. 
    To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there. 
--]]------------------------------------------------- 
  
  
GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(457, 210, 333, 303, "شراء الاسلحة", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.staticimage[1] = guiCreateStaticImage(10, 25, 138, 113, ":guieditor/images/pp.png", false, GUIEditor.window[1]) 
        GUIEditor.button[1] = guiCreateButton(9, 148, 139, 38, "1000/15000$", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(265, 252, 58, 41, "x", false, GUIEditor.window[1])     
    end 
) 
  
  
  
addEventHandler('onClientGUIClick', root,  
   function ( )  
    if ( source == GUIEditor.button[1] ) then  
    triggerServerEvent('M4', localPlayer)  
   end  
end  
)  
  
  
  

سيرفر

    addEvent('M4', true)   
    addEventHandler('M4', root,  
    function ( )  
        local Pmoney = getPlayerMoney ( source ) 
        if Pmoney >= 15000 then 
        takePlayerMoney ( 15000 ) 
        giveWeapon( source, 31, 1000 )  
        outputChatBox('تم عطائك سلاح 1000 طقلة', source, 255, 0 ,0 )  
        else 
        outputChatBox('لا تملك مال يكفي للشراء', source, 255, 0 ,0 ) 
    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...