Jump to content

Recommended Posts

 ฟังก์ชั่น foodshop(food_name,Price)
    player_money = getPlayerMoney(source)
            if ( player_money >= Price) ดังนั้น
                ถ้า getElementData(source,"Myslots") + 1 <= getElementData(source,"MAX_Slots") จากนั้น
                    setElementData(source,food_name,getElementData (source,food_name) + 1)
                    takePlayerMoney(source, Price)
                outputChatBox("#FF0000[TUNING] #FFFFFF ไม่ต้องซื้อ "..food_name.." และชำระเงิน "..Price.." บาท", source, 255 , 255, 255 , true)
                else
                outputChatBox("#FF0000[TUNING] #FFFFFFกระเป๋าเต็ม !!", source, 255, 255, 255 , true)
                end
            else
                outputChatBox("#FF0000[TUNING] #FFFFFFเงินของคุณไม่ พอ", แหล่งที่มา, 255, 255, 255 , true)
            end
end
addEvent("foodshop", true)
addEventHandler("foodshop", getRootElement(), foodshop) 

function foodshop(food_name,Price)
    player_money  = getPlayerMoney(source)
            if ( player_money >= Price) then
                if getElementData(source,"Myslots") + 1 <= getElementData(source,"MAX_Slots") then
                    setElementData(source,food_name,getElementData(source,food_name) + 1)
                    takePlayerMoney(source, Price)
                outputChatBox("#FF0000[TUNING] #FFFFFFคุณได้ซื้อ "..food_name.." และชำระเงิน "..Price.." บาท", source, 255, 255, 255 , true)
                else
                outputChatBox("#FF0000[TUNING] #FFFFFFกระเป๋าเต็ม !!", source, 255, 255, 255 , true)
                end
            else
                outputChatBox("#FF0000[TUNING] #FFFFFFเงินของคุณไม่พอ", source, 255, 255, 255 , true)
            end
end
addEvent("foodshop", true)
addEventHandler("foodshop", getRootElement(), foodshop)

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