• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Quick question

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
Whats the problem with an if ?

You can always create a function that will show a text message to the player you give it, if a if is so bad.

[edit] yes what you typed there is right, beside the fact that you need to call a text function lol (example: BJDebugMsg("hello friends !!")).
 
Level 6
Joined
Jun 30, 2006
Messages
230
JASS:
call DisplayTextToPlayer(Player(p), 0, 0, "I just display to 1 player!")

Just replace p with which player you want.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
... But BJDebugMsg will show up to all player rit ?

Not in this case because you selected only the certain player you put in the condition.

Besides how can I write a function to only 1 player ??
Anyway, I may use a groupforce, it seems the best way to do it ...

You mean something like this ?
JASS:
function func takes player p returns nothing
    call DisplayTextToPlayer(p, 0, 0, "I just display to player p!")
endfunction

Then you call it with "call func(somePlayer)".

And yes, I know this function is useless as it doubles the original DisplayTextToPlayer function. It was just an example.

By the way, what those x,y values mean ? never got that part lol :p
 
Last edited:
Level 6
Joined
Jun 30, 2006
Messages
230
Noticed that
JASS:
function func takes player p returns nothing
should be
JASS:
function func takes integer p returns nothing
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Use the GetLocalPlayer action.
If for example you want to show it for a owner of a unit, make a line like this:

JASS:
if GetLocalPlayer() == GetOwningPlayer(yourUnit) then
      // show message
endif
.

*thanks to Need_O2 again ^^*

LOL

DisplayTimedTextToPlayer
NATIVE
 
Status
Not open for further replies.
Top