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(0, 3) )
{
case 0: client_print(id, print_chat, "Sorry, no AWP for you this round.");
case 1: client_print(id, print_chat, "Sorry, no AWP for you this round.");
case 2: client_print(id, print_chat, "Sorry, no AWP for you this round.");
case 3: give_item(id, "weapon_awp");
}
awpTry = 1;
} else if(awpTry == 1) {
client_print(id, print_chat, "You already tryed to get a awp this round!");
}
} else if(get_pcvar_num(smartawp_enable)==0) {
client_print(id, print_chat, "This plugin is disabled.");
}
return PLUGIN_CONTINUE;
}