AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Invis Chat (https://forums.alliedmods.net/showthread.php?t=75029)

Drogocop 07-29-2008 10:36

Invis Chat
 
Hi.
The idea of plugin is:
say /invischat - Don't Look The Chat
say /viewchat - Look the chat
But if the player does not use the command /viewchat before leaving the server, in other servers don't look chat.
Is there a way that when they disconnect, disable /invischat ?

PHP Code:

/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN    "Invis Chat"
#define AUTHOR    "Drogocop"
#define VERSION    "1.0"


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd"say /invischat""ChatInvisible")
    
register_clcmd"say /viewchat""ChatVisible")
}

public 
ChatInvisible (id)
{
    
client_cmdid"hud_saytext_internal 0" )
    
client_printid,print_console"[IC] Now the chat is Invisible" )
}

public 
ChatVisible (id)
{
    
client_cmdid"hud_saytext_internal 1" )
    
client_printidprint_chat"[IC] Now the chat is Visible" )


Thanks for the Help

minimiller 07-29-2008 12:03

Re: Invis Chat
 
Code:
public client_disconnect(id) { client_cmd(id, "hud_saytext_internal 1") }

I guess this would work

Jon 07-29-2008 14:22

Re: Invis Chat
 
Don't mess around with client cmds unless there is no other way.

Code:
#include <amxmodx> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" new bool:ViewChat[33]; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("say", "HandleSay").     register_clcmd("say /invischat", "HandleInvisChat")     register_clcmd("say /viewchat", "HandleViewChat") } public HandleInvisChat(id)     ViewChat[id] = false; public HandleViewChat(id)     ViewChat[id] = true; public HandleSay(id) {     if(!ViewChat[id])         return PLUGIN_HANDLED;             return PLUGIN_CONTINUE; }


All times are GMT -4. The time now is 05:32.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.