HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Floating Text not showing to just one player.

05-23-2005, 06:16 PM#1
oNdizZ
Now im having some problems with showing a floating text to just 1 player.
Ive marked where it shows the text in red. Now what happens is that it shows to all players instead of just the one i want it to show to.

Please if anyone can find anything that doesnt seem to be correct make a quick reply :p

Thx in advance.

Code:
    local location BountyPoint
    local force BountyGroup
    local texttag BountyTag
    local effect BountyEffect
    call AdjustPlayerStateBJ( S2I(SubStringBJ(I2S(GetUnitUserData(GetDyingUnit())), 4, 6)), ConvertedPlayer(S2I(SubStringBJ(I2S(GetUnitUserData(GetDyingUnit())), 1, 1))), PLAYER_STATE_RESOURCE_GOLD )
    set BountyPoint = GetUnitLoc(GetDyingUnit())
    // How Many Digits
    if ( S2I(SubStringBJ(I2S(GetUnitUserData(GetDyingUnit())), 4, 6)) < 100 ) then
        if ( S2I(SubStringBJ(I2S(GetUnitUserData(GetDyingUnit())), 4, 6)) < 10 ) then
            call CreateTextTagLocBJ( ( "|cffffcc00+" + SubStringBJ(I2S(GetUnitUserData(GetDyingUnit())), 6, 6) ), BountyPoint, 40.00, 10, 100, 100, 100, 0 )
        else
            call CreateTextTagLocBJ( ( "|cffffcc00+" + SubStringBJ(I2S(GetUnitUserData(GetDyingUnit())), 5, 6) ), BountyPoint, 40.00, 10, 100, 100, 100, 0 )
        endif
    else
        call CreateTextTagLocBJ( ( "|cffffcc00+" + SubStringBJ(I2S(GetUnitUserData(GetDyingUnit())), 4, 6) ), BountyPoint, 40.00, 10, 100, 100, 100, 0 )
    endif
    set BountyTag = GetLastCreatedTextTag()
    call SetTextTagVelocityBJ( BountyTag, 64, 90 )
    set BountyGroup = GetForceOfPlayer(ConvertedPlayer(S2I(SubStringBJ(I2S(GetUnitUserData(GetDyingUnit())), 1, 1))))
    call ShowTextTagForceBJ( false, BountyTag, udg_AllPlayers )
[color=Red]    call ShowTextTagForceBJ( true, BountyTag, BountyGroup )[/color]
    call AddSpecialEffectLocBJ( BountyPoint, "UI\\Feedback\\GoldCredit\\GoldCredit.mdl" )
    set BountyEffect = GetLastCreatedEffectBJ()
    set udg_KILLS[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] = ( udg_KILLS[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] + 1 )
    call ConditionalTriggerExecute( gg_trg_update_leaderboard )
    call PolledWait( 3.00 )
    // Clear Up
    call DestroyEffect( BountyEffect )
    call DestroyTextTag( BountyTag )
    call RemoveLocation( BountyPoint )
    call DestroyForce( BountyGroup )
    // Set To Null
    set BountyEffect = null
    set BountyTag = null
    set BountyPoint = null
    set BountyGroup = null
05-23-2005, 08:56 PM#2
Vexorian
Quote:
set BountyGroup = GetForceOfPlayer(ConvertedPlayer(S2I(SubStringBJ(I 2S(GetUnitUserData(GetDyingUnit())), 1, 1))))
I would blame that instead of ShowTextTagForceBJ . Something is fauling the Substring thing, ConvertedPlayer or the unit data.

You are doing a terrible job for storing multiple data in the unit's custom data, you could have used Handle Variasble or Attacheable Variables For that instead of numbers and substrings. Also you could use my Bounty function directly : http://www.wc3jass.com/viewtopic.php?t=101#bounty
05-26-2005, 08:27 PM#3
oNdizZ
Thanks! :)
I'll try those tomorrow (or whenever i got the time :/ )