+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Jul 2011
    Posts
    38

    เรื่อง item

    มีวิธีที่ทำให้ item ซื้อได้ไม่ชำหรือป่าวครับ แบบ ซื้อ 1 ครั้ง แบบคลิกซื้อครั้งที่ 1 item ก็จะลงไปที่ช่อง item hero แล้ว พอคลิกครั้งที่ 2 item ก็จะหลุดแบบมันไม่เข้าไปอยู่ใน ช่อง item hero อีกนะครับ

  2. #2
    Member
    Join Date
    Jul 2011
    Posts
    35
    ไม่น่ามีนะคับ = =


  3. #3
    Senior Member
    Join Date
    Jul 2011
    Location
    ฉันชื่อบุษบา
    Posts
    894
    แบบ ขาไม้ ใน dota สินะ ผมทำไม่เป็นหรอก - -


  4. #4
    Senior Member -pOd's Avatar
    Join Date
    Jul 2011
    Location
    ThaiCyberGames
    Posts
    704
    มีครับตอนเย็นๆเดียวผมจะเอาโค๊ตมาบอกครับ รอชักครู่ครับ
    CGnw Name : -pOd/[Ob]Pod | Nickname : โป๊ด/เป็ด



  5. #5
    Senior Member -pOd's Avatar
    Join Date
    Jul 2011
    Location
    ThaiCyberGames
    Posts
    704
    Code:
    function Trig_UniqItem_Actions takes nothing returns nothing    local integer UniqItem = 'ratf'
        local string Message = "You can only carry one of those items."
        local boolean TempBool = false
        local integer Index = 0
        if GetItemTypeId(GetManipulatedItem()) == UniqItem then
            loop
                exitwhen Index > 5
                if (GetItemTypeId(UnitItemInSlot(GetTriggerUnit(), Index)) == UniqItem) then
                    if TempBool == false then
                        set TempBool = true
                    else
                        call UnitRemoveItem(GetTriggerUnit(), UnitItemInSlot(GetTriggerUnit(), Index))
                        call DisplayTimedTextToPlayer(GetOwningPlayer(GetTriggerUnit()),0,0,5.00,Message)   
                    endif
                set Index = Index + 1
                endif
            endloop
        endif
    endfunction
    
    
    //===========================================================================
    function InitTrig_UniqItem takes nothing returns nothing
        set gg_trg_UniqItem = CreateTrigger(  )
        call TriggerRegisterAnyUnitEventBJ( gg_trg_UniqItem, EVENT_PLAYER_UNIT_PICKUP_ITEM )
        call TriggerAddAction( gg_trg_UniqItem, function Trig_UniqItem_Actions )
    endfunction
    โหลดตัวอย่าง http://www.thaicyberupload.com/get/xtxxEO2t3t

    เคดิต : RealTime_Reaper
    CGnw Name : -pOd/[Ob]Pod | Nickname : โป๊ด/เป็ด



  6. #6
    Junior Member
    Join Date
    Jun 2012
    Posts
    9
    Quote Originally Posted by -pOd View Post
    Code:
    function Trig_UniqItem_Actions takes nothing returns nothing    local integer UniqItem = 'ratf'
        local string Message = "You can only carry one of those items."
        local boolean TempBool = false
        local integer Index = 0
        if GetItemTypeId(GetManipulatedItem()) == UniqItem then
            loop
                exitwhen Index > 5
                if (GetItemTypeId(UnitItemInSlot(GetTriggerUnit(), Index)) == UniqItem) then
                    if TempBool == false then
                        set TempBool = true
                    else
                        call UnitRemoveItem(GetTriggerUnit(), UnitItemInSlot(GetTriggerUnit(), Index))
                        call DisplayTimedTextToPlayer(GetOwningPlayer(GetTriggerUnit()),0,0,5.00,Message)   
                    endif
                set Index = Index + 1
                endif
            endloop
        endif
    endfunction
    
    
    //===========================================================================
    function InitTrig_UniqItem takes nothing returns nothing
        set gg_trg_UniqItem = CreateTrigger(  )
        call TriggerRegisterAnyUnitEventBJ( gg_trg_UniqItem, EVENT_PLAYER_UNIT_PICKUP_ITEM )
        call TriggerAddAction( gg_trg_UniqItem, function Trig_UniqItem_Actions )
    endfunction
    โหลดตัวอย่าง http://www.thaicyberupload.com/get/xtxxEO2t3t

    เคดิต : RealTime_Reaper
    แบบนี้ไวกว่าไหม 'w'
    Code:
    globals
        trigger gg_trg_UniqItem=null
    endglobals
    
    function Trig_UniqItem_Actions takes nothing returns nothing
        local integer UniqItem = 'ratf'
        local string Message = "You can only carry one of those items."
        local boolean TempBool = false
        local integer Index = 0
        if UnitHasItemOfTypeBJ(GetTriggerUnit(),UniqItem)then
            call UnitRemoveItem(GetTriggerUnit(), UnitItemInSlot(GetTriggerUnit(), Index))
            call DisplayTimedTextToPlayer(GetOwningPlayer(GetTriggerUnit()),0,0,5.00,Message)
        endif   
    endfunction
    
    function InitTrig_UniqItem takes nothing returns nothing
        set gg_trg_UniqItem = CreateTrigger(  )
        call TriggerRegisterAnyUnitEventBJ( gg_trg_UniqItem, EVENT_PLAYER_UNIT_PICKUP_ITEM )
        call TriggerAddAction( gg_trg_UniqItem, function Trig_UniqItem_Actions )
    endfunction

  7. #7
    Senior Member -pOd's Avatar
    Join Date
    Jul 2011
    Location
    ThaiCyberGames
    Posts
    704
    แล้วแต่จะใช้เลยครับ
    CGnw Name : -pOd/[Ob]Pod | Nickname : โป๊ด/เป็ด



  8. #8
    Member
    Join Date
    Jul 2011
    Posts
    38
    ขอบคุณครับ

Facebook Comments


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •