Raised This Month: $32 Target: $400
 8% 

help I'm doing wrong?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
danips
Junior Member
Join Date: Apr 2019
Old 05-13-2019 , 01:30   help I'm doing wrong?
Reply With Quote #1

Hi, I need help to repair this plugin, the original plugin works with hud, but I want it to work with chat_color I made the modifications and erase what did not interest me.
someone tells me that I am doing wrong, because it shows nothing in the say.

plugin original https://forums.alliedmods.net/showthread.php?t=179330

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new bool:connected[33];
new 
bool:roundone[33];
new 
g_MaxPlayers;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
g_MaxPlayers get_maxplayers();
}
public 
client_connect(id)
{
    
connected[id] = true
    roundone
[id] = true
    
new szName[32]
    
get_user_name(idszName31)
    for(new 
1<= g_MaxPlayers;i++)
    {
        if(
id != i)
        {
            
chat_color(id"!t%s !yse ha conectado!"szName
        }
    }
}

public 
client_disconnect(id)
{
    
connected[id] = false
    
new szName[32]
    
get_user_name(idszName31)
    
chat_color(id"!t%s !yse ha desconectado"szName
}
//----------------------------------------------------------//
/* STOCKs ===========================================================================
===================================================================================*/
stock chat_color(const id, const input[], any:...)
{
    new 
count 1players[32], i
    
static msg[191]

    if(
numargs() == 2)
        
copy(msg190input)
    else
        
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!y""^1")
    
replace_all(msg190"!t""^3")
    
    if (
idplayers[0] = id; else get_players(playerscount"ch")
    {
        for(
0counti++)
        {
            if(
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                
write_byte(players[i])
                
write_string(msg)
                
message_end();
            }
        }
    }

danips is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 05-13-2019 , 04:50   Re: help I'm doing wrong?
Reply With Quote #2

PHP Code:
#include <amxmodx> 
#include <amxmisc> 

#define PLUGIN "New Plug-In" 
#define VERSION "1.0" 
#define AUTHOR "author"

public plugin_init()  

    
register_plugin(PLUGINVERSIONAUTHOR);

public 
client_connect(id
{
    new 
szName[32];
    
get_user_name(idszNamecharsmax(szName));

    
client_print_color(0print_team_default"^3%s ^1se ha conectado!"szName);


public 
client_disconnect(id
{
    new 
szName[32];
    
get_user_name(idszNamecharsmax(szName));
    
    
client_print_color(0print_team_default"^3%s ^1se ha desconectado"szName);  

__________________
Airkish is offline
danips
Junior Member
Join Date: Apr 2019
Old 05-13-2019 , 11:31   Re: help I'm doing wrong?
Reply With Quote #3

I will try but I do not think that is the error.
danips is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 05-13-2019 , 11:47   Re: help I'm doing wrong?
Reply With Quote #4

. You don't need connected and roundone booleans.
. You don't need to loop throught g_iMaxPlayers to print the connected message, replace id with 0.
. The issue is probably the if(numargs() == 2) check, try removing it, just leave vformat().
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 05-13-2019 at 11:48.
EFFx is offline
Old 05-13-2019, 14:22
thEsp
This message has been deleted by thEsp.
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:18.


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