AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Round Number (https://forums.alliedmods.net/showthread.php?t=159637)

Trickzz 06-19-2011 17:01

[HELP] Round Number
 
How to make a round if for example 3, the players were given the AWP Magnum. And if the round 10 players were given a Deagle

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "AUTHOR"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("HLTV""event_round_start""a""1=0""2=0")
}

public 
event_round_start()
{
    
round_number++



Exolent[jNr] 06-19-2011 17:21

Re: [HELP] Round Number
 
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "AUTHOR"

new round_number

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("HLTV""event_round_start""a""1=0""2=0")
}

public 
event_round_start()
{
    
round_number++
    
    switch(
round_number)
    {
        case 
3:
        {
            
// use get_players() and loop through all players
            // use give_item() with "weapon_awp"
        
}
        case 
10:
        {
            
// use get_players() and loop through all players
            // use give_item() with "weapon_deagle"
        
}
    }



Erox902 06-19-2011 17:39

Re: [HELP] Round Number
 
don't forget to include fun if your gonna use "give_item" :mrgreen:

Trickzz 06-19-2011 18:35

Re: [HELP] Round Number
 
1 Attachment(s)
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <cstrike>

#define PLUGIN "Advanced Rounds"
#define VERSION "1.0"
#define AUTHOR "Trickz"

new g_Health

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
g_Health register_cvar("ar_firstround_hp""30");        
    
    
g_maxplayers=get_maxplayers() 
    
         new 
iEntity    
    
while( ( iEntity find_ent_by_classiEntity"func_buyzone" ) ) > )
       
       if( 
entity_get_intiEntityEV_INT_iuser1 ) != 1337 )
            
remove_entityiEntity );
}

public 
plugin_precache() 
{
    new 
iEntity create_entity"func_buyzone" );
    
    if( 
iEntity ) {
        
entity_set_sizeiEntityFloat:{ -4096.0, -4096.0, -4096.0 }, Float:{ -4095.0, -4095.0, -4095.0 } );
        
entity_set_intiEntityEV_INT_iuser11337 );
    }
}

public 
event_round_start()
{
    
round_number++
    
    switch(
round_number)
    {
        case 
1:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons
                  give_item
(id"weapon_knife"
                       
set_user_health(id"30" get_pcvar_num(g_Health));
        }
        case 
2:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons
                  give_item
(id"weapon_glock18")
        }
        case 
3:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons
                  give_item
(id"weapon_usp")
        }
        case 
4,5:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons
                  give_item
(id"weapon_deagle")
        }
    }


https://forums.alliedmods.net/attach...0&d=1308522831

Everbody, can help me?

Erox902 06-19-2011 20:10

Re: [HELP] Round Number
 
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <cstrike>

#define PLUGIN "Advanced Rounds"
#define VERSION "1.0"
#define AUTHOR "Trickz"

new g_maxplayers //you forgot this
new round_number //and this
new g_Health

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
g_Health register_cvar("ar_firstround_hp""30");        
    
    
g_maxplayers=get_maxplayers() 
    
         new 
iEntity    
    
while( ( iEntity find_ent_by_classiEntity"func_buyzone" ) ) > )
       
       if( 
entity_get_intiEntityEV_INT_iuser1 ) != 1337 )
            
remove_entityiEntity );
}

public 
plugin_precache() 
{
    new 
iEntity create_entity"func_buyzone" );
    
    if( 
iEntity ) {
        
entity_set_sizeiEntityFloat:{ -4096.0, -4096.0, -4096.0 }, Float:{ -4095.0, -4095.0, -4095.0 } );
        
entity_set_intiEntityEV_INT_iuser11337 );
    }
}

public 
event_round_start()
{
    
round_number++
    
    switch(
round_number)
    {
        case 
1:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons(i)
                  
give_item(i"weapon_knife")
                  
/*and what the hell is this "set_user_health(i, "30" + get_pcvar_num(g_Health));"?

                  if you want players to have 30 hp uncomment this below*/
                  //set_user_health(i, get_pcvar_num(g_Health));

                 //or if you want 30 hp MORE, then uncomment this
                 //set_user_health(i, get_user_health(i) += get_pcvar_num(g_Health));
        
}
        case 
2:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons(i)
                  
give_item(i"weapon_glock18"//not id
        
}
        case 
3:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons(i)
                  
give_item(i"weapon_usp")
        }
        case 
4,5:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons(i)
                  
give_item(i"weapon_deagle")
        }
    }



matsi 06-19-2011 20:13

Re: [HELP] Round Number
 
Quote:

Originally Posted by Erox902 (Post 1491876)
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <cstrike>

#define PLUGIN "Advanced Rounds"
#define VERSION "1.0"
#define AUTHOR "Trickz"

new g_maxplayers //you forgot this
new round_number //and this
new g_Health

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
g_Health register_cvar("ar_firstround_hp""30");        
    
    
g_maxplayers=get_maxplayers() 
    
         new 
iEntity    
    
while( ( iEntity find_ent_by_classiEntity"func_buyzone" ) ) > )
       
       if( 
entity_get_intiEntityEV_INT_iuser1 ) != 1337 )
            
remove_entityiEntity );
}

public 
plugin_precache() 
{
    new 
iEntity create_entity"func_buyzone" );
    
    if( 
iEntity ) {
        
entity_set_sizeiEntityFloat:{ -4096.0, -4096.0, -4096.0 }, Float:{ -4095.0, -4095.0, -4095.0 } );
        
entity_set_intiEntityEV_INT_iuser11337 );
    }
}

public 
event_round_start()
{
    
round_number++
    
    switch(
round_number)
    {
        case 
1:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons
                  give_item
(id"weapon_knife"
                       
set_user_health(id"30" get_pcvar_num(g_Health));
        }
        case 
2:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons
                  give_item
(id"weapon_glock18")
        }
        case 
3:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons
                  give_item
(id"weapon_usp")
        }
        case 
4,5:
        {
             new 
players[32], playerpnum;
             
get_players(playerspnum"a");
             for(new 
0pnumi++) 
                  
player players[i];
                  
strip_user_weapons
                  give_item
(id"weapon_deagle")
        }
    }



You don't see anything wrong about "strip_user_weapons"? o_O

Erox902 06-19-2011 21:22

Re: [HELP] Round Number
 
Quote:

Originally Posted by matsi (Post 1491879)
You don't see anything wrong about "strip_user_weapons"? o_O

haha lol sry didn't see that:oops: just checked his screen print and saw the undefined smbols:mrgreen:

----EDIT----
fixed it in the other post but noticed another thing... What the hell is case 4,5 Trickzz?

fysiks 06-19-2011 22:46

Re: [HELP] Round Number
 
Quote:

Originally Posted by Erox902 (Post 1491906)
What the hell is case 4,5 Trickzz?

It a case that gets executed for both round_number = 4 and round_number = 5.

Trickzz 06-20-2011 03:34

Re: [HELP] Round Number
 
case 4,5 - for round 4 and 5.
and i want, to in first round HP of all users will be 30HP, to next round 100hp..

Trickzz 06-20-2011 03:46

Re: [HELP] Round Number
 
How to make a CVAR, on / off zone purchasing

PHP Code:

         new iEntity    
    
while( ( iEntity find_ent_by_classiEntity"func_buyzone" ) ) > )
       
       if( 
entity_get_intiEntityEV_INT_iuser1 ) != 1337 )
            
remove_entityiEntity ); 

PHP Code:

public plugin_precache() 
{
    new 
iEntity create_entity"func_buyzone" );
    
    if( 
iEntity ) {
        
entity_set_sizeiEntityFloat:{ -4096.0, -4096.0, -4096.0 }, Float:{ -4095.0, -4095.0, -4095.0 } );
        
entity_set_intiEntityEV_INT_iuser11337 );
    }




All times are GMT -4. The time now is 23:33.

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