AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   someone leaves the code say? (https://forums.alliedmods.net/showthread.php?t=113291)

Hasler 12-25-2009 07:52

someone leaves the code say?
 
someone leaves the code say? thanks.

lazarev 12-25-2009 10:44

Re: someone leaves the code say?
 
PHP Code:

#include <amxmodx>

public client_disconnect(id) {
    new 
name[33];
    
get_user_name(id,name,32);
    
client_print(0print_chat"%s has left the server"name);



fysiks 12-25-2009 11:53

Re: someone leaves the code say?
 
ummm . . . the game already does that.

Arkshine 12-25-2009 14:18

Re: someone leaves the code say?
 
But it doesn't display in the chat, if he's talking about cs.

Hasler 12-25-2009 22:21

Re: someone leaves the code say?
 
sorry for my english.. but i want the code of the say.. example..

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say","say")
}

public 
say(id){
           
//code of say..



thnks

lazarev 12-26-2009 03:11

Re: someone leaves the code say?
 
what do u need?
Quote:

"someone leaves the code say"
so u need a chat message if someone leaves :\

Hasler 12-26-2009 04:13

Re: someone leaves the code say?
 
well, im creating a plugin wath u can turn off/on the "say".. and my code is this but i don't understend how can desblock "say" and block yes.
if anyone can help me I appreciate it.

PHP Code:

#include <amxmodx>

new say_on

public plugin_init() {
    
register_plugin("say on - say off""1.1""Hasler")
    
    
register_clcmd("say","amx_say")
    
say_on register_cvar("amx_nosay","1")
}

public 
amx_say(id){
    if(
get_pcvar_num(say_on))
    {
        
register_clcmd("say","hook")
        
client_print(idprint_chat,"[AMXX] the no say is enabled")
    }
    else
    {
        
register_clcmd("say","say2")
    }
}

public 
hook() return PLUGIN_HANDLED

public say2(id){
    
//code of say





ProIcons 12-26-2009 04:19

Re: someone leaves the code say?
 
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "SAY"
#define VERSION "1.0"
#define AUTHOR "ProIcons"


public plugin_init() {
    
register_plugin(PLUGIN,VERSION,AUTHOR)
    
register_clcmd("amx_say","amx_say")
    
register_clcmd("say","halt")
    
register_cvar("mp_allowsay","1")
}
public 
say(id)
{
   if (
get_cvar_num("mp_allowsay") == 0)
   {
      new 
message2[192]
      
read_args(message2191)
      
remove_quotes(message2)
      
client_print(idprint_chat"(Say)You May Not speak with command say... Text Imunned: %s"message2);
      return 
PLUGIN_HANDLED;
   }
   return 
PLUGIN_CONTINUE;
}
public 
amx_say(id,level,cid)
{
   if (
cmd_access(idlevelcid2))
   {
     if (
get_cvar_num("mp_allowsay") == 0)
     {
        
set_cvar_num("mp_allowsay",1);
        
console_print(id,"(Say) Now all users can speek in the server");
        return 
PLUGIN_HANDLED;
     }
     else if (
get_cvar_num("mp_allowsay") == 1)
     {
        
set_cvar_num("mp_allowsay",0);
        
console_print(id,"(Say) Now noone can speek in the server");
        return 
PLUGIN_HANDLED;
     }
     return 
PLUGIN_HANDLED;
   }
   return 
PLUGIN_HANDLED;


CODE IS EDITED PLEASE RE CHECK IT

Hasler 12-26-2009 04:31

Re: someone leaves the code say?
 
Quote:

Originally Posted by ProIcons (Post 1031590)
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "SAY"
#define VERSION "1.0"
#define AUTHOR "ProIcons"


public plugin_init() {
    
register_plugin(PLUGIN,VERSION,AUTHOR)
    
register_clcmd("amx_say","amx_say")
    
register_clcmd("say","halt")
    
register_cvar("mp_allowsay","1")
}
public 
say(id)
{
   if (
get_cvar_num("mp_allowsay") == 0)
   {
      new 
message2[192]
      
read_args(message2191)
      
remove_quotes(message2)
      
client_print(idprint_chat"(Say)You May Not speak with command say... Text Imunned: %s"message2);
      return 
PLUGIN_HANDLED;
   }
   return 
PLUGIN_CONTINUE;
}
public 
amx_say(id,level,cid)
{
   if (
cmd_access(idlevelcid2))
   {
     if (
get_cvar_num("mp_allowsay") == 0)
     {
        
set_cvar_num("mp_allowsay",1);
        
console_print(id,"(Say) Now all users can speek in the server");
        return 
PLUGIN_HANDLED;
     }
     else if (
get_cvar_num("mp_allowsay") == 1)
     {
        
set_cvar_num("mp_allowsay",0);
        
console_print(id,"(Say) Now noone can speek in the server");
        return 
PLUGIN_HANDLED;
     }
     return 
PLUGIN_HANDLED;
   }
   return 
PLUGIN_HANDLED;


CODE IS EDITED PLEASE RE CHECK IT


Thanks, but this part of code I served
PHP Code:

#include <amxmodx>

public plugin_init() {
    
register_plugin("say on - say off""1.1""Hasler")
    
    
register_clcmd("say","amx_say")
    
register_cvar("amx_nosay","0")
}

public 
amx_say(id)
{
   if (
get_cvar_num("amx_nosay") == 1)
   {
      
client_print(idprint_chat"[AMXX] El say esta desactivado");
      return 
PLUGIN_HANDLED;
   }
   return 
PLUGIN_CONTINUE;



ProIcons 12-26-2009 04:36

Re: someone leaves the code say?
 
Ehm take mine and change it...:S


All times are GMT -4. The time now is 04:06.

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