HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Displaying messages [new question]

04-05-2007, 07:21 PM#1
geocine
I hid all the messages using shadow's and pitzermike's tutorial.. now, i want to show every message to screen that doesn't have "-" character in it.. using displaytexttoforce... it should show the playername (withitscolor) plus the ":" and the message.. how could i do that??
04-05-2007, 08:07 PM#2
Fireeye
Here's the GUI-Way
Trigger:
Enter
Collapse Events
Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
//And so on for all Players
Collapse Conditions
(Substring((Entered chat string), 1, 1)) Not equal to -
Collapse Actions
Game - Display to (All players) the text: ((Name of (Triggering player)) + (: + (Entered chat string)))
04-06-2007, 02:51 AM#3
geocine
JASS:

Collapse JASS:
function Trig_Enter_Conditions takes nothing returns boolean
    if ( not ( SubStringBJ(GetEventPlayerChatString(), 1, 1) != "-" ) ) then
        return false
    endif
    return true
endfunction

function Trig_Enter_Actions takes nothing returns nothing
    call DisplayTextToForce( GetPlayersAll(), ( GetPlayerName(GetTriggerPlayer()) + ( ":" + GetEventPlayerChatString() ) ) )
endfunction

//===========================================================================
function InitTrig_Enter takes nothing returns nothing
    set gg_trg_Enter = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(0), "", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(1), "", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(2), "", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(3), "", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(4), "", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(5), "", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(6), "", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(7), "", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(8), "", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(9), "", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(10), "", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Enter, Player(11), "", false )
    call TriggerAddCondition( gg_trg_Enter, Condition( function Trig_Enter_Conditions ) )
    call TriggerAddAction( gg_trg_Enter, function Trig_Enter_Actions )
endfunction

Didn't seem to work.. aw

By the way.. how could i hide the messages now in the chat log... i saw something here..
Code:
http://www.thehelper.net/forums/showthread.php?t=51307
adding spaces after the names.. but i wan't something that doesn't have spaces when the user is called for example "geocine" is dead not "geocine " is dead and how to do it that doesn't affect the scoreboard at the end of game.. also when you hover the mouse to yourself you.. won't see spaces in your name??
04-06-2007, 05:51 AM#4
geocine
how about hiding a chat message for specific player