' A F . Posted December 18, 2014 Share Posted December 18, 2014 السسلام عليكم ورحمةة الله وبركآتهه انا أبغى فنكشنات المطعم ! انا بسويه قريد ليسست طبعاً بس آبي الفنكشنآتت * آبيه اذا حدد على اي شي الي فـ القريد ليست وظغط زر Buy يشتري الاكل ويجيه دم ! i Love All Link to comment
#DRAGON!FIRE Posted December 18, 2014 Share Posted December 18, 2014 حبيبي انت بمنتدى عربي بالنسبة لطلبكـ : Event : "onClientGUIClick" guiGridListGetSelectedItem guiGridListGetItemText triggerServerEvent setElementHealth Link to comment
' A F . Posted December 18, 2014 Author Share Posted December 18, 2014 * Client Side : addEventHandler("onClientGUIClick",root, function () if source == Buy then local sel = guiGridListGetSelectedItem(grid) if sel ~= -1 then local ProGamer = tonumber(guiGridListGetItemData(grid,sel,1)) triggerServerEvent("Food",localPlayer,ProGamer, sel) end end end ) Server Side : addEvent("Food",true) addEventHandler("Food",root, function ( Health ) setElementHealth(source,Health) end ) بـ النسبهة لـ SetElementHealth م عرفتله كثير Link to comment
LaCosTa Posted December 18, 2014 Share Posted December 18, 2014 addEventHandler("onClientGUIClick",ButtonName, function () if source == Buy then local sel = guiGridListGetSelectedItem(grid) if sel ~= -1 then local ProGamer = tonumber(guiGridListGetItemData(grid,sel,1)) triggerServerEvent("Food",localPlayer,ProGamer, sel) end end end ) addEvent("Food",true) addEventHandler("Food",root, function ( ) health = getElementHealth(source) setElementHealth(source,health + 20) if (health == 100) then return end end ) Link to comment
' A F . Posted December 18, 2014 Author Share Posted December 18, 2014 مشكور ZA7F , Cmtv طيب ممكن فنكشنآت مثال دمه كامل واذا آشترى شيء يجيه كلام فـ الشات Link to comment
nxFairlywell Posted December 18, 2014 Share Posted December 18, 2014 ضيف تحقق لما يضغط زر الشراء if source == Buy then if getElementHealth(localPlayer) == 100 then outputChatBox("You can't buy") else ودور على السطر هذا if source == Buy then else وانسخ الكلام الي تحت وحطه تحت كلمة Link to comment
' A F . Posted December 18, 2014 Author Share Posted December 18, 2014 ممكن تستخدمها كذا Text Link to comment
' A F . Posted December 18, 2014 Author Share Posted December 18, 2014 بأندول ! انا أقول اذا دمه [ 100 ] ء م يقدر يشتري شيء Link to comment
justboy Posted December 18, 2014 Share Posted December 18, 2014 if getElementHealth(source) == 100 then return outputChatBox("Text",source,255,255,255,true) end Link to comment
' A F . Posted December 19, 2014 Author Share Posted December 19, 2014 صآر م يشتري جربت حق جنرال م يشتري و الدي بوق م يقول شيء و جربت حق باندول ونفس الشيء Link to comment
M7mD-911 Posted December 19, 2014 Share Posted December 19, 2014 if ( getElementHealth ( source ) == 100 ) then outputChatBox ( "Text", source, 255, 255, 255, true ) return end Link to comment
</Mr.Tn6eL> Posted December 20, 2014 Share Posted December 20, 2014 if getElementHealth(source) ~= 100 then -- Code else outputChatBox("Your Full Health You can not buy", source) end Link to comment
' A F . Posted December 20, 2014 Author Share Posted December 20, 2014 يشتري حتى لو كان دمه كامل Client Side : wnd = guiCreateWindow(282,148,361,421,"Foods ",false) grid = guiCreateGridList(12,32,211,376,false,wnd) guiGridListSetSelectionMode(grid,2) guiGridListAddColumn(grid,"# Food",0.7) Buy = guiCreateButton(229,88,123,29,"* Buy",false,wnd) close = guiCreateButton(229,155,123,29,"* Close",false,wnd) addEventHandler("onClientGUIClick",Buy, function () if source == Buy then local sel = guiGridListGetSelectedItem(grid) if getElementHealth(source) ~= 100 then else outputChatBox("Your Full Health You can not buy", source) end if sel ~= -1 then local ProGamer = tonumber(guiGridListGetItemData(grid,sel,1)) triggerServerEvent("Food",localPlayer,ProGamer, sel) end end end ) addEventHandler("onClientGUIClick",root, function () if source == Close then guiSetVisible(wnd, false) showCursor( false ) end end ) addCommandHandler("Open", function () guiSetVisible(wnd,true) showCursor( true ) end ) Food = { {"Food",500}, } for i,veh in ipairs(Food) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) guiGridListSetItemColor ( grid, row, 1, math.random(255), math.random(255), math.random(255) ) end Server Side : addEvent("Food",true) addEventHandler("Food",root, function ( id ) local Money = getPlayerMoney(source) if Money > id then takePlayerMoney(source,id) health = getElementHealth(source) setElementHealth(source,health + 20) end end ) ياليت مسأعدهه Link to comment
</Mr.Tn6eL> Posted December 20, 2014 Share Posted December 20, 2014 Server Side addEvent("Food",true) addEventHandler("Food",root, function ( id ) local Money = getPlayerMoney(source) if Money > id then if getElementHealth(source) ~= 100 then takePlayerMoney(source,id) health = getElementHealth(source) setElementHealth(source,health + 20) else outputChatBox("Your Full Health You can not buy", source) end end end) Link to comment
' A F . Posted December 20, 2014 Author Share Posted December 20, 2014 يعطيكم العافيهة لكل من ساعدني تمت الافأدهه من قبل تنطيل Link to comment
</Mr.Tn6eL> Posted December 20, 2014 Share Posted December 20, 2014 العفو ... بالخدمة 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