Raised This Month: $ Target: $400
 0% 

int not reseting by rounds end


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
darkd
New Member
Join Date: Jul 2009
Old 08-16-2009 , 03:23   int not reseting by rounds end
Reply With Quote #1

Hey there, im having a problem, the int i created doesn't reset at rounds end. Can somebody help me?

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "smartAwp"
#define VERSION "1.0"
#define AUTHOR "DarkD"

new smartawp_enable
new awpTry


public plugin_init() {
    
register_plugin("smartAwp""1.0""DarkD")
    
smartawp_enable register_cvar("smartawp_enable""1")
    
register_clcmd("say /awp""smartAwp");
    
register_event("HLTV""event_new_round""a""1=0""2=0")  
    
}

public 
HLTV() {
    
awpTry 0;
}

public 
smartAwp(id){
    if ( !
is_user_alive(id) ) return PLUGIN_HANDLED;
    
    if(
get_pcvar_num(smartawp_enable)==1) {
        if(
awpTry == 0) {
            switch ( 
random_num(03) )
            {
                case 
0client_print(idprint_chat"Sorry, no AWP for you this round.");
                    case 
1client_print(idprint_chat"Sorry, no AWP for you this round.");
                    case 
2client_print(idprint_chat"Sorry, no AWP for you this round.");
                    case 
3give_item(id"weapon_awp");
                }
            
awpTry 1;
            } else if(
awpTry == 1) {
            
client_print(idprint_chat"You already tryed to get a awp this round!");
        }
        } else if(
get_pcvar_num(smartawp_enable)==0) {
        
client_print(idprint_chat"This plugin is disabled.");
    }
    return 
PLUGIN_CONTINUE;        

darkd is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-16-2009 , 04:38   Re: int not reseting by rounds end
Reply With Quote #2

public HLTV => public event_new_round
new awpTry => new awpTry[33]
awpTry => awpTry[id]
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-16-2009 , 04:39   Re: int not reseting by rounds end
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

new smartawp_enable
new bool:awpTry33 ];

public 
plugin_init( ) {
    
register_plugin"smartAwp""1.0""DarkD" )
    
smartawp_enable register_cvar"smartawp_enable""1" )
    
register_clcmd"say /awp""smartAwp" );
    
register_event"HLTV""event_new_round""a""1=0""2=0" )  
    
}

public 
event_new_round( ) {
    
arraysetawpTryfalse32 );
}

public 
smartAwpid ) {
    if ( !
is_user_aliveid ) ) return PLUGIN_HANDLED;
    
    if( 
get_pcvar_numsmartawp_enable ) ) {
        if( !
awpTryid ] ) {
            if( 
random_num0) == )
                
give_itemid"weapon_awp" );
            else
                
client_printidprint_chat"Sorry, no AWP for you this round." );
            
            
awpTryid ] = true;
        } else
            
client_printidprint_chat"You already tryed to get a awp this round!" );
    } else
        
client_printidprint_chat"This plugin is disabled." );
    
    return 
PLUGIN_CONTINUE;        

__________________
xPaw is offline
darkd
New Member
Join Date: Jul 2009
Old 08-16-2009 , 04:40   Re: int not reseting by rounds end
Reply With Quote #4

amazing, thanks xPaw!
darkd 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 15:12.


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