Hi all,
i'm scripting a modification to hook the chat of player when he is unconscious (bleeding or resting) to prevent that he can read what other player had say when he "stand up" (i don't know how to say it in english, lol).
I use nwnx and the chat plugin.
Let's imagine that we have 2 PC, PC1 say something, PC2 is unconscious. The chat plugin seem to hook only to PC1 using this:
#include "nwnx_chat"
void main(){
object oPc = OBJECT_SELF;
struct chat_message cmMessage;
cmMessage = NWNXChat_GetMessage();
int iMode = cmMessage.Mode;
object oTo = cmMessage.Recipient;
string sText= cmMessage.Text;
int iType = NWNXChat_GetCCMessageType();
int iSubtype = NWNXChat_GetCCMessagSubtype();
//Unconscious
if(GetLocalInt(oPc, MORTE_SVENUTO) == TRUE ||
GetLocalInt(oPc, "riposo") == TRUE ){
if(iMode == CHAT_CHANNEL_TALK ||
iMode == CHAT_CHANNEL_WHISPER){
NWNXChat_SuppressMessage();
}
return;
}
}
This seems to work only for the Pc who said something, not for who is listening to him (no debug message for PC2, only the normal chat message)
For other things i use the on_player_chat, i was thinking if i can use it to complete the task, but i think i can't do this in this way, something like this:
object oArea = GetArea(oPc);
object oObject;
oObject = GetFirstObjectInArea(oArea);
while(GetIsObjectValid(oObject)){
if( GetIsPC(oObject) || GetIsDMPossessed(oObject) ){
if( GetObjectHeard(oObject, oPc) ){
//SUPPRESSING MESSAGE?
}
}
oObject = GetNextObjectInArea(oArea);
}
What do you think? Thanks in advance