Raised This Month: $ Target: $400
 0% 

Message after player choose a team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 01-30-2014 , 21:01   Message after player choose a team
Reply With Quote #1

When player connect to the server and choose a team (T/CT/SPEC) print chat message for him. But if he change team from T/CT/SPEC to T/CT/SPEC don't show message. Is it possible? and maybe someone will give me a code? thank you.
Debesėlis is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 01-31-2014 , 18:53   Re: Message after player choose a team
Reply With Quote #2

Any one can help me? I get message, but if i change team i get message too and i have error

PHP Code:
L 01/31/2014 23:31:27: [AMXXRun time error 4index out of bounds
L 01
/31/2014 23:31:27: [AMXX]    [1] new.sma::ClCmd_joinclass (line 117

PHP Code:
public plugin_init ( )
{
    
register_clcmd"joinclass""ClCmd_joinclass" );
    
register_clcmd"menuselect""ClCmd_joinclass" );
}

public 
ClCmd_joinclass client )
{
    if ( 
get_pdata_intclientm_iMenu ) == CSMENU_JOINCLASS )
    {
        new 
iTeam get_pdata_intclientm_iTeam );
        if ( 
iTeam == || iTeam == )
        {
              
print_colorclientNORMAL"Welcome you join a team!" );
         }
     }

Debesėlis is offline
Old 01-31-2014, 20:49
caked
This message has been deleted by caked.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-31-2014 , 21:07   Re: Message after player choose a team
Reply With Quote #3

It's not possible for that code to create that error because there are no arrays to be indexed. If I'm wrong, you need to either post the full code or you need to post the whole error and identify the line on which the error occurs.
__________________
fysiks is offline
Old 01-31-2014, 21:56
caked
This message has been deleted by caked.
Old 01-31-2014, 21:57
caked
This message has been deleted by caked.
caked
Member
Join Date: Dec 2012
Old 01-31-2014 , 21:59   Re: Message after player choose a team
Reply With Quote #4

Not tested.

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

#define PLUGIN "ClCmd_joinclass"
#define VERSION "1.0"
#define AUTHOR "caked"

public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
  
 
register_clcmd"joinclass""ClCmd_joinclass");
  }

 public 
ClCmd_joinclass(id)
 {
  
client_print(idprint_chat"Welcome you join a team!")


Last edited by caked; 01-31-2014 at 22:19.
caked is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 02-01-2014 , 11:20   Re: Message after player choose a team
Reply With Quote #5

Quote:
Originally Posted by caked View Post
Not tested.

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

#define PLUGIN "ClCmd_joinclass"
#define VERSION "1.0"
#define AUTHOR "caked"

public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
  
 
register_clcmd"joinclass""ClCmd_joinclass");
  }

 public 
ClCmd_joinclass(id)
 {
  
client_print(idprint_chat"Welcome you join a team!")

If i'm in Terrorist team and i change my team to Counter-Terrorist i get message. How to show message only then i join the game?
Debesėlis is offline
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 02-01-2014 , 11:23   Re: Message after player choose a team
Reply With Quote #6

maybe create a bool .
__________________

Check out My Plugins:
qServerInfo ; ASKTAG
quark is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 02-01-2014 , 11:39   Re: Message after player choose a team
Reply With Quote #7

if one player will join to the game other players won't get a message? How to make bool only for current player not for all?

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

#define PLUGIN "ClCmd_joinclass"
#define VERSION "1.0"
#define AUTHOR "caked"

new bool:g_InTeam false;

public 
plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
  
 
register_clcmd"joinclass""ClCmd_joinclass");
  }

 public 
ClCmd_joinclass(id)
 {
    if ( !
g_InTeam )
    {
        
client_print(idprint_chat"Welcome you join a team!")
    }
    
g_InTeam true;


Last edited by Debesėlis; 02-01-2014 at 11:40.
Debesėlis is offline
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 02-01-2014 , 12:26   Re: Message after player choose a team
Reply With Quote #8

it's not a bool, my bad.
Like this

new g_InTeam[33]

Then

g_InTeam[id] = 1;

Then check if(!(g_InTeam[id]==1))
Something like this.
__________________

Check out My Plugins:
qServerInfo ; ASKTAG
quark is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 02-01-2014 , 12:32   Re: Message after player choose a team
Reply With Quote #9

ohh. thanks
Debesėlis 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 18:58.


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