Raised This Month: $32 Target: $400
 8% 

VIP Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 11-01-2020 , 03:06   VIP Plugin
Reply With Quote #1

Hey guys, is there any possible way to make grenades and armor given to player exactly when new round starts not when mp_freeztime gets to 0?
Some code:
PHP Code:
public LogEvent_RoundStart()
{
    
CurrentRound++;
    new 
players[32], playerpnum;
    
get_players(playerspnum"a");
    for(new 
0pnumi++)
    {
        
player players[i];
        if(
is_user_alive(player) && 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_assaultsuit")
            
give_item(player"item_thighpack")
        }
    }
    return 
PLUGIN_HANDLED
}

public 
Event_RoundRestart()
{
    
CurrentRound=0;

HowToRuski is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-02-2020 , 08:36   Re: VIP Plugin
Reply With Quote #2

Yes, use newround instead of roundstart.

More info here: https://forums.alliedmods.net/showthread.php?t=42159
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 11-02-2020 , 11:35   Re: VIP Plugin
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
Yes, use newround instead of roundstart.

More info here: https://forums.alliedmods.net/showthread.php?t=42159
So i changed these 2 to these and it didnt work... Anything wrong?

PHP Code:
register_logevent("event_new_round"2"1=New_Round" );

public 
event_new_round()
{
    
CurrentRound++;
    new 
players[32], playerpnum;
    
get_players(playerspnum"a");
    for(new 
0pnumi++)
    {
        
player players[i];
        if(
is_user_alive(player) && 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_assaultsuit")
            
give_item(player"item_thighpack")
        }
    }
    return 
PLUGIN_HANDLED

HowToRuski is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-02-2020 , 16:05   Re: VIP Plugin
Reply With Quote #4

I'm guessing you didn't read the whole article or you just don't understand it.

PHP Code:
register_event("HLTV""event_new_round""a""1=0""2=0"
Quote:
Originally Posted by VEN View Post
Notice the two conditions.

Note that this event is not called for very first round, i.e. on map start. If you need to catch that moment as well then in the most cases it's enough to use the plugin_init() or plugin_cfg() forward functions.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 11-04-2020 , 09:28   Re: VIP Plugin
Reply With Quote #5

Quote:
Originally Posted by Napoleon_be View Post
I'm guessing you didn't read the whole article or you just don't understand it.

PHP Code:
register_event("HLTV""event_new_round""a""1=0""2=0"
and this also didnt help me
HowToRuski is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 11-05-2020 , 14:35   Re: VIP Plugin
Reply With Quote #6

Anyone?
HowToRuski is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-05-2020 , 14:45   Re: VIP Plugin
Reply With Quote #7

Quote:
Originally Posted by HowToRuski View Post
and this also didnt help me
It should help you. Try using a task to delay the weapons given.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 11-05-2020 , 17:18   Re: VIP Plugin
Reply With Quote #8

Or try this idea:

PHP Code:
public event_new_round()
{
    
CurrentRound++;
    new 
players[32], playerpnum;
    new 
iFreezeTime get_cvar_num("mp_freezetime")
    
get_players(playerspnum"a");
    
    if (
iFreezeTime <= 0) {
        for(new 
0pnumi++)
        {
            
player players[i];
            if(
is_user_alive(player) && 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_assaultsuit")
            
give_item(player"item_thighpack")
            }
        }
    }
    
    return 
PLUGIN_HANDLED

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 11-05-2020 at 17:24.
Supremache is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 11-06-2020 , 04:14   Re: VIP Plugin
Reply With Quote #9

Quote:
Originally Posted by Supremache View Post
Or try this idea:

PHP Code:
public event_new_round()
{
    
CurrentRound++;
    new 
players[32], playerpnum;
    new 
iFreezeTime get_cvar_num("mp_freezetime")
    
get_players(playerspnum"a");
    
    if (
iFreezeTime <= 0) {
        for(new 
0pnumi++)
        {
            
player players[i];
            if(
is_user_alive(player) && 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_assaultsuit")
            
give_item(player"item_thighpack")
            }
        }
    }
    
    return 
PLUGIN_HANDLED

This quite didnt work.

I also tried to do with set_task but didnt work idk why
PHP Code:
register_event("HLTV""New_Round""a""1=0""2=0")

public 
New_Round() {
    
    
set_task0.1"RoundStart")
    
}


public 
RoundStart()
{
    
CurrentRound++;
    new 
players[32], playerpnum;
    
get_players(playerspnum"a");
    for(new 
0pnumi++)
    {
        
player players[i];
        if(
is_user_alive(player) && 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_assaultsuit")
            
give_item(player"item_thighpack")
            
        }
    }
    return 
PLUGIN_HANDLED


Last edited by HowToRuski; 11-06-2020 at 04:23.
HowToRuski is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 11-06-2020 , 08:59   Re: VIP Plugin
Reply With Quote #10

Try :

PHP Code:
const TaskRoundStart 123465;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent"EventRoundStart" "1=Round_Start" 
.
}

public 
EventRoundStart()
{
    new 
iFloatTime get_cvar_num("mp_freezetime"// Or Put the time of freeze time in task
    
    
if ( !task_existsTaskRoundStart ) )
        
set_taskfloat(iFloatTime) , "StartRound"TaskRoundStart );
    
}
public 
StartRound()
{
    
CurrentRound++;
    new 
iPlayers[32], iNum;

    
get_players(iPlayersiNum"a");
    
    for(new 
iPlayer0iNumi++)
    {
        
iPlayer iPlayers[i];
        
        if(
is_user_alive(iPlayer) && get_user_flags(iPlayer) & ADMIN_LEVEL_H)
        {
            
give_item(iPlayer"weapon_hegrenade")
            
give_item(iPlayer"weapon_flashbang")
            
give_item(iPlayer"weapon_flashbang")
            
give_item(iPlayer"weapon_smokegrenade")
            
give_item(iPlayer"item_assaultsuit")
            
give_item(iPlayer"item_thighpack")
        }
    }
    return 
PLUGIN_HANDLED

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 11-06-2020 at 08:59.
Supremache 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 22:43.


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