EdeN Posted October 5, 2012 Share Posted October 5, 2012 طلب كود الشخصيات مثل العصابات يضغط وتتغير الشخصيه Link to comment
EdeN Posted October 5, 2012 Author Share Posted October 5, 2012 ممكن تصححولي 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) Link to comment
|Mr|-Talal07-| Posted October 5, 2012 Share Posted October 5, 2012 جرب ذا -- 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) Link to comment
EdeN Posted October 5, 2012 Author Share Posted October 5, 2012 جرب ذا-- 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) هو شغلته بس انه مايطلع ولا شيء Link to comment
Tete omar Posted October 5, 2012 Share Posted October 5, 2012 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) Link to comment
==>ҭᾄlᾄl Posted October 5, 2012 Share Posted October 5, 2012 لاحظت خطا في كودك راجع الموضوع ذا viewtopic.php?f=119&t=47731 Link to comment
EdeN Posted October 6, 2012 Author Share Posted October 6, 2012 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) مش شغال Link to comment
3NAD Posted October 6, 2012 Share Posted October 6, 2012 سيرفر 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 ) Link to comment
EdeN Posted October 7, 2012 Author Share Posted October 7, 2012 سيرفر 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 ) مش شغال Link to comment
TAPL Posted October 7, 2012 Share Posted October 7, 2012 حط كود الكلينت كامل مع كود السيرفر كامل Link to comment
EdeN Posted October 7, 2012 Author Share Posted October 7, 2012 حط كود الكلينت كاملمع كود السيرفر كامل كلنت 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 ) Link to comment
3NAD Posted October 7, 2012 Share Posted October 7, 2012 (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 October 7, 2012 by Guest Link to comment
TAPL Posted October 7, 2012 Share Posted October 7, 2012 طبعاً ماله تأثير و الكود بيشتغل بس للتنبيه فقط واحد فقط argument في له guiGetVisible الكود و أنت حاط أثنين if guiGetVisible(GUIEditor_Window[1],true) then Link to comment
abu5lf Posted October 7, 2012 Share Posted October 7, 2012 حط كود الكلينت كاملمع كود السيرفر كامل كلنت 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 كلنت بس وانت حاطها سيرفر ؟؟؟ Link to comment
EdeN Posted October 7, 2012 Author Share Posted October 7, 2012 جرب -- 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 Link to comment
==>ҭᾄlᾄl Posted October 7, 2012 Share Posted October 7, 2012 العفو اي مشكله ثانيه لا يردك غير الكيبورد Link to comment
EdeN Posted October 7, 2012 Author Share Posted October 7, 2012 العفو اي مشكله ثانيه لا يردك غير الكيبورد تســـلـــــــــــــــــــــــــــــــــــ ـم 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