hi guys,
im wondering if it is possible to make one player cannot talk or interactive in whatever way with other players? Im using NWNX as the server.
blocking all contacts between players
Débuté par
RPGBL777
, août 05 2010 02:28
#1
Posté 05 août 2010 - 02:28
#2
Posté 08 août 2010 - 06:08
Yes and you don't need to use nwnx either.
You will notice there is an onchat event in the module I have learned about it and started using it recently, so here's the lowdown. When you place a script in an onchat event it intercepts all chat, so you can pretty much fire any event/script/behavior solely from player conversations.
In your particular case, let's say hypothetically you want a player to be construed as mute or is cursed to not speak somehow. In such a scenario I would advise you give the player a cursed item that cannot be discarded and identifies them as being either mute or cursed to not speak. I advise an item over storing a variable on the player since those get deleted every time they log out.
Anyway moving on, once you have done that you will make a very simple check in your onchat script, if player possesses said item, then all their text will return an empty string so other players cannot see what he/she had said. You can even send a message to the original pc sender telling him something along the lines of "You attempt to speak but no sounds emanates from your mouht".
There is info on the wiki on how to use the OnChat script, and I'll give you a small example below as well, because from my experience examples make life a whole lot easier ;D
int StartingConditional(object oSender, object oTarget, int iChannel, string sMessage)
{
if(GetIsObjectValid(GetItemPossessedBy(oSender, "CURSED_ITEM'S_TAG")))
{
SendMessageToPC(oSender, "You attempt to speak but find yourself unable to produce sound.");
return FALSE;
}
return TRUE;
}
At the end of the script you want to have that return true line so that all other text goes through. You can add additional checks of course like perhaps a specific area where players cannot talk and whatever else your heart desires. Hopes this helps.
You will notice there is an onchat event in the module I have learned about it and started using it recently, so here's the lowdown. When you place a script in an onchat event it intercepts all chat, so you can pretty much fire any event/script/behavior solely from player conversations.
In your particular case, let's say hypothetically you want a player to be construed as mute or is cursed to not speak somehow. In such a scenario I would advise you give the player a cursed item that cannot be discarded and identifies them as being either mute or cursed to not speak. I advise an item over storing a variable on the player since those get deleted every time they log out.
Anyway moving on, once you have done that you will make a very simple check in your onchat script, if player possesses said item, then all their text will return an empty string so other players cannot see what he/she had said. You can even send a message to the original pc sender telling him something along the lines of "You attempt to speak but no sounds emanates from your mouht".
There is info on the wiki on how to use the OnChat script, and I'll give you a small example below as well, because from my experience examples make life a whole lot easier ;D
int StartingConditional(object oSender, object oTarget, int iChannel, string sMessage)
{
if(GetIsObjectValid(GetItemPossessedBy(oSender, "CURSED_ITEM'S_TAG")))
{
SendMessageToPC(oSender, "You attempt to speak but find yourself unable to produce sound.");
return FALSE;
}
return TRUE;
}
At the end of the script you want to have that return true line so that all other text goes through. You can add additional checks of course like perhaps a specific area where players cannot talk and whatever else your heart desires. Hopes this helps.





Retour en haut






