wc3edit.net

United Warcraft 3 map hacking!
It is currently April 19th, 2024, 4:10 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: [Jass] Eavesdrop
PostPosted: November 15th, 2012, 4:34 pm 
Offline
Forum Staff

Joined: November 3rd, 2010, 10:48 am
Posts: 1850
Location: Singapore
Title: Best Player
Can you make a -hear command like how it is in the jjcp but to be functioning independantly?
A short and sweet one please :D

_________________
Request a map? Follow the rulesHERE
Request templateHERE
Please, do not PM me.
On the side note, I'm still playing vampirism speed on malaysia room, occasionally in Garena. Bcuz too lazy to find out where else I can play them.


Top
 Profile  
 
 Post subject: Re: make a command
PostPosted: November 15th, 2012, 6:32 pm 
Offline
Tyrannical Drama Queen
User avatar

Joined: November 19th, 2007, 5:05 am
Posts: 5014
What's the difference between us copying pasting what JJ's CP did and you looking at it yourself?


Top
 Profile  
 
 Post subject: Re: make a command
PostPosted: November 15th, 2012, 8:15 pm 
Offline
Forum Staff

Joined: November 3rd, 2010, 10:48 am
Posts: 1850
Location: Singapore
Title: Best Player
Bartimaeus wrote:
What's the difference between us copying pasting what JJ's CP did and you looking at it yourself?

because I can't copy it and make it work somehow :(

_________________
Request a map? Follow the rulesHERE
Request templateHERE
Please, do not PM me.
On the side note, I'm still playing vampirism speed on malaysia room, occasionally in Garena. Bcuz too lazy to find out where else I can play them.


Top
 Profile  
 
 Post subject: Re: make a command
PostPosted: November 19th, 2012, 11:28 am 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
You are asking for help for (or actually asking us to do it for you) trigger.
Make a topic at the triggering section explaining what you want. For ex: A command that will show me what every one is writing...

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
 Post subject: Re: make a command
PostPosted: November 19th, 2012, 11:29 am 
Offline
Forum Staff

Joined: November 3rd, 2010, 10:48 am
Posts: 1850
Location: Singapore
Title: Best Player
haxorico wrote:
You are asking for help for (or actually asking us to do it for you) trigger.
Make a topic at the triggering section explaining what you want. For ex: A command that will show me what every one is writing...

okay :)

_________________
Request a map? Follow the rulesHERE
Request templateHERE
Please, do not PM me.
On the side note, I'm still playing vampirism speed on malaysia room, occasionally in Garena. Bcuz too lazy to find out where else I can play them.


Top
 Profile  
 
 Post subject: Re: make a command
PostPosted: November 19th, 2012, 2:27 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
Here is the command.

You need to type -hear to activate or deactivate it for yourself.
It won't show you your own messages.

With the player color and name
Spoiler:
Code:
globals
trigger trgStringCommands=CreateTrigger()
boolean array peopleThatCanHear
endglobals

function getPlayerColorCode takes integer pid returns string
if pid==0 then
return "|cffff0000"
elseif pid==1 then
return "|cff0000ff"
elseif pid==2 then
return "|cff00ffff"
elseif pid==3 then
return "|cff550088"
elseif pid==4 then
return "|cffffff00"
elseif pid==5 then
return "|cffff8800"
elseif pid==6 then
return "|cff00ff00"
elseif pid==7 then
return "|cffee55bb"
elseif pid==8 then
return "|cff999999"
elseif pid==9 then
return "|cff77bbff"
elseif pid==10 then
return "|cff116644"
else
return "|cff552200"
endif
endfunction

function showMessageToPeopleThatCanHear takes nothing returns nothing
local string messageToShow=(getPlayerColorCode(GetPlayerId(GetTriggerPlayer())) + GetPlayerName(GetTriggerPlayer()) + ": " + GetEventPlayerChatString())
local integer index=0
loop
exitwhen index>11
if (peopleThatCanHear[index]) and index!=GetPlayerId(GetTriggerPlayer())then
call DisplayTextToPlayer(Player(index),0,0,messageToShow)
endif
set index=index+1
endloop
set messageToShow=""
endfunction

function stringCommands takes nothing returns nothing
if StringCase(GetEventPlayerChatString(),false)=="-hear"then
set peopleThatCanHear[GetPlayerId(GetTriggerPlayer())]=not(peopleThatCanHear[GetPlayerId(GetTriggerPlayer())])
endif
call showMessageToPeopleThatCanHear()
endfunction

function initStringCommands takes nothing returns nothing
local integer index=0
loop
exitwhen index>11
call TriggerRegisterPlayerChatEvent(trgStringCommands,Player(index),"",false)
set index=index+1
endloop
call TriggerAddAction(trgStringCommands,function stringCommands)
endfunction

function main takes nothing returns nothing
call initStringCommands()
endfunction

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
 Post subject: Re: make a command
PostPosted: November 19th, 2012, 3:27 pm 
Offline
Forum Staff

Joined: November 3rd, 2010, 10:48 am
Posts: 1850
Location: Singapore
Title: Best Player
Spoiler:
haxorico wrote:
Here is the command.

You need to type -hear to activate or deactivate it for yourself.
It won't show you your own messages.

With the player color and name
[spoiler]
Code:
globals
trigger trgStringCommands=CreateTrigger()
boolean array peopleThatCanHear
endglobals

function getPlayerColorCode takes integer pid returns string
if pid==0 then
return "|cffff0000"
elseif pid==1 then
return "|cff0000ff"
elseif pid==2 then
return "|cff00ffff"
elseif pid==3 then
return "|cff550088"
elseif pid==4 then
return "|cffffff00"
elseif pid==5 then
return "|cffff8800"
elseif pid==6 then
return "|cff00ff00"
elseif pid==7 then
return "|cffee55bb"
elseif pid==8 then
return "|cff999999"
elseif pid==9 then
return "|cff77bbff"
elseif pid==10 then
return "|cff116644"
else
return "|cff552200"
endif
endfunction

function showMessageToPeopleThatCanHear takes nothing returns nothing
local string messageToShow=(getPlayerColorCode(GetPlayerId(GetTriggerPlayer())) + GetPlayerName(GetTriggerPlayer()) + ": " + GetEventPlayerChatString())
local integer index=0
loop
exitwhen index>11
if (peopleThatCanHear[index]) and index!=GetPlayerId(GetTriggerPlayer())then
call DisplayTextToPlayer(Player(index),0,0,messageToShow)
endif
set index=index+1
endloop
set messageToShow=""
endfunction

function stringCommands takes nothing returns nothing
if StringCase(GetEventPlayerChatString(),false)=="-hear"then
set peopleThatCanHear[GetPlayerId(GetTriggerPlayer())]=not(peopleThatCanHear[GetPlayerId(GetTriggerPlayer())])
endif
call showMessageToPeopleThatCanHear()
endfunction

function initStringCommands takes nothing returns nothing
local integer index=0
loop
exitwhen index>11
call TriggerRegisterPlayerChatEvent(trgStringCommands,Player(index),"",false)
set index=index+1
endloop
call TriggerAddAction(trgStringCommands,function stringCommands)
endfunction

function main takes nothing returns nothing
call initStringCommands()
endfunction

Thanks I'll test it now, nicely worked.

_________________
Request a map? Follow the rulesHERE
Request templateHERE
Please, do not PM me.
On the side note, I'm still playing vampirism speed on malaysia room, occasionally in Garena. Bcuz too lazy to find out where else I can play them.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)