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

Request: CT and TT Team only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BrainDead
Junior Member
Join Date: Dec 2020
Location: Anywhere
Old 08-05-2021 , 12:57   Request: CT and TT Team only
Reply With Quote #1

Could anyone make this only for CT and TT team please. I mean it ignores spectators
PHP Code:
#include <amxmodx>
#include <cromchat>

#define PLUGIN  "Connect & Disconnect Messages"
#define AUTHOR  "F33L Th3 P0W3R."
#define VERSION "1.0"

new szName[MAX_NAME_LENGTH]

public 
plugin_init()
    
register_plugin(PLUGINVERSIONAUTHOR)


public 
client_putinserver(id)
{
    
get_user_name(idszNamecharsmax(szName))
    
CC_SendMessage(0"&x04%s &x07connect"szName)
}

public 
client_disconnect(id)
{
    
get_user_name(idszNamecharsmax(szName))
    
CC_SendMessage(0"&x04%s &x07disconnect"szName)

BrainDead is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-05-2021 , 13:44   Re: Request: CT and TT Team only
Reply With Quote #2

Need some explanation here..
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Old 08-05-2021, 14:04
Magicher0ex
This message has been deleted by Magicher0ex.
Magicher0ex
Member
Join Date: Dec 2019
Old 08-05-2021 , 14:11   Re: Request: CT and TT Team only
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
Need some explanation here..
Okey, i said that it shows every player disconnection (spectators, ct, terrorist).

I want message to be shown only when ct or terrorist leave the server, when spectator leave - no message.

Last edited by Magicher0ex; 08-05-2021 at 14:11.
Magicher0ex is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-06-2021 , 08:13   Re: Request: CT and TT Team only
Reply With Quote #4

Untested

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

#define PLUGIN  "Connect & Disconnect Messages"
#define AUTHOR  "F33L Th3 P0W3R."
#define VERSION "1.0"

new szName[MAX_NAME_LENGTH]
new 
iTerPlayers[MAX_PLAYERS], iTerNumiCtPlayers[MAX_PLAYERS], iCtNumiTotalNum;

public 
plugin_init()
    
register_plugin(PLUGINVERSIONAUTHOR)


public 
client_putinserver(id)
{
    
GetPlayers(id);

    for(new 
iiTotalNumi++)
    {
        
CC_SendMessage(iTerPlayers[i], "&x04%s &x07connect"szName)
        
CC_SendMessage(iCtPlayers[i], "&x04%s &x07connect"szName)
    }
}

public 
client_disconnected(id)
{
    
GetPlayers(id);

    for(new 
iiTotalNumi++)
    {
        
CC_SendMessage(iTerPlayers[i], "&x04%s &x07disconnect"szName)
        
CC_SendMessage(iCtPlayers[i], "&x04%s &x07disconnect"szName)
    }


GetPlayers(id)
{
    
get_players(iTerPlayersiTerNum"ce""TERRORIST");
    
get_players(iCtPlayersiCtNum"ce""CT");

    
iTotalNum iTerNum iCtNum;

    
get_user_name(idszNamecharsmax(szName))

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 08-06-2021 , 12:45   Re: Request: CT and TT Team only
Reply With Quote #5

Quote:
Originally Posted by Napoleon_be View Post
Untested

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

#define PLUGIN  "Connect & Disconnect Messages"
#define AUTHOR  "F33L Th3 P0W3R."
#define VERSION "1.0"

new szName[MAX_NAME_LENGTH]
new 
iTerPlayers[MAX_PLAYERS], iTerNumiCtPlayers[MAX_PLAYERS], iCtNumiTotalNum;

public 
plugin_init()
    
register_plugin(PLUGINVERSIONAUTHOR)


public 
client_putinserver(id)
{
    
GetPlayers(id);

    for(new 
iiTotalNumi++)
    {
        
CC_SendMessage(iTerPlayers[i], "&x04%s &x07connect"szName)
        
CC_SendMessage(iCtPlayers[i], "&x04%s &x07connect"szName)
    }
}

public 
client_disconnected(id)
{
    
GetPlayers(id);

    for(new 
iiTotalNumi++)
    {
        
CC_SendMessage(iTerPlayers[i], "&x04%s &x07disconnect"szName)
        
CC_SendMessage(iCtPlayers[i], "&x04%s &x07disconnect"szName)
    }


GetPlayers(id)
{
    
get_players(iTerPlayersiTerNum"ce""TERRORIST");
    
get_players(iCtPlayersiCtNum"ce""CT");

    
iTotalNum iTerNum iCtNum;

    
get_user_name(idszNamecharsmax(szName))

You clearly didn't understand the request.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 08-06-2021 , 13:26   Re: Request: CT and TT Team only
Reply With Quote #6

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

#define PLUGIN  "Connect & Disconnect Messages"
#define AUTHOR  "F33L Th3 P0W3R."
#define VERSION "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("JoinTeam"3"1=joined team")
}

public 
JoinTeam() {
    new 
loguser[80], name[32]
    
read_logargv(0loguser79)
    
parse_loguser(logusername31)

    new 
temp[2]

    
read_logargv(2temp1)
    if(
temp[0] == 'T' || temp[0] == 'C')
    {
        
CC_SendMessage(0"&x04%s &x07connect"name)  
    }
}

public 
client_disconnect(id)
{
    new 
szName[33]
    if(
get_user_team(id) == || get_user_team(id) == 2)
    {
        
get_user_name(idszNamecharsmax(szName))
        
CC_SendMessage(0"&x04%s &x07disconnect"szName)
    }

I think this simple enough. Just need to check if the connect/leave client is CT/T
__________________
My plugin:

Last edited by Celena Luna; 08-08-2021 at 21:30. Reason: Update Code
Celena Luna is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-06-2021 , 15:17   Re: Request: CT and TT Team only
Reply With Quote #7

Quote:
Originally Posted by Celena Luna View Post
PHP Code:
public client_putinserver(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_CT || cs_get_user_team(id) == CS_TEAM_T
    {
        
get_user_name(idszNamecharsmax(szName))
        
CC_SendMessage(0"&x04%s &x07connect"szName)
    }

what's the point of checking the user team in client_putinserver knowing its 100% guaranteed for the user team to be unassigned yet...
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-06-2021 at 15:17.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-06-2021 , 16:11   Re: Request: CT and TT Team only
Reply With Quote #8

Quote:
Originally Posted by iceeedr View Post
You clearly didn't understand the request.
How is this plugin not doing what was requested in the first place? The plugin now only acts for players on the T and CT team, when a player disconnects/connects.

Quote:
Could anyone make this only for CT and TT team please. I mean it ignores spectators
Quote:
Originally Posted by Celena Luna View Post
I think this simple enough. Just need to check if the connect/leave client is CT/T
That's not how it's done the proper way.
__________________

Last edited by Napoleon_be; 08-06-2021 at 16:14.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-07-2021 , 06:45   Re: Request: CT and TT Team only
Reply With Quote #9

Quote:
Originally Posted by Magicher0ex View Post
Okey, i said that it shows every player disconnection (spectators, ct, terrorist).

I want message to be shown only when ct or terrorist leave the server, when spectator leave - no message.


PHP Code:
public client_disconnected(id)
{

    if(
get_user_team(id) == || get_user_team(id) == 2)
    {
        new 
szName[32]
        
get_user_name(idszName31);
        
CC_SendMessage(0"&x04%s &x07disconnect"szName)
        
    }

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-07-2021 at 08:39.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 08-07-2021 , 07:54   Re: Request: CT and TT Team only
Reply With Quote #10

Quote:
Originally Posted by Natsheh View Post
what's the point of checking the user team in client_putinserver knowing its 100% guaranteed for the user team to be unassigned yet...
Ah! I forget about that!
I updated the code at my post

Also I changed disconnect part to @Natsheh's code.
__________________
My plugin:

Last edited by Celena Luna; 08-07-2021 at 07:55.
Celena Luna is offline
Reply



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 23:15.


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