Raised This Month: $71 Target: $400
 17% 

Module: CS Team Changer Ultimate [avoids crashes in aggressive changes]


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-02-2011 , 12:58   Re: Module: CS Team Changer [avoid crashes in aggressive changes]
Reply With Quote #11

Quote:
Mister fysiks, I just said that Arkshine opened the source, wrote something in it and closed. Why did you think he made all the code? Am I supposed to say what exactly he wrote in the source? And am I supposed to hide that he helped me with some code?
It's true the word may not the best, because rewritten would mean here I have redone the whole module myself, and that's not the case. Just fast optimization, cleaning up.

Quote:
How to fix the problem with 'get_user_team' while the big plugins are using set_pdata_int?
See the issue about get_players on the bug tracker. I've attached a patch which updates the AMXX team's id in TeamInfo message.

Quote:
can you explain what does "FYI" mean
For Your Information, it means.
FYI, the answer can be found fastly on google.
__________________

Last edited by Arkshine; 08-02-2011 at 13:05.
Arkshine is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: echo $me->location();
Old 08-12-2011 , 21:06   Re: Module: CS Team Changer [avoid crashes in aggressive changes]
Reply With Quote #12

Hello.

I do not know a lot of modules, you should not check if the player is valid?.

pd:the delay is to use emessage.

pd2:Sorry for my English.
__________________
Destro- is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 08-13-2011 , 08:20   Re: Module: CS Team Changer [avoid crashes in aggressive changes]
Reply With Quote #13

PHP Code:
/* These are the same as above, except that the messages sent
 *  are also sent to all other plugins and Metamod plugins.
 * This means that if you send one of these messages, other plugins will
 *  be notified, which was previously impossible.  
 * BE CAREFUL! Using these incorrectly, or not for their intended purpose,
 *  could cause infinite recursion or something just as bad. 
 * NOTE! These natives are experimental.
 */
native emessage_begin(destmsg_type, const origin[3] = {0,0,0}, player 0);
native emessage_end();
native ewrite_byte(x);
native ewrite_char(x);
native ewrite_short(x);
native ewrite_long(x);
native ewrite_entity(x);
native ewrite_angle(x);
native ewrite_coord(x);
native ewrite_string(const x[]); 
The player validity check is optional. The AmxModX scripters would like to check the validity in their AmxModX plugins!

The emessage_begin and message_begin are doing approximately the same thing...
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Destro-
Veteran Member
Join Date: Jun 2010
Location: echo $me->location();
Old 08-13-2011 , 11:33   Re: Module: CS Team Changer [avoid crashes in aggressive changes]
Reply With Quote #14

I know.
The zp use emessage + delay for to work register_message,but not necessary.

Sorry for my English use a translator.
__________________
Destro- is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 08-17-2011 , 07:48   Re: Module: CS Team Changer [avoid crashes in aggressive changes]
Reply With Quote #15

Quote:
This works perfectly with 32 players (tested)
could you do the same but on the ES_ map?

i mean would this fix fix agressive team changing crash on counter-strike es_* maps?
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-27-2011 , 12:41   Re: Module: CS Team Changer [avoid crashes in aggressive changes]
Reply With Quote #16

I can't say that it fix something for avoid the crashing, but, if you are thinking to change the player's team by using the CStrike extension, it will be trying to change the player's model, that is the reason why the server get crashed.

This extension, CS Team Changer, won't change any player physical information or any value, it will just update the tablescore, the API's team index and the team offset.

I make sure it won't crash the server by changing the team at 32 players in same time.
__________________

Last edited by claudiuhks; 11-27-2011 at 12:42.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
yokomo
Surprise Ascot!
Join Date: May 2010
Old 02-06-2012 , 07:33   Re: Module: CS Team Changer [avoids crashes in aggressive changes]
Reply With Quote #17

Tested with 31 players (30bots 1human) in Zombie Plague Mod server, it give wrong team set in scoreboard when i set into Survivor round (change 31 player's team in a second).

To solve this we must add delay in team update (just like Mercylezz do in his ZP).
yokomo is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 02-08-2012 , 14:58   Re: Module: CS Team Changer [avoids crashes in aggressive changes]
Reply With Quote #18

PHP Code:
static iSurvivoriPlayers32 ], iNumi;
iSurvivor GetRandomAlive( );
get_playersiPlayersiNum"a" );

for( 
0iNumi++ )
  if( 
iPlayers] != iSurvivor MakeZombieiPlayers] );

MakeSurvivoriSurvivor );



GetRandomAlive( )
{
  static 
iPlayers32 ], iNum;
  
get_playersiPlayersiNum"a" );

  return 
iPlayersrandom_num0iNum ) ];

It's impossible to give a bad result...
__________________

Last edited by claudiuhks; 02-08-2012 at 15:00.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
yokomo
Surprise Ascot!
Join Date: May 2010
Old 02-09-2012 , 00:28   Re: Module: CS Team Changer [avoids crashes in aggressive changes]
Reply With Quote #19

That was your own code, not from ZP4.3. Please take a look at this.
On function humanme:
PHP Code:
// Function Human Me (player id, turn into a survivor, silent mode)
humanme(idsurvivorsilentmode
Look at:
PHP Code:
    // Switch to CT
    
if (fm_cs_get_user_team(id) != FM_CS_TEAM_CT// need to change team?
    
{
        
remove_task(id+TASK_TEAM)
        
fm_cs_set_user_team(idFM_CS_TEAM_CT)
        
//fm_user_team_update(id)
    

It only give wrong result when i comment on "fm_user_team_update(id)"

My fm_cs_set_user_team stock:
PHP Code:
// Set a Player's Team
fm_cs_set_user_team(idteam)
{    
    
//set_pdata_int(id, OFFSET_CSTEAMS, team, OFFSET_LINUX)
    
cs_set_team(idteam)

My fm_user_team_update stock:
PHP Code:
// Update Player's Team on all clients (adding needed delays)
fm_user_team_update(id)
{
    static 
Float:current_time
    current_time 
get_gametime()
    
    if (
current_time g_teams_targettime >= 0.1)
    {
        
set_task(0.1"fm_cs_set_user_team_msg"id+TASK_TEAM)
        
g_teams_targettime current_time 0.1
    
}
    else
    {
        
set_task((g_teams_targettime 0.1) - current_time"fm_cs_set_user_team_msg"id+TASK_TEAM)
        
g_teams_targettime g_teams_targettime 0.1
    
}
}

// Send User Team Message
public fm_cs_set_user_team_msg(taskid)
{
    
// Note to self: this next message can now be received by other plugins
    
    // Set the switching team flag
    
g_switchingteam true
    
    
// Tell everyone my new team
    
cs_set_team_tablescore(ID_TEAMfm_cs_get_user_team(ID_TEAM))
    
    
// Done switching team
    
g_switchingteam false

Thats mean we still need to add delay at least 0.1 for team update on scoreboard.

Last edited by yokomo; 02-09-2012 at 00:30.
yokomo is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 02-09-2012 , 12:08   Re: Module: CS Team Changer [avoids crashes in aggressive changes]
Reply With Quote #20

The Zombie Plague modification by me was wrong, so, it not needs any delay for this extension.

To edit Zombie Plague without delay takes so long.

Sorry for inconvenience .
__________________

Last edited by claudiuhks; 02-09-2012 at 12:09.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
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 04:17.


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