Mars2 Posted October 10, 2015 Share Posted October 10, 2015 كلنت --[[------------------------------------------------- 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
xBeSoOo Posted October 10, 2015 Share Posted October 10, 2015 الخطاء هنا 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
GraveDigger. Posted October 10, 2015 Share Posted October 10, 2015 (edited) 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 October 10, 2015 by Guest Link to comment
xBeSoOo Posted October 10, 2015 Share Posted October 10, 2015 كلنت --[[------------------------------------------------- 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
' A F . Posted October 10, 2015 Share Posted October 10, 2015 @GraveDigger. getPlayerMoney مأفيه ارقمنت اللاعب بالكلنت .. Link to comment
GraveDigger. Posted October 10, 2015 Share Posted October 10, 2015 @GraveDigger.getPlayerMoney مأفيه ارقمنت اللاعب بالكلنت .. شكراً علي تنبيهك Link to comment
' A F . Posted October 11, 2015 Share Posted October 11, 2015 @GraveDigger.getPlayerMoney مأفيه ارقمنت اللاعب بالكلنت .. شكراً علي تنبيهك العفو 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