@unmute player on specific map onLogoutEvent

Hadeszeus

New member
Messages
651
Points
0
Location
Philippines
I can't make this work, should it work right?

OnPCLogoutEvent: if ( strcharinfo(3) == "guild_vs1" ) atcommand "@unmute "+strcharinfo(0); end;

Or any other way to unmute players on a specific map on logoutevent?

 
Yes, you can be creative ending it.

According to source:

/*========================================== * @unmute [Valaris] *------------------------------------------*/ACMD(unmute) { struct map_session_data *pl_sd = NULL; if (!message || !*message) { clif->message(fd, msg_txt(1234)); // Please enter a player name (usage: @unmute <char name>). return false; } if ( (pl_sd = map->nick2sd((char *)message)) == NULL ) { clif->message(fd, msg_txt(3)); // Character not found. return false; } if(!pl_sd->sc.data[SC_NOCHAT]) { clif->message(sd->fd,msg_txt(1235)); // Player is not muted. return false; } pl_sd->status.manner = 0; status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER); clif->message(sd->fd,msg_txt(1236)); // Player unmuted. return true;}

Since I suppose you already know your character is logged in and muted you can skip all the checks and go directly to what you want. Try this instead?

OnPCLogoutEvent: if (strcharinfo(3) == "guild_vs1" ) { Manner = 0; // sc_end SC_NOCHAT; // Edit, not needed as of the documentation says? } end;

EDIT: You've also got some nice advice on the scripting documentation regarding that on our scripting documentation
default_tongue.png
:

'sc_end' will remove a specified status effect. If SC_All is used (-1), it
will do a complete removal of all statuses (although permanent ones will
re-apply).
 
You can see the full list of status effects caused by skills in
'src/map/status.h' - they are currently not fully documented, but most of
that should be rather obvious.
Note: to use SC_NOCHAT you should alter Manner
Manner = -5; // Will mute a user for 5 minutes
Manner = 0; // Will unmute a user
Manner = 5; // Will unmute a user and prevent the next use of 'Manner'
 
I've just commented out the SC_NOCHAT line. If that doesn't work just edit the script and try with that uncommented again
default_wink.png

 
P.S.: You sure you didn't get any warning or so from the console when trying to atcommand? O.o
 
Last edited by a moderator:
Yes, you can be creative ending it.

According to source:

/*========================================== * @unmute [Valaris] *------------------------------------------*/ACMD(unmute) { struct map_session_data *pl_sd = NULL; if (!message || !*message) { clif->message(fd, msg_txt(1234)); // Please enter a player name (usage: @unmute <char name>). return false; } if ( (pl_sd = map->nick2sd((char *)message)) == NULL ) { clif->message(fd, msg_txt(3)); // Character not found. return false; } if(!pl_sd->sc.data[SC_NOCHAT]) { clif->message(sd->fd,msg_txt(1235)); // Player is not muted. return false; } pl_sd->status.manner = 0; status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER); clif->message(sd->fd,msg_txt(1236)); // Player unmuted. return true;}

Since I suppose you already know your character is logged in and muted you can skip all the checks and go directly to what you want. Try this instead?

OnPCLogoutEvent: if (strcharinfo(3) == "guild_vs1" ) { Manner = 0; // sc_end SC_NOCHAT; // Edit, not needed as of the documentation says? } end;

EDIT: You've also got some nice advice on the scripting documentation regarding that on our scripting documentation
default_tongue.png
:

'sc_end' will remove a specified status effect. If SC_All is used (-1), it
will do a complete removal of all statuses (although permanent ones will
re-apply).
 
You can see the full list of status effects caused by skills in
'src/map/status.h' - they are currently not fully documented, but most of
that should be rather obvious.
Note: to use SC_NOCHAT you should alter Manner
Manner = -5; // Will mute a user for 5 minutes
Manner = 0; // Will unmute a user
Manner = 5; // Will unmute a user and prevent the next use of 'Manner'
 
I've just commented out the SC_NOCHAT line. If that doesn't work just edit the script and try with that uncommented again
default_wink.png

 
P.S.: You sure you didn't get any warning or so from the console when trying to atcommand? O.o
OMG Thank you for that very detailed explanation and fix. Thank you so much Jabote!

 
Back
Top