Jump to content

* Request Function #


' A F .

Recommended Posts

السسلام عليكم ورحمةة الله وبركآتهه

انا أبغى فنكشنات المطعم !

انا بسويه قريد ليسست طبعاً

بس آبي الفنكشنآتت *

آبيه اذا حدد على اي شي الي فـ القريد ليست وظغط زر Buy يشتري الاكل ويجيه دم !

i Love All :mrgreen::mrgreen:

Link to comment

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

يشتري حتى لو كان دمه كامل :$

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

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

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