Page 1 of 1

Eroare compilare plugin

Posted: 19 Jul 2012, 22:54
by online
Stie cineva de ce nu pot compila urmatorul plugin ?

Code: Select all

/********************************************************************************
*                        Auto Team Switch Every X Rounds By                     *
*                                                                               *
* Author: nikhilgupta345                                                        *
* ------------------------------------------------------------------------      *
* Info:                                                                         *
* This plugin allows you to switch sides of teams every set number              *
* of rounds. Also gives a command to restart the number of rounds played.       *                                                                    *
* ------------------------------------------------------------------------      *
* Cvars:                                                                        *
* amx_atsrounds - sets the number of rounds before a team switch occurs.        *
* ------------------------------------------------------------------------      *
* Commands:                                                                     *
* amx_roundrestart - restarts the number of rounds that have been played.       *
* say /roundnumber - displays the amount of rounds that have been played.       *
* ------------------------------------------------------------------------      *
* Credits:                                                                      *
* Nextra - Giving suggestions and making the code more efficient.               *
* Tirant - Giving suggestions as well and providing code for the delay.            *
* Connormcleod - Final suggestions on optimizing code.                          *
* ------------------------------------------------------------------------      *
* Changelog:                                                                    *
* v1.0 - Initial release                                                        *
* v1.01 - Fixed Bugs - Optimized Code                                           *
* v1.1 - Fixed crashing with certain amount of people.                          *********************************
* v1.1.1 - Added new client command - /roundnumber, which displays the amount of rounds that have passed.       *
* v1.2 - Further optimized. Changed name of cvar to make it easier to remember. Added comments.                 *
*                                                                                                               *
* Plugin Main Thread: http://forums.alliedmods.net/showthread.php?p=1288262                                     *
*                                                                                                               *
****************************************************************************************************************/
    
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta_util>

#define PLUGIN "Auto Team Switcher"
#define VERSION "1.0"
#define AUTHOR "nikhilgupta345"

#pragma semicolon 1

new roundnumber = 0;
new Atsround;

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    
    register_clcmd( "say /kolo", "sayRound" );
    register_concmd( "amx_roundrestart", "restartnumber", ADMIN_KICK );
    
    register_logevent( "roundend", 2, "1=Round_End" );
    register_event( "TextMsg","restart","a","2&#Game_C", "2&#Game_W" ); // Event for "Game Commencing" TextMsg and "Game Will Restart in X Seconds" TextMsg
    
    Atsround = register_cvar( "amx_atsrounds", "7" );
    
}

public sayRound( id )
{
    client_print( id, print_chat, "Prave se hraje %i. kolo.", roundnumber );
    return PLUGIN_HANDLED;
}

public roundend()
{
    roundnumber++;
    
    if( roundnumber >= get_pcvar_num( Atsround ) )
    {
        new players[32], num;
        get_players( players, num );
        
        for( new i; i < num; i++ )
            add_delay( players[i] ); // Prevent Server Crash with a lot of people.
            
    }
}


public restartnumber( id, level, cid )
{
    if( !cmd_access( id, level, cid, 1 ) )
        return PLUGIN_HANDLED;
    
    roundnumber = 0;
    return PLUGIN_HANDLED;
}

public restart( id )
{
    roundnumber = 0;
    return PLUGIN_HANDLED;
}

public changeTeam( id )
{
fm_strip_user_weapons(id);
    switch( cs_get_user_team( id ) )
    {
        case CS_TEAM_CT: cs_set_user_team( id, CS_TEAM_T );
        
        case CS_TEAM_T: cs_set_user_team( id, CS_TEAM_CT );
    }
    
    set_hudmessage( 238, 59, 59, -1.0, 0.3, 0, 6.0, 12.0 );
    show_hudmessage( id, "Konci 5. kolo, prohazuji tymy!" );
    roundnumber = 0;
    
    
}

add_delay( id )
{
    switch( id )
    {
        case 1..7: set_task( 0.1, "changeTeam", id );
        case 8..15: set_task( 0.2, "changeTeam", id );
        case 16..23: set_task( 0.3, "changeTeam", id );
        case 24..32: set_task( 0.4, "changeTeam", id );
    }
}  

Re: Eroare compilare plugin

Posted: 19 Jul 2012, 22:59
by compaq
Merge foarte bine.

Code: Select all

/********************************************************************************
*                        Auto Team Switch Every X Rounds By                     *
*                                                                               *
* Author: nikhilgupta345                                                        *
* ------------------------------------------------------------------------      *
* Info:                                                                         *
* This plugin allows you to switch sides of teams every set number              *
* of rounds. Also gives a command to restart the number of rounds played.       *                                                                    *
* ------------------------------------------------------------------------      *
* Cvars:                                                                        *
* amx_atsrounds - sets the number of rounds before a team switch occurs.        *
* ------------------------------------------------------------------------      *
* Commands:                                                                     *
* amx_roundrestart - restarts the number of rounds that have been played.       *
* say /roundnumber - displays the amount of rounds that have been played.       *
* ------------------------------------------------------------------------      *
* Credits:                                                                      *
* Nextra - Giving suggestions and making the code more efficient.               *
* Tirant - Giving suggestions as well and providing code for the delay.            *
* Connormcleod - Final suggestions on optimizing code.                          *
* ------------------------------------------------------------------------      *
* Changelog:                                                                    *
* v1.0 - Initial release                                                        *
* v1.01 - Fixed Bugs - Optimized Code                                           *
* v1.1 - Fixed crashing with certain amount of people.                          *********************************
* v1.1.1 - Added new client command - /roundnumber, which displays the amount of rounds that have passed.       *
* v1.2 - Further optimized. Changed name of cvar to make it easier to remember. Added comments.                 *
*                                                                                                               *
* Plugin Main Thread: http://forums.alliedmods.net/showthread.php?p=1288262                                     *
*                                                                                                               *
****************************************************************************************************************/
   
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta_util>

#define PLUGIN "Auto Team Switcher"
#define VERSION "1.0"
#define AUTHOR "nikhilgupta345"

#pragma semicolon 1

new roundnumber = 0;
new Atsround;

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
   
    register_clcmd( "say /kolo", "sayRound" );
    register_concmd( "amx_roundrestart", "restartnumber", ADMIN_KICK );
   
    register_logevent( "roundend", 2, "1=Round_End" );
    register_event( "TextMsg","restart","a","2&#Game_C", "2&#Game_W" ); // Event for "Game Commencing" TextMsg and "Game Will Restart in X Seconds" TextMsg
   
    Atsround = register_cvar( "amx_atsrounds", "7" );
   
}

public sayRound( id )
{
    client_print( id, print_chat, "Prave se hraje %i. kolo.", roundnumber );
    return PLUGIN_HANDLED;
}

public roundend()
{
    roundnumber++;
   
    if( roundnumber >= get_pcvar_num( Atsround ) )
    {
        new players[32], num;
        get_players( players, num );
       
        for( new i; i < num; i++ )
            add_delay( players[i] ); // Prevent Server Crash with a lot of people.
           
    }
}


public restartnumber( id, level, cid )
{
    if( !cmd_access( id, level, cid, 1 ) )
        return PLUGIN_HANDLED;
   
    roundnumber = 0;
    return PLUGIN_HANDLED;
}

public restart( id )
{
    roundnumber = 0;
    return PLUGIN_HANDLED;
}

public changeTeam( id )
{
    fm_strip_user_weapons(id);
    switch( cs_get_user_team( id ) )
    {
        case CS_TEAM_CT: cs_set_user_team( id, CS_TEAM_T );
       
        case CS_TEAM_T: cs_set_user_team( id, CS_TEAM_CT );
    }
   
    set_hudmessage( 238, 59, 59, -1.0, 0.3, 0, 6.0, 12.0 );
    show_hudmessage( id, "Konci 5. kolo, prohazuji tymy!" );
    roundnumber = 0;
   
   
}

add_delay( id )
{
    switch( id )
    {
        case 1..7: set_task( 0.1, "changeTeam", id );
        case 8..15: set_task( 0.2, "changeTeam", id );
        case 16..23: set_task( 0.3, "changeTeam", id );
        case 24..32: set_task( 0.4, "changeTeam", id );
    }
}
http://amxmodx.org/webcompiler.cgi

Re: Eroare compilare plugin

Posted: 19 Jul 2012, 23:06
by online
Mda , merge sa il compilez dar nu merge pluginul X( adica nu face ce vreau eu . Cand terro castiga sa ramana terro iar cand ct castiga sa ii bage terro

Re: Eroare compilare plugin

Posted: 19 Jul 2012, 23:33
by compaq

Code: Select all

#include < amxmodx >
#include < cstrike >


public plugin_init()
{
	register_plugin( "Switch teams", "0.1", "compaq" );
	register_event( "SendAudio", "ctwin", "a", "2=%!MRAD_ctwin" );
}

public ctwin()
{
	set_task( 1.5, "exec" );
}

public exec()
{
	new iPlayers[ 32 ], iNum, i; get_players( iPlayers, iNum );

	for( i = 0; i < iNum; i++ )
	{
		switch( cs_get_user_team( iPlayers[ i ] ) )
		{
			case CS_TEAM_T:
			{
				user_silentkill( iPlayers[ i ] );
				cs_set_user_team( iPlayers[ i ], CS_TEAM_CT );
			}

			case CS_TEAM_CT:
			{
				user_silentkill( iPlayers[ i ] );
				cs_set_user_team( iPlayers[ i ], CS_TEAM_T );
			}
	
			default: return PLUGIN_CONTINUE;
		}
	}

	return PLUGIN_HANDLED;
}

Re: Eroare compilare plugin

Posted: 20 Jul 2012, 15:33
by online
pe asta il am acum si merge dar cand sv e 21/22 imi da o eroare :| ala de mai sus cica e bun dar nu stiu de ce nu functioneaza :(

Re: Eroare compilare plugin

Posted: 20 Jul 2012, 15:42
by mezzzu
Orice versiune ai avea nu merge :P nu e din cauza modelelor sau a pluginului de switch team , e de la modul de baza furien

Re: Eroare compilare plugin

Posted: 21 Jul 2012, 02:12
by online
Pana la urma stie cineva ?!

Re: Eroare compilare plugin

Posted: 21 Jul 2012, 02:29
by K1d0x
Domnule "online", tu ai impresia ca noi suntem suntem visatori? sau avem "paranormale" ? in primul tau post ai spus doar ca nu poti compila plugin-ul iar apoi ca nu functioneaza, hotaraste-te si dupa aceea spune-ne si noua ce anume nu merge, ce erori primesti, ce functioneaza si ce nu.

Cum ziceam nu putem sa ghicim.

Re: Eroare compilare plugin

Posted: 22 Jul 2012, 16:33
by Ulquiorra
ia incearca asta.. l-am facut de putin timp.. pentru mezzu..
chiar dupa pluginul pus de tine :))
( plugin-ul asta schimba echipele cand ct castiga.. )
Furien Delayed Team Swap | Afiseaza codul
#include <  amxmodx  >
#include <  cstrike  >


#pragma semicolon 1


#define PLUGIN "Furien Delayed Team Swap"
#define VERSION "1.2b"

#define		SWITCH_TASK		112233

/*======================================= - ¦ Askhanar ¦ - =======================================*/


public plugin_init(    )
{
        // credits         nikhilgupta345
	register_plugin(  PLUGIN,  VERSION,  "Askhanar" );
	register_event( "SendAudio",  "ev_SendAudioCounterWin",  "a",  "1=0",  "2=%!MRAD_ctwin"  );
	
}

/*======================================= - ¦ Askhanar ¦ - =======================================*/

public ev_SendAudioCounterWin(    ) 
{
	
	new iPlayers[  32  ],  iNum;
	get_players(  iPlayers,  iNum,  "ch" );
	
	if(  iNum  ) 
	{
		new  id;
		
		for(  --iNum;  iNum  >=  0;  iNum--  ) 
		{
			id  =  iPlayers[  iNum  ];
			BeginDelayedTeamChange(  id  );
			
		}
	}
}

/*======================================= - ¦ Askhanar ¦ - =======================================*/

public BeginDelayedTeamChange(  id  )
{
	
	switch(  id  ) 
	{ 
		
		case  1..6:  set_task(  0.1, "ChangeUserTeamWithDelay",  id  +  SWITCH_TASK  ); 
		case  7..13:  set_task(  0.2, "ChangeUserTeamWithDelay",  id  +  SWITCH_TASK  ); 
		case  14..20:  set_task(  0.3, "ChangeUserTeamWithDelay",  id  +  SWITCH_TASK  ); 
		case  21..26:  set_task(  0.4, "ChangeUserTeamWithDelay",  id  +  SWITCH_TASK  ); 
		case  27..32:  set_task(  0.5, "ChangeUserTeamWithDelay",  id  +  SWITCH_TASK  ); 
	} 
}

/*======================================= - ¦ Askhanar ¦ - =======================================*/

public ChangeUserTeamWithDelay(  id  )
{
	
	id  -=  SWITCH_TASK;
	if(  !is_user_connected(  id  )  )  return 1;
	
	switch(  cs_get_user_team(  id  )   ) 
	{
		
		case  CS_TEAM_T:  cs_set_user_team(  id,  CS_TEAM_CT  );
		case  CS_TEAM_CT:cs_set_user_team(  id,  CS_TEAM_T  );
			
	}
	
	return 0;
}

/*======================================= - ¦ Askhanar ¦ - =======================================*/

Re: Eroare compilare plugin

Posted: 22 Jul 2012, 23:44
by online
Mulumesc frumos sPuf? , mi-ai fost de ajutor >:D< .Cerere rezolvata !