Raised This Month: $51 Target: $400
 12% 

how to allow unlimited team changes?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spfc
Junior Member
Join Date: Mar 2009
Old 03-09-2009 , 01:07   how to allow unlimited team changes?
Reply With Quote #1

hi, im trying to avoid the message in CS "Only one team change is allowed" (#Only_1_Team_Change) and allow to player changes team.

I can´t hook the message/event to disable this role.
do i need some more sophisticate function like register_forward or set a flag in the player's entity? how the server knows the teams changes?

i don't want to 'force' using cs_set_user_team and dllfunc(DLLFunc_Spawn, id), etc.

spfc is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 03-09-2009 , 01:32   Re: how to allow unlimited team changes?
Reply With Quote #2

This will remove "Only 1 Team Change Is allowed" message:
PHP Code:
#include < amxmodx >

public plugin_init( )
{
    
register_plugin"HookChooseTeam""1.0""Radiance" )
    
register_messageget_user_msgid"TextMsg" ), "MessageSayText" )
}

public 
MessageSayText( )
{
    new 
szMsgInfo32 ]
    
get_msg_arg_string2szMsgInfosizeof szMsgInfo ) - )

    if ( 
equaliszMsgInfo"#Only_1_Team_Change" ) )
        return 
PLUGIN_HANDLED

    
return PLUGIN_CONTINUE


Last edited by TheRadiance; 03-09-2009 at 01:34.
TheRadiance is offline
Send a message via ICQ to TheRadiance
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-09-2009 , 05:57   Re: how to allow unlimited team changes?
Reply With Quote #3

Be careful about adding continues in directly after a handle, it could encounter errors. I'm not sure if it goes for Pawn though.
BOYSplayCS is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 03-09-2009 , 06:20   Re: how to allow unlimited team changes?
Reply With Quote #4

Quote:
Be careful about adding continues in directly after a handle, it could encounter errors. I'm not sure if it goes for Pawn though.
Hmm.. It works fine on my server.
TheRadiance is offline
Send a message via ICQ to TheRadiance
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 03-09-2009 , 06:59   Re: how to allow unlimited team changes?
Reply With Quote #5

Quote:
Originally Posted by BOYSplayCS View Post
Be careful about adding continues in directly after a handle, it could encounter errors. I'm not sure if it goes for Pawn though.
In Pawn it's the opposite in most cases.
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯
Dores is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-09-2009 , 07:00   Re: how to allow unlimited team changes?
Reply With Quote #6

I thought so, I wasn't to sure though so I was just saying.
BOYSplayCS is offline
spfc
Junior Member
Join Date: Mar 2009
Old 03-09-2009 , 20:13   Re: how to allow unlimited team changes?
Reply With Quote #7

Quote:
Originally Posted by TheRadiance View Post
This will remove "Only 1 Team Change Is allowed" message:
PHP Code:
#include < amxmodx >

public plugin_init( )
{
    
register_plugin"HookChooseTeam""1.0""Radiance" )
    
register_messageget_user_msgid"TextMsg" ), "MessageSayText" )
}

public 
MessageSayText( )
{
    new 
szMsgInfo32 ]
    
get_msg_arg_string2szMsgInfosizeof szMsgInfo ) - )

    if ( 
equaliszMsgInfo"#Only_1_Team_Change" ) )
        return 
PLUGIN_HANDLED

    
return PLUGIN_CONTINUE

this just remove the message, do not allow to change team

if ( equali( szMsgInfo, "#Only_1_Team_Change" ) ) {
// in this point i cant execute a command like jointeam or chooseteam because it's recursive and we're 'inside' the message 'TextMsg', we cant send another message

return PLUGIN_HANDLED
}

Last edited by spfc; 03-09-2009 at 23:18.
spfc is offline
spfc
Junior Member
Join Date: Mar 2009
Old 03-12-2009 , 00:01   Re: how to allow unlimited team changes?
Reply With Quote #8

So...
The message #Only_1_Team_Change is just a consequence of try change team more than one time in a round

Is there a message before #Only_1_Team_Change for intercept? Or do i need set a flag on server or client?
I don't know where is this control (server side / client side).

I tried search on HL SDK but don't have success, i'm noob
spfc is offline
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 03-12-2009 , 14:57   Re: how to allow unlimited team changes?
Reply With Quote #9

There probably is an offset for that, but I don't think anyone knows about it (yet).
So the best way right now would be to change the player's team manually by hooking the change team menu and detecting whenever they select a different team...
__________________
MeRcyLeZZ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-12-2009 , 15:01   Re: how to allow unlimited team changes?
Reply With Quote #10

Quote:
Originally Posted by MeRcyLeZZ View Post
There probably is an offset for that
That is what i thought, haven't tested yet

-edit-
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Unlimited ChooseTeam"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

public plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR )
    
register_clcmd("chooseteam""ClientCommand_ChooseTeam")
}

public 
ClientCommand_ChooseTeamid )
{
    
set_pdata_int(id125get_pdata_int(id1255) & ~(1<<8), 5)

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 03-12-2009 at 15:14.
ConnorMcLeod 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 06:44.


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