• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] How can i Hide Text from another player and show it to others

Status
Not open for further replies.
Level 10
Joined
Sep 21, 2007
Messages
517
Someone please delete this Thread-----------------------------------

Also you guys should know i dont really use JASS since i just use it to remove leaks and such.

Squelching Problem:
Just yesterday i started working on a easy but customizable chat system, i added some features to it, and today, just now, i started working on a Squelch feature
where if you type Squelch ## then the triggering player will not be able to see the row of the number typed. i already know how to do the subtrings part and such but when you hide text or icons in a multiboard it will hide it all when it is in gui, so im thinking there might be a way for this in jass using GetLocalPlayer or such functions but im not able to really make them work well since im not such a wizz with Compile errors.

~~Nevermind, Function ceases to work since blizzard only hides/unhides full multiboard :[.

Thanks for the help diablo-dk but the blizzards function doesnt work, it only hides/unhides the multiboard and not specific Rows/Columns :(
 
Last edited:
JASS:
    if GetLocalPlayer() == whichPlayer then
        // Display message here.
    endif

It can also be done in gui by using the custom script action:
  • Custom script: if GetLocalPlayer() == Player(0)
  • // Some actions here
  • Custom script: endif
This trigger does whatever actions you put inside the "box" for "Player(0)".

Put the actions that you want to be shown for the specific player(s) in the "box".

For more information on GetLocalPlayer():
http://www.hiveworkshop.com/forums/showthread.php?t=33776
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
he wants to know how to make a PM system
like he types "Squelch omg this is totally lame"
no one will be able to see that
well you can clear text messages after this but they can check from chat screen
send a message to observers for commands xD
 
Level 4
Joined
Jun 8, 2004
Messages
66
Here's an example from my map that doesn't use getlocalplayer.

JASS:
// Display text to a range of players
function jrp_func_DisplayTextToRange takes integer start, integer end, string text returns nothing
	loop
	exitwhen start > end
		call DisplayTextToPlayer(Player(start), 0, 0, text)
	set start = start + 1
	endloop
endfunction


Now, as far as a PM system goes, it would be easier to trigger in sending the message to a single player rather than sending it to everyone and then try to hide it.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
[jass=A better implementation of that function]function jrp_func_DisplayTextToRange takes integer start, integer end, string text returns nothing
if GetPlayerId(GetLocalPlayer()) >= start and GetPlayerId(GetLocalPlayer()) <= end then
call DisplayTextToPlayer(GetLocalPlayer(),0,0,text)
endif
endfunction[/code]
 
Status
Not open for further replies.
Top