Raised This Month: $ Target: $400
 0% 

helpt at register_logevent


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LostSkill
Senior Member
Join Date: Jun 2008
Location: Monuhuelo Island
Old 06-27-2008 , 04:29   helpt at register_logevent
Reply With Quote #1

hey guys i add'ed register_logevent("logevent_Round_Start", 2, "1=Round_Start") how do that it works from 3rd round? soz for my bad english

example
PHP Code:
public logevent_Round_Start()
{
    new 
players[32], playerpnum;
    
get_players(playerspnum"a");
    for(new 
0pnumi++)
    {
        
player players[i];
        if(
get_user_flags(player) & ADMIN_LEVEL_H)
        {
            
give_item(player"weapon_hegrenade");
            
give_item(player"weapon_flashbang");
            
give_item(player"weapon_flashbang");
            
give_item(player"weapon_smokegrenade");
            
give_item(player"item_kevlar");
     
give_item(player"item_assaultsuit");
     
give_item(player"item_thighpack");
        }
    }

but i need that all that begin give from 3rd round
__________________
MY ENGLISH IS BAD.....

Last edited by LostSkill; 06-27-2008 at 04:32.
LostSkill is offline
Send a message via MSN to LostSkill
shine771
Senior Member
Join Date: Jun 2007
Old 06-27-2008 , 06:29   Re: helpt at register_logevent
Reply With Quote #2

make a global variable
Quote:
new rounds
above plugin_init
then change this:
PHP Code:
public logevent_Round_Start()
{
    new 
players[32], playerpnum;
    
get_players(playerspnum"a");
    for(new 
0pnumi++)
    {
        
player players[i];
        if(
get_user_flags(player) & ADMIN_LEVEL_H)
        {
            
give_item(player"weapon_hegrenade");
            
give_item(player"weapon_flashbang");
            
give_item(player"weapon_flashbang");
            
give_item(player"weapon_smokegrenade");
            
give_item(player"item_kevlar");
     
give_item(player"item_assaultsuit");
     
give_item(player"item_thighpack");
        }
    }

to:
PHP Code:
public logevent_Round_Start()
{
    if(
rounds >= 3) {
    new 
players[32], playerpnum;
    
get_players(playerspnum"a");
    for(new 
0pnumi++)
    {
        
player players[i];
        if(
get_user_flags(player) & ADMIN_LEVEL_H)
        {
            
give_item(player"weapon_hegrenade");
            
give_item(player"weapon_flashbang");
            
give_item(player"weapon_flashbang");
            
give_item(player"weapon_smokegrenade");
            
give_item(player"item_kevlar");
     
give_item(player"item_assaultsuit");
     
give_item(player"item_thighpack");
        }
    }
}
rounds++

shine771 is offline
LostSkill
Senior Member
Join Date: Jun 2008
Location: Monuhuelo Island
Old 06-27-2008 , 09:06   Re: helpt at register_logevent
Reply With Quote #3

and if i will write like this it will work same yea? look
PHP Code:
public logevent_Round_Start()

 new 
players[32], playerpnum;
 
get_players(playerspnum"a");
 for(new 
0pnumi++)
 {
  
player players[i];
  if(
get_user_flags(player) & ADMIN_LEVEL_H)
  {
  
give_item(player"weapon_hegrenade");
  
give_item(player"weapon_flashbang");
  
give_item(player"weapon_flashbang");
  
give_item(player"weapon_smokegrenade");
  
give_item(player"item_kevlar");
  
give_item(player"item_assaultsuit");
  
give_item(player"item_thighpack");
  if(
round >= 3give_item(player"weapon_awp");
  if(
round >= 3give_item(player"ammo_338magnum");
  if(
round >= 3give_item(player"ammo_338magnum");
  
round++;
  }
 }

__________________
MY ENGLISH IS BAD.....
LostSkill is offline
Send a message via MSN to LostSkill
shine771
Senior Member
Join Date: Jun 2007
Old 06-27-2008 , 10:33   Re: helpt at register_logevent
Reply With Quote #4

No, you need to take round++ out of for(). Better put round++ @ the start because when you create a variable.. it auto sets it to zero, you know that there is no Zero round xD. Use this:
PHP Code:
public logevent_Round_Start()

    
round++;
    new 
players[32], playerpnum;
    
get_players(playerspnum"a");
    for(new 
0pnumi++)
    {
        
player players[i];
        if(
get_user_flags(player) & ADMIN_LEVEL_H)
        {
            
give_item(player"weapon_hegrenade");
            
give_item(player"weapon_flashbang");
            
give_item(player"weapon_flashbang");
            
give_item(player"weapon_smokegrenade");
            
give_item(player"item_kevlar");
            
give_item(player"item_assaultsuit");
            
give_item(player"item_thighpack");
            if(
round >= 3) {
                
give_item(player"weapon_awp");
                
give_item(player"ammo_338magnum");
                
give_item(player"ammo_338magnum");
            }
        }
    }

shine771 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 08:34.


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