Disable Shout Channel in One Area
#1
Posté 07 décembre 2010 - 01:06
#2
Posté 07 décembre 2010 - 01:16
// Get the volume of the last player chat(text) message that was sent.
// Returns one of the following TALKVOLUME_* constants based on the volume setting
// that the player used to send the chat message.
// TALKVOLUME_TALK
// TALKVOLUME_WHISPER
// TALKVOLUME_SHOUT
// TALKVOLUME_SILENT_SHOUT (used for DM chat channel)
// TALKVOLUME_PARTY
// Should only be called from a module's OnPlayerChat event script.
// * Returns -1 on error.
// Note: Private tells do not trigger a OnPlayerChat event.
int GetPCChatVolume()
&
// Set the last player chat(text) volume before it gets sent to other players.
// - nTalkVolume: The new volume of the chat text to be sent onto other players.
// TALKVOLUME_TALK
// TALKVOLUME_WHISPER
// TALKVOLUME_SHOUT
// TALKVOLUME_SILENT_SHOUT (used for DM chat channel)
// TALKVOLUME_PARTY
// TALKVOLUME_TELL (sends the chat message privately back to the original speaker)
// Note: The new chat message gets sent after the OnPlayerChat script exits.
void SetPCChatVolume(int nTalkVolume=TALKVOLUME_TALK)
Along with a call to the area the pc is in should do the trick.
#3
Posté 07 décembre 2010 - 01:56
#4
Posté 07 décembre 2010 - 02:04
Birdman076 wrote...
Thanks for the info, will this be permanent in the area or will I have to loop it to keep them from shouting while there?
Nither.
Both of the functions have to be used in the Module PCChat Event.
so you will need to write a script to check the area they are in and change there ChatVolume if they are shouting in the area you do not want them to shout from.
#5
Posté 07 décembre 2010 - 02:23
#6
Posté 07 décembre 2010 - 04:24
It'll remain changed for anyone attempting to shout from that area, for every time they enter anything into the shout channel. It doesn't actually change their selected chat channel/volume, it just changes the chat output while the PC is within that select area.Birdman076 wrote...
Understandable, but will the ChatVolume remain changed as long as they are in that area or will it change back to shout if they choose shout for thier next chat?
#7
Posté 08 décembre 2010 - 01:59
#8
Posté 28 décembre 2010 - 01:32
void main()
{
object oPC = GetEnteringObject();
object oArea = GetArea(oPC);
if (!GetIsPC(oPC)) return;
if( GetLocalInt( oArea, "iNOCHAT" ) == 1 )
GetPCChatSpeaker();
GetPCChatMessage();
GetPCChatVolume();
SetPCChatVolume(TALKVOLUME_TALK);
SetPCChatMessage("");
}
Modifié par Birdman076, 28 décembre 2010 - 01:33 .
#9
Posté 28 décembre 2010 - 01:49
void main(){
object oPC = GetPCSpeaker();
object oArea = GetArea(oPC);
int bNoShout = GetLocalInt(oArea, "iNOCHAT");
if(bNoShout){
int nChatVolume = GetPCChatVolume();
if(nChatVolume == TALKVOLUME_SHOUT) SetPCChatVolume(TALKVOLUME_TALK);
}
}
Alternatively, you could simply kill their message and inform them they can't shout in that area:
void main(){
object oPC = GetPCSpeaker();
object oArea = GetArea(oPC);
int bNoShout = GetLocalInt(oArea, "iNOCHAT");
if(bNoShout){
int nChatVolume = GetPCChatVolume();
if(nChatVolume == TALKVOLUME_SHOUT){
SetPCChatMessage();
FloatingTextStringOnCreature("You cannot shout in this area.", oPC, FALSE);
}
}
}
Modifié par NorthWolf, 28 décembre 2010 - 01:54 .
#10
Posté 28 décembre 2010 - 05:34
void main(){
object oPC = GetPCChatSpeaker();
object oArea = GetArea(oPC);
int bNoShout = GetLocalInt(oArea, "iNOCHAT");
if(bNoShout){
int nChatVolume = GetPCChatVolume();
if(nChatVolume == TALKVOLUME_SHOUT) SetPCChatVolume(TALKVOLUME_TALK);
}
}
Alternatively, you could simply kill their message and inform them they can't shout in that area:
void main(){
object oPC = GetPCChatSpeaker();
object oArea = GetArea(oPC);
int bNoShout = GetLocalInt(oArea, "iNOCHAT");
if(bNoShout){
int nChatVolume = GetPCChatVolume();
if(nChatVolume == TALKVOLUME_SHOUT){
SetPCChatMessage();
FloatingTextStringOnCreature("You cannot shout in this area.", oPC, FALSE);
}
}
}
#11
Posté 28 décembre 2010 - 06:21
Modifié par NorthWolf, 28 décembre 2010 - 06:21 .
#12
Posté 29 décembre 2010 - 12:31
#13
Posté 31 décembre 2010 - 02:15
#14
Posté 31 décembre 2010 - 02:59
// Get the volume of the last player chat(text) message that was sent.
// Returns one of the following TALKVOLUME_* constants based on the volume setting
// that the player used to send the chat message.
// TALKVOLUME_TALK
// TALKVOLUME_WHISPER
// TALKVOLUME_SHOUT
// TALKVOLUME_SILENT_SHOUT (used for DM chat channel)
// TALKVOLUME_PARTY
// Should only be called from a module's OnPlayerChat event script.
// * Returns -1 on error.
// Note: Private tells do not trigger a OnPlayerChat event.
int GetPCChatVolume()
Modifié par Baragg, 31 décembre 2010 - 02:59 .
#15
Posté 31 décembre 2010 - 06:33
Modifié par NorthWolf, 31 décembre 2010 - 06:34 .





Retour en haut







