Raised This Month: $120 Target: $400
 30% 

Solved How to make Vote Menu?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MihaiGamerXD
Member
Join Date: Aug 2018
Old 12-08-2018 , 06:22   How to make Vote Menu?
Reply With Quote #1

Hello again, I want to make Vote Menu with 3 Zombie Modes like: Infection, Nemesis, Assassin.
Any ideas?

Last edited by MihaiGamerXD; 12-10-2018 at 12:01. Reason: Sorry for asking you for my problems I had, but I fixed them for myself!
MihaiGamerXD is online now
CrazY.
Veteran Member
Join Date: May 2015
Location: Brazil 🇧🇷
Old 12-08-2018 , 07:33   Re: How to make Vote Menu?
Reply With Quote #2

Look at zombie plague source code?
__________________
Working with $$$ paid plugins. Contact below (ONLY FOR NEGOTIATIONS)
  • Skype: crazy.770
  • Steam: crazy770
  • Discord: CrazY.#5317
Feel free to check my work at https://conceptstrike.blogspot.com

Check my Aliens vs. Predator: currently offline
CrazY. is offline
MihaiGamerXD
Member
Join Date: Aug 2018
Old 12-08-2018 , 07:38   Re: How to make Vote Menu?
Reply With Quote #3

No! You dont understand, show me the code, just the code!
MihaiGamerXD is online now
Old 12-08-2018, 08:20
Fuck For Fun
This message has been deleted by Fuck For Fun. Reason: Hhhh
MihaiGamerXD
Member
Join Date: Aug 2018
Old 12-08-2018 , 09:52   Re: How to make Vote Menu?
Reply With Quote #4

Ok, but I want to make Vote Menu. And it doesn't work!
I tried this:
PHP Code:
public Vote_Mode(id,level,cid) {
    if (!
cmd_access(id,level,cid,0))
        return 
PLUGIN_HANDLED;
    
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        if (
voting) {
            
client_print(id,print_console,"The vote is already in process!")
        }
        else {
            new 
iPlayers[32], iNumiPlayer
            get_players
(iPlayers,iNum,"i")
            for (new 
0iNumi++) {
                
iPlayer iPlayers[i]
                new 
menu menu_create("Zombie Mode Vote Menu","Mode_Menu")
                
menu_additem(menu,"Infection")
                
menu_additem(menu,"NEMESIS")
                
menu_additem(menu,"ASSASSIN")
                
menu_setpropmenuMPROP_EXITMEXIT_ALL )
                
menu_display(iPlayer,menu)
            }
        }
        
voting true
        set_task
(5.0,"End_Vote")
    }
    
    return 
PLUGIN_HANDLED;
}

public 
Mode_Menu(idmenuitem) {
    if (
item==3results[0]++
    else 
results[item+1]++
    
    new 
name[32]
    
get_user_name(id,name,31)
    
    if(
item==3client_print(0,print_chat,"%s voted for # 0",name)
    else 
client_print(0,print_chat,"%s voted for # %d",name,item+1)
}

public 
End_Vote(id) {
    new 
winnerwinner2bool:tie
    winner
=10
    
for(new i=0;i<10;i++)
    {
        if(
results[i]>results[winner]) //Here's the problem!
        
{
            
winner=i
            tie
=false
        
}
        else if(
results[i]==results[winner])
        {
            
winner2=i
            tie
=true
        
}
    }

    if(
tie)
    {
        
client_print(id,print_chat,"Voting Over: Tie between #%d and #%d. No action taken.",winner,winner2)
    }
    else
    {
        
client_print(id,print_chat,"Voting Over: The Zombie Mode will be #%d in to the next round!",winner)
    }

    
voting=false

But it doesn't work, in the console says: "[AMX] Out of bounds (line 223)"

Last edited by MihaiGamerXD; 12-08-2018 at 09:53.
MihaiGamerXD is online now
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Location: ISR
Old 12-08-2018 , 10:08   Re: How to make Vote Menu?
Reply With Quote #5

And how we can know which line is 223?

Show us a full code
__________________

Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
MihaiGamerXD
Member
Join Date: Aug 2018
Old 12-08-2018 , 12:32   Re: How to make Vote Menu?
Reply With Quote #6

Now I have the another code!
Here:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <fakemeta>

#define MAX_VOTEIDS 3

#define MAX_PLAYERS 32

new gVotes[MAX_VOTEIDS];

const 
DMG_HEGRENADE = (1<<24)

new 
yourpoint[MAX_PLAYERS+1]

new 
voting

new menu

static zombie[33]
static 
nemesis[33]
static 
assassin[33]
static 
angry[33]

enum Modes
{
    
INFECTION,
    
NEMESIS,
    
ASSASSIN
}

enum Modes_b
{
    
INF,
    
NEM
}

new 
Modes_b:next_mode_b

new Modes:g_mode

new Modes:next_mode

new use_command

new timeleft

static spawn_start[33]

static 
spawn_music[33]

static 
scoremode[33]

new 
bird_point 0;
new 
pig_point 0;
new 
bird_score 0;
new 
pig_score 0;

new 
win_mode 0;

new const 
bird_music[] = "redswar/music/bird_respawn.wav"
new const pig_music[] = "redswar/music/pig_respawn.wav"
new const vip_music[] = "redswar/music/vip_respawn.wav"
new const zombie_music[] = "redswar/music/zombie_respawn.wav"
new const bird_winner[] = "redswar/music/bird_winner.wav"
new const pig_winner[] = "redswar/music/pig_winner.wav"
new const vip_winner[] = "redswar/music/vip_winner.wav"
new const zombie_winner[] = "redswar/music/zombie_winner.wav"
new const bird_levelup[] = "redswar/music/bird_levelup.wav"
new const pig_levelup[] = "redswar/music/pig_levelup.wav"
new const vip_levelup[] = "redswar/music/vip_levelup.wav"
new const zombie_levelup[] = "redswar/music/zombie_levelup.wav"
new const assassin_music[] = "redswar/music/assassin_mode.wav"
new const nine[] = "redswar/voices/9.wav"
new const eight[] = "redswar/voices/8.wav"
new const seven[] = "redswar/voices/7.wav"
new const six[] = "redswar/voices/6.wav"
new const five[] = "redswar/voices/5.wav"
new const four[] = "redswar/voices/4.wav"
new const three[] = "redswar/voices/3.wav"
new const two[] = "redswar/voices/2.wav"
new const one[] = "redswar/voices/1.wav"
new const bird_model[] = "models/player/redswar_bird/redswar_bird.mdl"
new const pig_model[] = "models/player/redswar_pig/redswar_pig.mdl"
new const vip_model[] = "models/player/redswar_vip/redswar_vip.mdl"
new const zombie_model[] = "models/player/redswar_zombie/redswar_zombie.mdl"
new const nemesis_model[] = "models/player/redswar_nemesis/redswar_nemesis.mdl"
new const assassin_model[] = "models/player/redswar_assassin/redswar_assassin.mdl"

public plugin_precache() {
    
precache_sound(bird_music)
    
precache_sound(pig_music)
    
precache_sound(vip_music)
    
precache_sound(zombie_music)
    
precache_sound(bird_winner)
    
precache_sound(pig_winner)
    
precache_sound(vip_winner)
    
precache_sound(zombie_winner)
    
precache_sound(bird_levelup)
    
precache_sound(pig_levelup)
    
precache_sound(vip_levelup)
    
precache_sound(zombie_levelup)
    
precache_sound(assassin_music)
    
precache_sound(nine)
    
precache_sound(eight)
    
precache_sound(seven)
    
precache_sound(six)
    
precache_sound(five)
    
precache_sound(four)
    
precache_sound(three)
    
precache_sound(two)
    
precache_sound(one)
    
precache_model(bird_model)
    
precache_model(pig_model)
    
precache_model(vip_model)
    
precache_model(zombie_model)
    
precache_model(nemesis_model)
    
precache_model(assassin_model)
}

public 
plugin_init() {
    
register_plugin("Red's War""1.0""MihaiGamerXD")
    
set_task(1.0,"time_count",0,"",0,"b")
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)
    
RegisterHam(Ham_Touch"armoury_entity""onPickUp")
    
RegisterHam(Ham_Touch"weaponbox""onPickUp")
    
RegisterHam(Ham_Touch"weapon_shield""onPickUp")
    
RegisterHam(Ham_TakeDamage"player""onDamage")
    
RegisterHam(Ham_Use"func_tank""onUse")
    
register_event("DeathMsg","onDeath","a")
    
register_event("30","TheEnd","a")
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
register_logevent("Bird_Win",6,"3=CTs_Win")
    
register_logevent("Pig_Win",6,"3=Terrorists_Win")
    
register_logevent("Bomb_Exploded",6,"3=Target_Bombed")
    
register_logevent("Hostages_Rescued",6,"3=All_Hostages_Rescued")
    
register_logevent("Hostages_Lost",6,"3=Hostages_Not_Rescued")
    
register_logevent("VIP_Dead",6,"3=VIP_Assassinated")
    
register_logevent("VIP_Lost",6,"3=VIP_Not_Escaped")
    
register_logevent("Team_Events"3"1=triggered")
    
register_logevent("onRoundEnd",2,"1=Round_End")
    
set_task(0.1,"RW_M",0,"",0,"b")
    
set_task(0.1,"ChangeTeam",0,"",0,"b")
    
register_concmd("zm_mode","Zm_Mode",ADMIN_LEVEL_E,"Zombie Mode")
    
register_concmd("zm_vote","Vote_Mode",ADMIN_LEVEL_E,"Vote Zombie Mode")
}

public 
Zm_Mode(idlevelcid) {
    if (!
cmd_access(id,level,cid,0))
        return 
PLUGIN_HANDLED;
    
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        new 
arg[32]
        
read_args(arg,31)
        
remove_quotes(arg)
        if (
equal(arg,"Infection")) {
            
next_mode INFECTION
            client_print
(id,print_console,"The Zombie Mode will be Infection in to the next round!")
            
use_command true;
        }
        else if (
equal(arg,"NEMESIS")) {
            
next_mode NEMESIS
            client_print
(id,print_console,"The Zombie Mode will be NEMESIS in to the next round!")
            
use_command true;
        }
        else if (
equal(arg,"ASSASSIN")) {
            
next_mode ASSASSIN
            client_print
(id,print_console,"The Zombie Mode will be ASSASSIN in to the next round!")
            
use_command true;
        }
        else {
            
client_print(id,print_console,"Invalid Zombie Mode!")
        }
    }
    else {
        
client_print(idprint_console,"That command is used only for Zombie Map!")
    }
    
    return 
PLUGIN_HANDLED;
}

public 
Vote_Mode(id,level,cid) {
    if (!
cmd_access(id,level,cid,0))
        return 
PLUGIN_HANDLED;
    
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        if (
voting) {
            
client_print(id,print_console,"The vote is already in process!")
        }
        else {
            new 
iPlayers[32], iNumiPlayer
            get_players
(iPlayers,iNum,"i")
            for (new 
0iNumi++) {
                
iPlayer iPlayers[i]
                
menu menu_create("Zombie Mode Vote Menu","Mode_Menu")
                
menu_additem(menu,"Infection")
                
menu_additem(menu,"NEMESIS")
                
menu_additem(menu,"ASSASSIN")
                
menu_setpropmenuMPROP_EXITMEXIT_ALL )
                
menu_display(iPlayer,menu)
            }
        }
        
voting true
        set_task
(5.0,"EndVote")
    }
    
    return 
PLUGIN_HANDLED;
}

public 
Mode_Menu(idmenuitem) {
    if ( 
item == MENU_EXIT || !voting )
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
szData[6];
    
    new 
voteid_num str_to_numszData );
    
gVotes[voteid_num] += 1;
    
    return 
PLUGIN_HANDLED;
}

public 
EndVote()
 {
    
//This will hold how many different votes were selected
    
new votes_select;

    
//This will hold the top 3 votes
    
new votes[3];

    
//This will hold the top 3 selected voteids
    
new voteid[3];

    new 
ij;

    
//Loop through all the voteids
    
for ( i=0i<MAX_VOTEIDSi++ )
    {
        
//If the voteid recieved any votes
        
if ( gVotes[i] )
        {
            
//If we are still trying to get the top 3
            
if ( votes_select )
            {
                
//Save the data for the current voteid selected
                
votes[votes_select] = gVotes[i];
                
voteid[votes_select] = i;

                
//Go to the next voteid that might have been selected
                
votes_select++;
            }
            else
            {
                
//Loop through all the top votes, replace any that are lower than the selected voteid
                
for ( j=0j<3j++ )
                {
                    
//If this one recieved less votes
                    
if ( votes[j] < gVotes[i] )
                    {
                        
//Change the data to the voteid with more votes
                        
votes[j] = gVotes[i];
                        
voteid[j] = i;

                        
//Don't need to bother looking for more
                        
break;
                    }
                }
            }
        }
    }

    
//If noone voted
    
if ( !votes_select )
    {
        
client_print(0print_chat"No one voted!" );
    }
    
//Else if one voteid recieved all the votes
    
else if ( votes_select == )
    {
        
next_mode INFECTION
        use_command 
true
        client_print
(0,print_chat,"Choosing finished! The Zombie Mode will be Infection in to the next round!")
    }
    
//Else if two different voteids recieved all the votes
    
else if ( votes_select == )
    {
        
//If they recieved even votes
        
if ( votes[0] == votes[1] )
        {
            
next_mode_b Modes_b:random(_:Modes_b)
            if (
next_mode_b == INF)
                
next_mode INFECTION
            
else {
                
next_mode NEMESIS
       
}
            
use_command true
            client_print
(0print_chat"Tied between Infection and NEMESIS! The Zombie Mode will choose randomly in to the next round!" );
        }

        
//Else if the first recieved the most
        
else if ( votes[0] > votes[1] )
        {
            
next_mode INFECTION
            use_command 
true
            client_print
(0,print_chat,"Choosing finished! The Zombie Mode will be Infection in to the next round!")
        }

        
//Else the second recieved the most
        
else
        {
            
next_mode NEMESIS
            use_command 
true
            client_print
(0,print_chat,"Choosing finished! The Zombie Mode will be NEMESIS in to the next round!")
        }
    }
    
//Else there were at least 3 different votes
    
else
    {
        
next_mode Modes:random(_:Modes)
        
use_command=  true
        client_print
(0,print_chat,"Could not determine a winner! The Zombie Mode will choose randomly in to the next round!")
    }

    
menu_destroymenu );
    
voting false
 
}

public 
ChangeTeam() {
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        new 
iPlayers[32], iNumiPlayer;
        
get_players(iPlayersiNum"a")
        for (new 
0iNumi++) {
            
iPlayer iPlayers[i]
            if (!
zombie[iPlayer] && !nemesis[iPlayer] && !assassin[iPlayer]) {
                
cs_set_user_team(iPlayerCS_TEAM_CT)
                
cs_set_user_model(iPlayer,"redswar_bird")
            }
            else {
                
cs_set_user_team(iPlayerCS_TEAM_T)
                if (
zombie[iPlayer])
                    
cs_set_user_model(iPlayer,"redswar_zombie")
                else if (
nemesis[iPlayer])
                    
cs_set_user_model(iPlayer,"redswar_nemesis")
                else if (
assassin[iPlayer])
                    
cs_set_user_model(iPlayer,"redswar_assassin")
                
            }
        }
    }
}

public 
plugin_cfg() 

    
register_message(get_user_msgid("StatusIcon"), "Message_StatusIcon");
}

public 
Message_StatusIcon(iMsgIdiMsgDestid

    static 
szIcon[8]; 
    
get_msg_arg_string(2szIconcharsmax(szIcon)); 
    if( 
equal(szIcon"buyzone") )
    { 
        if( 
get_msg_arg_int(1) ) 
        { 
            
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0));
            return 
PLUGIN_HANDLED
        } 
    } 
     
    return 
PLUGIN_CONTINUE
}

public 
onPickUp(entityid) {
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        if (!
is_user_alive(id))
            return 
HAM_IGNORED;
        
        if (
zombie[id] || nemesis[id] || assassin[id])
            return 
HAM_SUPERCEDE;
        
    }
    return 
HAM_IGNORED;
}

public 
onUse(thisidcalleridactivator)
{
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        if (!
is_user_alive(idactivator))
            return 
HAM_IGNORED;
        
        if (
zombie[idactivator] || nemesis[idactivator] || assassin[idactivator])
            return 
HAM_SUPERCEDE;
        
    }
    return 
HAM_IGNORED;
}

public 
RW_M() {
    new 
iPlayers[32], iNumiPlayer;
    
get_players(iPlayers,iNum,"a")
    for (new 
0iNumi++) {
        
iPlayer iPlayers[i]
        if (
is_user_alive(iPlayer)) {
            new 
mapname[32]
            
get_mapname(mapname,31)
            if (
equal(mapname,"redswar_zm")) {
                if (
cs_get_user_team(iPlayer) == CS_TEAM_CT) {
                    
cs_set_user_model(iPlayer,"redswar_bird")
                }
                else if (
cs_get_user_team(iPlayer) == CS_TEAM_T) {
                    if (
zombie[iPlayer])
                        
cs_set_user_model(iPlayer,"redswar_zombie")
                    else if (
nemesis[iPlayer])
                        
cs_set_user_model(iPlayer,"redswar_nemesis")
                    else if (
assassin[iPlayer])
                        
cs_set_user_model(iPlayer,"redswar_assassin")
                }
            }
            else {
                if (
cs_get_user_team(iPlayer) == CS_TEAM_CT) {
                    if (
cs_get_user_vip(iPlayer)) {
                        
cs_set_user_model(iPlayer,"redswar_vip")
                    }
                    else {
                        
cs_set_user_model(iPlayer,"redswar_bird")
                    }
                }
                else if (
cs_get_user_team(iPlayer) == CS_TEAM_T) {
                    
cs_set_user_model(iPlayer,"redswar_pig")
                }
            }
        }
    }
}

public 
onRoundEnd() {
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equali(mapname,"redswar_tdm")) {
        new 
id[32], numtarget
        get_players
(id,num,"ch")
        for (new 
0numi++) {
            
target id[i]
            
client_print(target,print_chat,"[Red's War] Something's wrong! The Round is over in Team Deathmatch Mode!")
        }
    }
}

public 
time_count() {
    new 
id[32], numtarget;
    
get_players(id,num,"ch")
    for (new 
0numi++) {
        
target id[i]
        if (!
scoremode[target]) {
            new 
mapname[32]
            
get_mapname(mapname,31)
            if (
equal(mapname,"redswar_tdm")) {
                
timeleft get_timeleft()
                
set_hudmessage(2552550, -1.00.0101.01.00.10.9)
                
show_hudmessage(target"Timeleft: %d:%02d", (timeleft/60),(timeleft%60))
                if (
timeleft == 9) {
                    
client_cmd(target,"spk %s"nine)
                }
                if (
timeleft == 8) {
                    
client_cmd(target,"spk %s"eight)
                }
                if (
timeleft == 7) {
                    
client_cmd(target,"spk %s"seven)
                }
                if (
timeleft == 6) {
                    
client_cmd(target,"spk %s"six)
                }
                if (
timeleft == 5) {
                    
client_cmd(target,"spk %s"five)
                }
                if (
timeleft == 4) {
                    
client_cmd(target,"spk %s"four)
                }
                if (
timeleft == 3) {
                    
client_cmd(target,"spk %s"three)
                }
                if (
timeleft == 2) {
                    
client_cmd(target,"spk %s"two)
                }
                if (
timeleft == 1) {
                    
client_cmd(target,"spk %s"one)
                }
            }
        }
    }
}

public 
onDamage(victiminflictorattackerFloat:damagedmg_bits) {
    if (
dmg_bits DMG_FALL || (dmg_bits DMG_HEGRENADE && victim == attacker))
        return 
HAM_SUPERCEDE;
    
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        if (
zombie[attacker] && !zombie[victim]) {
            if (
get_birds() == 1)
                return 
HAM_IGNORED;
            
            
zombie[victim] = true
            cs_set_user_team
(victim,CS_TEAM_T)
            
strip_user_weapons(victim)
            
give_item(victim,"weapon_knife")
            
set_user_health(victim,500)
            if (
is_user_alive(attacker)) {
                
yourpoint[attacker] += 1
                
new iAmount get_user_frags(attacker)+1
                set_user_frags
(attacker,iAmount)
                if (
yourpoint[attacker] == 10) {
                    if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                        
scoremode[attacker] = true
                        client_cmd
(attacker,"stopsound")
                        
client_cmd(attacker,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(attacker"10 Infects!!!")
                        
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                    }
                }
                if (
yourpoint[attacker] == 20) {
                    if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                        
scoremode[attacker] = true
                        client_cmd
(attacker,"stopsound")
                        
client_cmd(attacker,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(attacker"20 Infects!!!")
                        
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                    }
                }
                if (
yourpoint[attacker] == 40) {
                    if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                        
scoremode[attacker] = true
                        client_cmd
(attacker,"stopsound")
                        
client_cmd(attacker,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(attacker"40 Infects!!!")
                        
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                    }
                }
                if (
yourpoint[attacker] == 80) {
                    if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                        
scoremode[attacker] = true
                        client_cmd
(attacker,"stopsound")
                        
client_cmd(attacker,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(attacker"80 Infects!!!")
                        
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                    }
                }
            }
            
            return 
HAM_SUPERCEDE;
        }
        else if (
nemesis[attacker] || assassin[attacker]) {
            if (!
angry[victim]) {
                
user_kill(victim)
                if (
get_birds() == && g_mode == NEMESIS) {
                    new 
iPlayers[32], iNumiPlayer;
                    
get_players(iPlayersiNum"a")
                    for (new 
0iNumi++) {
                        
iPlayer iPlayers[i]
                        if (
nemesis[iPlayer]) {
                            
zombie[iPlayer] = false
                            nemesis
[iPlayer] = false
                            assassin
[iPlayer] = true
                            cs_set_user_team
(iPlayer,CS_TEAM_T)
                            
strip_user_weapons(iPlayer)
                            
give_item(iPlayer,"weapon_knife")
                            
set_user_health(iPlayer,5000)
                            
set_user_maxspeed(iPlayer,480.0)
                            
client_cmd(0,"stopsound")
                            
client_cmd(0,"spk %s",assassin_music)
                        }
                        else {
                            
angry[iPlayer] = true
                            set_user_health
(iPlayer,5000)
                            
strip_user_weapons(iPlayer)
                            
give_item(iPlayer,"weapon_xm1014")
                            
cs_set_user_bpammo(iPlayer,CSW_XM1014,999)
                            
set_user_health(iPlayer,5000)
                            
set_user_maxspeed(iPlayer,480.0)
                        }
                    }
                }
                if (
is_user_alive(attacker)) {
                    
yourpoint[attacker] += 1
                    
new iAmount get_user_frags(attacker)+1
                    set_user_frags
(attacker,iAmount)
                    if (
yourpoint[attacker] == 10) {
                        if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                            
scoremode[attacker] = true
                            client_cmd
(attacker,"stopsound")
                            
client_cmd(attacker,"spk %s",zombie_levelup)
                            
set_hudmessage(02550, -1.00.5500.54.0)
                            
show_hudmessage(attacker"10 Kills!!!")
                            
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                        }
                    }
                    if (
yourpoint[attacker] == 20) {
                        if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                            
scoremode[attacker] = true
                            client_cmd
(attacker,"stopsound")
                            
client_cmd(attacker,"spk %s",zombie_levelup)
                            
set_hudmessage(02550, -1.00.5500.54.0)
                            
show_hudmessage(attacker"20 Kills!!!")
                            
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                        }
                    }
                    if (
yourpoint[attacker] == 40) {
                        if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                            
scoremode[attacker] = true
                            client_cmd
(attacker,"stopsound")
                            
client_cmd(attacker,"spk %s",zombie_levelup)
                            
set_hudmessage(02550, -1.00.5500.54.0)
                            
show_hudmessage(attacker"40 Kills!!!")
                            
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                        }
                    }
                    if (
yourpoint[attacker] == 80) {
                        if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                            
scoremode[attacker] = true
                            client_cmd
(attacker,"stopsound")
                            
client_cmd(attacker,"spk %s",zombie_levelup)
                            
set_hudmessage(02550, -1.00.5500.54.0)
                            
show_hudmessage(attacker"80 Kills!!!")
                            
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                        }
                    }
                }
            }
        }
    }
    
    return 
HAM_IGNORED;
}

public 
onDeath() {
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_tdm") || equal(mapname,"redswar_bd") || equal(mapname,"redswar_hr") || equal(mapname,"redswar_vip")) {
        if (
iKiller && iVictim && iKiller != iVictim) {
            if (
is_user_alive(iKiller)) {
                if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                    
bird_point++
                }
                else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                    
pig_point++
                }
                
yourpoint[iKiller] += 1
                
if (yourpoint[iKiller] == 10) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        if (
cs_get_user_vip(iKiller)) {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",vip_levelup)
                            
set_hudmessage(00255, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"10 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                        else {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",bird_levelup)
                            
set_hudmessage(25500, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"10 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",pig_levelup)
                        
set_hudmessage(02550, -1.00.5500.53.0)
                        
show_hudmessage(iKiller"10 Kills!!!")
                        
set_task(3.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 20) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        if (
cs_get_user_vip(iKiller)) {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",vip_levelup)
                            
set_hudmessage(00255, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"20 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                        else {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",bird_levelup)
                            
set_hudmessage(25500, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"20 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",pig_levelup)
                        
set_hudmessage(02550, -1.00.5500.53.0)
                        
show_hudmessage(iKiller"20 Kills!!!")
                        
set_task(3.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 40) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        if (
cs_get_user_vip(iKiller)) {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",vip_levelup)
                            
set_hudmessage(00255, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"40 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                        else {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",bird_levelup)
                            
set_hudmessage(25500, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"40 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",pig_levelup)
                        
set_hudmessage(02550, -1.00.5500.53.0)
                        
show_hudmessage(iKiller"40 Kills!!!")
                        
set_task(3.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 80) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        if (
cs_get_user_vip(iKiller)) {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",vip_levelup)
                            
set_hudmessage(00255, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"80 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                        else {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",bird_levelup)
                            
set_hudmessage(25500, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"80 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",pig_levelup)
                        
set_hudmessage(02550, -1.00.5500.53.0)
                        
show_hudmessage(iKiller"80 Kills!!!")
                        
set_task(3.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
            }
        }
    }
    else if (
equal(mapname,"redswar_zm")) {
        if (
iKiller && iVictim && iKiller != iVictim) {
            if (
is_user_alive(iKiller)) {
                
yourpoint[iKiller] += 1
                
if (yourpoint[iKiller] == 10) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",bird_levelup)
                        
set_hudmessage(25500, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"10 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"10 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 20) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",bird_levelup)
                        
set_hudmessage(25500, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"20 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"20 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 40) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",bird_levelup)
                        
set_hudmessage(25500, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"40 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"40 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 80) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",bird_levelup)
                        
set_hudmessage(25500, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"80 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"80 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
            }
        }
    }
}

public 
event_new_round() {
    new 
id[32], numtarget
    get_players
(id,num,"ch")
    for (new 
0numi++) {
        
target id[i]
        
spawn_start[target] = true
        win_mode 
0
    
}
    
set_task(0.1,"ZombieTime",0,"",0,"a",1)
    
set_task(5.0,"CheckNemesis")
}

public 
ZombieTime() {
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        new 
id get_random_player("a")
        
g_mode Modes:random(_:Modes)
        if (
use_command) {
            
g_mode next_mode
            use_command 
false
        
}
        if (
g_mode == INFECTION) {
            
zombie[id] = true
            nemesis
[id] = false
            assassin
[id] = false
            cs_set_user_team
(id,CS_TEAM_T)
            
strip_user_weapons(id)
            
give_item(id,"weapon_knife")
            
set_user_health(id,500)
            
set_user_maxspeed(id,240.0)
            
client_cmd(id,"stopsound")
            
client_cmd(id,"spk %s",zombie_music)
        }
        else if (
g_mode == NEMESIS) {
            
zombie[id] = false
            nemesis
[id] = true
            assassin
[id] = false
            cs_set_user_team
(id,CS_TEAM_T)
            
strip_user_weapons(id)
            
give_item(id,"weapon_knife")
            
set_user_health(id,10000)
            
set_user_maxspeed(id,120.0)
            
client_cmd(id,"stopsound")
            
client_cmd(id,"spk %s",zombie_music)
        }
        else if (
g_mode == ASSASSIN) {
            
zombie[id] = false
            nemesis
[id] = false
            assassin
[id] = true
            cs_set_user_team
(id,CS_TEAM_T)
            
strip_user_weapons(id)
            
give_item(id,"weapon_knife")
            
set_user_health(id,5000)
            
set_user_maxspeed(id,480.0)
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",assassin_music)
        }
        new 
iPlayers[32], iNumiPlayer;
        
get_players(iPlayersiNum"a")
        for (new 
0iNumi++) {
            
iPlayer iPlayers[i]
            if (
iPlayer != id) {
                
set_user_maxspeed(iPlayer,240.0)
                
cs_set_user_team(iPlayer,CS_TEAM_CT)
                
zombie[iPlayer] = false
                nemesis
[iPlayer] = false
                assassin
[iPlayer] = false
                angry
[iPlayer] = false
            
}
        }
    }
}

public 
CheckNemesis() {
    if (
get_birds() == && g_mode == NEMESIS) {
        new 
iPlayers[32], iNumiPlayer;
        
get_players(iPlayersiNum"a")
        for (new 
0iNumi++) {
            
iPlayer iPlayers[i]
            if (
nemesis[iPlayer]) {
                
zombie[iPlayer] = false
                nemesis
[iPlayer] = false
                assassin
[iPlayer] = true
                cs_set_user_team
(iPlayer,CS_TEAM_T)
                
strip_user_weapons(iPlayer)
                
give_item(iPlayer,"weapon_knife")
                
set_user_health(iPlayer,5000)
                
set_user_maxspeed(iPlayer,480.0)
                
client_cmd(0,"stopsound")
                
client_cmd(0,"spk %s",assassin_music)
            }
            else {
                
angry[iPlayer] = true
                set_user_health
(iPlayer,5000)
                
strip_user_weapons(iPlayer)
                
give_item(iPlayer,"weapon_xm1014")
                
cs_set_user_bpammo(iPlayer,CSW_XM1014,999)
                
set_user_health(iPlayer,5000)
                
set_user_maxspeed(iPlayer,480.0)
            }
        }
    }
}

public 
fwHamPlayerSpawnPost(id) {
    if (
spawn_start[id]) {
        
spawn_music[id] = true
        spawn_start
[id] = false
    
}
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_tdm") || equal(mapname,"redswar_bd") || equal(mapname,"redswar_hr") || equal(mapname,"redswar_vip")) {
        if (
spawn_music[id]) {
            if (
is_user_alive(id)) {
                if (
cs_get_user_team(id) == CS_TEAM_CT) {
                    if (
cs_get_user_vip(id) == 1) {
                        
client_cmd(id,"stopsound")
                        
client_cmd(id,"spk %s",vip_music)
                        
spawn_music[id] = false
                    
}
                    else {
                        
client_cmd(id,"stopsound")
                        
client_cmd(id,"spk %s",bird_music)
                        
spawn_music[id] = false
                    
}
                }
                else if (
cs_get_user_team(id) == CS_TEAM_T) {
                    
client_cmd(id,"stopsound")
                    
client_cmd(id,"spk %s",pig_music)
                    
spawn_music[id] = false
                
}
            }
        }
    }
    else if (
equal(mapname,"redswar_zm")) {
        if (
spawn_music[id]) {
            if (
is_user_alive(id)) {
                
client_cmd(id,"stopsound")
                
client_cmd(id,"spk %s",bird_music)
                
spawn_music[id] = false
            
}
        }
    }
}

public 
stop_score_mode(id) { 
    
scoremode[id] = false
}

public 
Bird_Win(id) {
    if (
win_mode == 0) {
        
bird_score++
        
win_mode 1
    
}
}

public 
Pig_Win(id) {
    if (
win_mode == 0) {
        
pig_score++
        
win_mode 1
    
}
}

public 
Bomb_Exploded(id) {
    if (
win_mode == 0) {
        
pig_score++
        
win_mode 1
    
}
}

public 
Hostages_Rescued(id) {
    if (
win_mode == 0) {
        
bird_score++
        
win_mode 1
    
}
}

public 
Hostages_Lost(id) {
    if (
win_mode == 0) {
        
pig_score++
        
win_mode 1
    
}
}

public 
VIP_Dead(id) {
    if (
win_mode == 0) {
        
pig_score++
        
win_mode 1
    
}
}

public 
VIP_Lost(id) {
    if (
win_mode == 0) {
        
pig_score++
        
win_mode 1
    
}
}

public 
TheEnd() {
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_tdm")) {
        if (
bird_point pig_point) {
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",bird_winner)
        }
        else if (
bird_point pig_point) {
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",pig_winner)
        }
    }
    else if (
equal(mapname,"redswar_bd") || equal(mapname,"redswar_hr") || equal(mapname,"redswar_vip")) {
        if (
bird_score pig_score) {
            new 
id[32], numtarget
            get_players
(id,num,"ch")
            for (new 
0numi++) {
                
target id[i]
                if (
cs_get_user_vip(target)) {
                    
client_cmd(target,"stopsound")
                    
client_cmd(target,"spk %s",vip_winner)
                }
                else {
                    
client_cmd(target,"stopsound")
                    
client_cmd(target,"spk %s",bird_winner)
                }
            }
        }
        else if (
bird_score pig_score) {
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",pig_winner)
        }
    }
    else if (
equal(mapname,"redswar_zm")) {
        if (
bird_score pig_score) {
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",bird_winner)
        }
        else if (
bird_score pig_score) {
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",zombie_winner)
        }
    }
}

public 
Team_Events( ) 
{
    if (
win_mode == 0) {
    new 
szEvent64 ]
    
read_logargv(2szEventcharsmax(szEvent))
    
    if (
equal(szEvent,"Defused_The_Bomb")) {
        
bird_score++
        
win_mode 1
    
}
    
    else if (
equal(szEvent,"Escaped_As_VIP")) {
        
bird_score++
        
win_mode 1
    
}
    }
}

public 
client_putinserver(id) {
    
spawn_music[id] = true
    spawn_start
[id] = true
}

public 
client_connect(id) {
    
yourpoint[id] = 0
}

public 
client_disconnect(id) {
    
yourpoint[id] = 0
    scoremode
[id] = false
}

stock get_random_player(const flags[]="", const team[]="") {
    new 
iPlayers[32], iNum;
    
get_players(iPlayersiNumflagsteam)
    
    return (
iNum 0) ? iPlayers[random(iNum)] : -1;
}

get_birds() {
    new 
players[32], pnumbirdsid;
    
get_players(playerspnum"ae","CT");

    for (--
pnumpnum >= 0pnum--)
    {
        
id players[pnum];

        if (!
zombie[id])
            
birds++;
    }

    return 
birds;

But still doesn't work!

Last edited by MihaiGamerXD; 12-08-2018 at 12:33.
MihaiGamerXD is online now
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Location: ISR
Old 12-08-2018 , 17:07   Re: How to make Vote Menu?
Reply With Quote #7

Quote:
Originally Posted by MihaiGamerXD View Post
Now I have the another code!
Here:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <fakemeta>

#define MAX_VOTEIDS 3

#define MAX_PLAYERS 32

new gVotes[MAX_VOTEIDS];

const 
DMG_HEGRENADE = (1<<24)

new 
yourpoint[MAX_PLAYERS+1]

new 
voting

new menu

static zombie[33]
static 
nemesis[33]
static 
assassin[33]
static 
angry[33]

enum Modes
{
    
INFECTION,
    
NEMESIS,
    
ASSASSIN
}

enum Modes_b
{
    
INF,
    
NEM
}

new 
Modes_b:next_mode_b

new Modes:g_mode

new Modes:next_mode

new use_command

new timeleft

static spawn_start[33]

static 
spawn_music[33]

static 
scoremode[33]

new 
bird_point 0;
new 
pig_point 0;
new 
bird_score 0;
new 
pig_score 0;

new 
win_mode 0;

new const 
bird_music[] = "redswar/music/bird_respawn.wav"
new const pig_music[] = "redswar/music/pig_respawn.wav"
new const vip_music[] = "redswar/music/vip_respawn.wav"
new const zombie_music[] = "redswar/music/zombie_respawn.wav"
new const bird_winner[] = "redswar/music/bird_winner.wav"
new const pig_winner[] = "redswar/music/pig_winner.wav"
new const vip_winner[] = "redswar/music/vip_winner.wav"
new const zombie_winner[] = "redswar/music/zombie_winner.wav"
new const bird_levelup[] = "redswar/music/bird_levelup.wav"
new const pig_levelup[] = "redswar/music/pig_levelup.wav"
new const vip_levelup[] = "redswar/music/vip_levelup.wav"
new const zombie_levelup[] = "redswar/music/zombie_levelup.wav"
new const assassin_music[] = "redswar/music/assassin_mode.wav"
new const nine[] = "redswar/voices/9.wav"
new const eight[] = "redswar/voices/8.wav"
new const seven[] = "redswar/voices/7.wav"
new const six[] = "redswar/voices/6.wav"
new const five[] = "redswar/voices/5.wav"
new const four[] = "redswar/voices/4.wav"
new const three[] = "redswar/voices/3.wav"
new const two[] = "redswar/voices/2.wav"
new const one[] = "redswar/voices/1.wav"
new const bird_model[] = "models/player/redswar_bird/redswar_bird.mdl"
new const pig_model[] = "models/player/redswar_pig/redswar_pig.mdl"
new const vip_model[] = "models/player/redswar_vip/redswar_vip.mdl"
new const zombie_model[] = "models/player/redswar_zombie/redswar_zombie.mdl"
new const nemesis_model[] = "models/player/redswar_nemesis/redswar_nemesis.mdl"
new const assassin_model[] = "models/player/redswar_assassin/redswar_assassin.mdl"

public plugin_precache() {
    
precache_sound(bird_music)
    
precache_sound(pig_music)
    
precache_sound(vip_music)
    
precache_sound(zombie_music)
    
precache_sound(bird_winner)
    
precache_sound(pig_winner)
    
precache_sound(vip_winner)
    
precache_sound(zombie_winner)
    
precache_sound(bird_levelup)
    
precache_sound(pig_levelup)
    
precache_sound(vip_levelup)
    
precache_sound(zombie_levelup)
    
precache_sound(assassin_music)
    
precache_sound(nine)
    
precache_sound(eight)
    
precache_sound(seven)
    
precache_sound(six)
    
precache_sound(five)
    
precache_sound(four)
    
precache_sound(three)
    
precache_sound(two)
    
precache_sound(one)
    
precache_model(bird_model)
    
precache_model(pig_model)
    
precache_model(vip_model)
    
precache_model(zombie_model)
    
precache_model(nemesis_model)
    
precache_model(assassin_model)
}

public 
plugin_init() {
    
register_plugin("Red's War""1.0""MihaiGamerXD")
    
set_task(1.0,"time_count",0,"",0,"b")
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)
    
RegisterHam(Ham_Touch"armoury_entity""onPickUp")
    
RegisterHam(Ham_Touch"weaponbox""onPickUp")
    
RegisterHam(Ham_Touch"weapon_shield""onPickUp")
    
RegisterHam(Ham_TakeDamage"player""onDamage")
    
RegisterHam(Ham_Use"func_tank""onUse")
    
register_event("DeathMsg","onDeath","a")
    
register_event("30","TheEnd","a")
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
register_logevent("Bird_Win",6,"3=CTs_Win")
    
register_logevent("Pig_Win",6,"3=Terrorists_Win")
    
register_logevent("Bomb_Exploded",6,"3=Target_Bombed")
    
register_logevent("Hostages_Rescued",6,"3=All_Hostages_Rescued")
    
register_logevent("Hostages_Lost",6,"3=Hostages_Not_Rescued")
    
register_logevent("VIP_Dead",6,"3=VIP_Assassinated")
    
register_logevent("VIP_Lost",6,"3=VIP_Not_Escaped")
    
register_logevent("Team_Events"3"1=triggered")
    
register_logevent("onRoundEnd",2,"1=Round_End")
    
set_task(0.1,"RW_M",0,"",0,"b")
    
set_task(0.1,"ChangeTeam",0,"",0,"b")
    
register_concmd("zm_mode","Zm_Mode",ADMIN_LEVEL_E,"Zombie Mode")
    
register_concmd("zm_vote","Vote_Mode",ADMIN_LEVEL_E,"Vote Zombie Mode")
}

public 
Zm_Mode(idlevelcid) {
    if (!
cmd_access(id,level,cid,0))
        return 
PLUGIN_HANDLED;
    
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        new 
arg[32]
        
read_args(arg,31)
        
remove_quotes(arg)
        if (
equal(arg,"Infection")) {
            
next_mode INFECTION
            client_print
(id,print_console,"The Zombie Mode will be Infection in to the next round!")
            
use_command true;
        }
        else if (
equal(arg,"NEMESIS")) {
            
next_mode NEMESIS
            client_print
(id,print_console,"The Zombie Mode will be NEMESIS in to the next round!")
            
use_command true;
        }
        else if (
equal(arg,"ASSASSIN")) {
            
next_mode ASSASSIN
            client_print
(id,print_console,"The Zombie Mode will be ASSASSIN in to the next round!")
            
use_command true;
        }
        else {
            
client_print(id,print_console,"Invalid Zombie Mode!")
        }
    }
    else {
        
client_print(idprint_console,"That command is used only for Zombie Map!")
    }
    
    return 
PLUGIN_HANDLED;
}

public 
Vote_Mode(id,level,cid) {
    if (!
cmd_access(id,level,cid,0))
        return 
PLUGIN_HANDLED;
    
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        if (
voting) {
            
client_print(id,print_console,"The vote is already in process!")
        }
        else {
            new 
iPlayers[32], iNumiPlayer
            get_players
(iPlayers,iNum,"i")
            for (new 
0iNumi++) {
                
iPlayer iPlayers[i]
                
menu menu_create("Zombie Mode Vote Menu","Mode_Menu")
                
menu_additem(menu,"Infection")
                
menu_additem(menu,"NEMESIS")
                
menu_additem(menu,"ASSASSIN")
                
menu_setpropmenuMPROP_EXITMEXIT_ALL )
                
menu_display(iPlayer,menu)
            }
        }
        
voting true
        set_task
(5.0,"EndVote")
    }
    
    return 
PLUGIN_HANDLED;
}

public 
Mode_Menu(idmenuitem) {
    if ( 
item == MENU_EXIT || !voting )
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
szData[6];
    
    new 
voteid_num str_to_numszData );
    
gVotes[voteid_num] += 1;
    
    return 
PLUGIN_HANDLED;
}

public 
EndVote()
 {
    
//This will hold how many different votes were selected
    
new votes_select;

    
//This will hold the top 3 votes
    
new votes[3];

    
//This will hold the top 3 selected voteids
    
new voteid[3];

    new 
ij;

    
//Loop through all the voteids
    
for ( i=0i<MAX_VOTEIDSi++ )
    {
        
//If the voteid recieved any votes
        
if ( gVotes[i] )
        {
            
//If we are still trying to get the top 3
            
if ( votes_select )
            {
                
//Save the data for the current voteid selected
                
votes[votes_select] = gVotes[i];
                
voteid[votes_select] = i;

                
//Go to the next voteid that might have been selected
                
votes_select++;
            }
            else
            {
                
//Loop through all the top votes, replace any that are lower than the selected voteid
                
for ( j=0j<3j++ )
                {
                    
//If this one recieved less votes
                    
if ( votes[j] < gVotes[i] )
                    {
                        
//Change the data to the voteid with more votes
                        
votes[j] = gVotes[i];
                        
voteid[j] = i;

                        
//Don't need to bother looking for more
                        
break;
                    }
                }
            }
        }
    }

    
//If noone voted
    
if ( !votes_select )
    {
        
client_print(0print_chat"No one voted!" );
    }
    
//Else if one voteid recieved all the votes
    
else if ( votes_select == )
    {
        
next_mode INFECTION
        use_command 
true
        client_print
(0,print_chat,"Choosing finished! The Zombie Mode will be Infection in to the next round!")
    }
    
//Else if two different voteids recieved all the votes
    
else if ( votes_select == )
    {
        
//If they recieved even votes
        
if ( votes[0] == votes[1] )
        {
            
next_mode_b Modes_b:random(_:Modes_b)
            if (
next_mode_b == INF)
                
next_mode INFECTION
            
else {
                
next_mode NEMESIS
       
}
            
use_command true
            client_print
(0print_chat"Tied between Infection and NEMESIS! The Zombie Mode will choose randomly in to the next round!" );
        }

        
//Else if the first recieved the most
        
else if ( votes[0] > votes[1] )
        {
            
next_mode INFECTION
            use_command 
true
            client_print
(0,print_chat,"Choosing finished! The Zombie Mode will be Infection in to the next round!")
        }

        
//Else the second recieved the most
        
else
        {
            
next_mode NEMESIS
            use_command 
true
            client_print
(0,print_chat,"Choosing finished! The Zombie Mode will be NEMESIS in to the next round!")
        }
    }
    
//Else there were at least 3 different votes
    
else
    {
        
next_mode Modes:random(_:Modes)
        
use_command=  true
        client_print
(0,print_chat,"Could not determine a winner! The Zombie Mode will choose randomly in to the next round!")
    }

    
menu_destroymenu );
    
voting false
 
}

public 
ChangeTeam() {
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        new 
iPlayers[32], iNumiPlayer;
        
get_players(iPlayersiNum"a")
        for (new 
0iNumi++) {
            
iPlayer iPlayers[i]
            if (!
zombie[iPlayer] && !nemesis[iPlayer] && !assassin[iPlayer]) {
                
cs_set_user_team(iPlayerCS_TEAM_CT)
                
cs_set_user_model(iPlayer,"redswar_bird")
            }
            else {
                
cs_set_user_team(iPlayerCS_TEAM_T)
                if (
zombie[iPlayer])
                    
cs_set_user_model(iPlayer,"redswar_zombie")
                else if (
nemesis[iPlayer])
                    
cs_set_user_model(iPlayer,"redswar_nemesis")
                else if (
assassin[iPlayer])
                    
cs_set_user_model(iPlayer,"redswar_assassin")
                
            }
        }
    }
}

public 
plugin_cfg() 

    
register_message(get_user_msgid("StatusIcon"), "Message_StatusIcon");
}

public 
Message_StatusIcon(iMsgIdiMsgDestid

    static 
szIcon[8]; 
    
get_msg_arg_string(2szIconcharsmax(szIcon)); 
    if( 
equal(szIcon"buyzone") )
    { 
        if( 
get_msg_arg_int(1) ) 
        { 
            
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0));
            return 
PLUGIN_HANDLED
        } 
    } 
     
    return 
PLUGIN_CONTINUE
}

public 
onPickUp(entityid) {
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        if (!
is_user_alive(id))
            return 
HAM_IGNORED;
        
        if (
zombie[id] || nemesis[id] || assassin[id])
            return 
HAM_SUPERCEDE;
        
    }
    return 
HAM_IGNORED;
}

public 
onUse(thisidcalleridactivator)
{
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        if (!
is_user_alive(idactivator))
            return 
HAM_IGNORED;
        
        if (
zombie[idactivator] || nemesis[idactivator] || assassin[idactivator])
            return 
HAM_SUPERCEDE;
        
    }
    return 
HAM_IGNORED;
}

public 
RW_M() {
    new 
iPlayers[32], iNumiPlayer;
    
get_players(iPlayers,iNum,"a")
    for (new 
0iNumi++) {
        
iPlayer iPlayers[i]
        if (
is_user_alive(iPlayer)) {
            new 
mapname[32]
            
get_mapname(mapname,31)
            if (
equal(mapname,"redswar_zm")) {
                if (
cs_get_user_team(iPlayer) == CS_TEAM_CT) {
                    
cs_set_user_model(iPlayer,"redswar_bird")
                }
                else if (
cs_get_user_team(iPlayer) == CS_TEAM_T) {
                    if (
zombie[iPlayer])
                        
cs_set_user_model(iPlayer,"redswar_zombie")
                    else if (
nemesis[iPlayer])
                        
cs_set_user_model(iPlayer,"redswar_nemesis")
                    else if (
assassin[iPlayer])
                        
cs_set_user_model(iPlayer,"redswar_assassin")
                }
            }
            else {
                if (
cs_get_user_team(iPlayer) == CS_TEAM_CT) {
                    if (
cs_get_user_vip(iPlayer)) {
                        
cs_set_user_model(iPlayer,"redswar_vip")
                    }
                    else {
                        
cs_set_user_model(iPlayer,"redswar_bird")
                    }
                }
                else if (
cs_get_user_team(iPlayer) == CS_TEAM_T) {
                    
cs_set_user_model(iPlayer,"redswar_pig")
                }
            }
        }
    }
}

public 
onRoundEnd() {
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equali(mapname,"redswar_tdm")) {
        new 
id[32], numtarget
        get_players
(id,num,"ch")
        for (new 
0numi++) {
            
target id[i]
            
client_print(target,print_chat,"[Red's War] Something's wrong! The Round is over in Team Deathmatch Mode!")
        }
    }
}

public 
time_count() {
    new 
id[32], numtarget;
    
get_players(id,num,"ch")
    for (new 
0numi++) {
        
target id[i]
        if (!
scoremode[target]) {
            new 
mapname[32]
            
get_mapname(mapname,31)
            if (
equal(mapname,"redswar_tdm")) {
                
timeleft get_timeleft()
                
set_hudmessage(2552550, -1.00.0101.01.00.10.9)
                
show_hudmessage(target"Timeleft: %d:%02d", (timeleft/60),(timeleft%60))
                if (
timeleft == 9) {
                    
client_cmd(target,"spk %s"nine)
                }
                if (
timeleft == 8) {
                    
client_cmd(target,"spk %s"eight)
                }
                if (
timeleft == 7) {
                    
client_cmd(target,"spk %s"seven)
                }
                if (
timeleft == 6) {
                    
client_cmd(target,"spk %s"six)
                }
                if (
timeleft == 5) {
                    
client_cmd(target,"spk %s"five)
                }
                if (
timeleft == 4) {
                    
client_cmd(target,"spk %s"four)
                }
                if (
timeleft == 3) {
                    
client_cmd(target,"spk %s"three)
                }
                if (
timeleft == 2) {
                    
client_cmd(target,"spk %s"two)
                }
                if (
timeleft == 1) {
                    
client_cmd(target,"spk %s"one)
                }
            }
        }
    }
}

public 
onDamage(victiminflictorattackerFloat:damagedmg_bits) {
    if (
dmg_bits DMG_FALL || (dmg_bits DMG_HEGRENADE && victim == attacker))
        return 
HAM_SUPERCEDE;
    
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        if (
zombie[attacker] && !zombie[victim]) {
            if (
get_birds() == 1)
                return 
HAM_IGNORED;
            
            
zombie[victim] = true
            cs_set_user_team
(victim,CS_TEAM_T)
            
strip_user_weapons(victim)
            
give_item(victim,"weapon_knife")
            
set_user_health(victim,500)
            if (
is_user_alive(attacker)) {
                
yourpoint[attacker] += 1
                
new iAmount get_user_frags(attacker)+1
                set_user_frags
(attacker,iAmount)
                if (
yourpoint[attacker] == 10) {
                    if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                        
scoremode[attacker] = true
                        client_cmd
(attacker,"stopsound")
                        
client_cmd(attacker,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(attacker"10 Infects!!!")
                        
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                    }
                }
                if (
yourpoint[attacker] == 20) {
                    if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                        
scoremode[attacker] = true
                        client_cmd
(attacker,"stopsound")
                        
client_cmd(attacker,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(attacker"20 Infects!!!")
                        
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                    }
                }
                if (
yourpoint[attacker] == 40) {
                    if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                        
scoremode[attacker] = true
                        client_cmd
(attacker,"stopsound")
                        
client_cmd(attacker,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(attacker"40 Infects!!!")
                        
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                    }
                }
                if (
yourpoint[attacker] == 80) {
                    if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                        
scoremode[attacker] = true
                        client_cmd
(attacker,"stopsound")
                        
client_cmd(attacker,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(attacker"80 Infects!!!")
                        
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                    }
                }
            }
            
            return 
HAM_SUPERCEDE;
        }
        else if (
nemesis[attacker] || assassin[attacker]) {
            if (!
angry[victim]) {
                
user_kill(victim)
                if (
get_birds() == && g_mode == NEMESIS) {
                    new 
iPlayers[32], iNumiPlayer;
                    
get_players(iPlayersiNum"a")
                    for (new 
0iNumi++) {
                        
iPlayer iPlayers[i]
                        if (
nemesis[iPlayer]) {
                            
zombie[iPlayer] = false
                            nemesis
[iPlayer] = false
                            assassin
[iPlayer] = true
                            cs_set_user_team
(iPlayer,CS_TEAM_T)
                            
strip_user_weapons(iPlayer)
                            
give_item(iPlayer,"weapon_knife")
                            
set_user_health(iPlayer,5000)
                            
set_user_maxspeed(iPlayer,480.0)
                            
client_cmd(0,"stopsound")
                            
client_cmd(0,"spk %s",assassin_music)
                        }
                        else {
                            
angry[iPlayer] = true
                            set_user_health
(iPlayer,5000)
                            
strip_user_weapons(iPlayer)
                            
give_item(iPlayer,"weapon_xm1014")
                            
cs_set_user_bpammo(iPlayer,CSW_XM1014,999)
                            
set_user_health(iPlayer,5000)
                            
set_user_maxspeed(iPlayer,480.0)
                        }
                    }
                }
                if (
is_user_alive(attacker)) {
                    
yourpoint[attacker] += 1
                    
new iAmount get_user_frags(attacker)+1
                    set_user_frags
(attacker,iAmount)
                    if (
yourpoint[attacker] == 10) {
                        if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                            
scoremode[attacker] = true
                            client_cmd
(attacker,"stopsound")
                            
client_cmd(attacker,"spk %s",zombie_levelup)
                            
set_hudmessage(02550, -1.00.5500.54.0)
                            
show_hudmessage(attacker"10 Kills!!!")
                            
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                        }
                    }
                    if (
yourpoint[attacker] == 20) {
                        if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                            
scoremode[attacker] = true
                            client_cmd
(attacker,"stopsound")
                            
client_cmd(attacker,"spk %s",zombie_levelup)
                            
set_hudmessage(02550, -1.00.5500.54.0)
                            
show_hudmessage(attacker"20 Kills!!!")
                            
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                        }
                    }
                    if (
yourpoint[attacker] == 40) {
                        if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                            
scoremode[attacker] = true
                            client_cmd
(attacker,"stopsound")
                            
client_cmd(attacker,"spk %s",zombie_levelup)
                            
set_hudmessage(02550, -1.00.5500.54.0)
                            
show_hudmessage(attacker"40 Kills!!!")
                            
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                        }
                    }
                    if (
yourpoint[attacker] == 80) {
                        if (
cs_get_user_team(attacker) == CS_TEAM_T) {
                            
scoremode[attacker] = true
                            client_cmd
(attacker,"stopsound")
                            
client_cmd(attacker,"spk %s",zombie_levelup)
                            
set_hudmessage(02550, -1.00.5500.54.0)
                            
show_hudmessage(attacker"80 Kills!!!")
                            
set_task(4.0,"stop_score_mode",attacker,"",0,"a",1)
                        }
                    }
                }
            }
        }
    }
    
    return 
HAM_IGNORED;
}

public 
onDeath() {
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_tdm") || equal(mapname,"redswar_bd") || equal(mapname,"redswar_hr") || equal(mapname,"redswar_vip")) {
        if (
iKiller && iVictim && iKiller != iVictim) {
            if (
is_user_alive(iKiller)) {
                if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                    
bird_point++
                }
                else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                    
pig_point++
                }
                
yourpoint[iKiller] += 1
                
if (yourpoint[iKiller] == 10) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        if (
cs_get_user_vip(iKiller)) {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",vip_levelup)
                            
set_hudmessage(00255, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"10 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                        else {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",bird_levelup)
                            
set_hudmessage(25500, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"10 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",pig_levelup)
                        
set_hudmessage(02550, -1.00.5500.53.0)
                        
show_hudmessage(iKiller"10 Kills!!!")
                        
set_task(3.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 20) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        if (
cs_get_user_vip(iKiller)) {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",vip_levelup)
                            
set_hudmessage(00255, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"20 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                        else {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",bird_levelup)
                            
set_hudmessage(25500, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"20 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",pig_levelup)
                        
set_hudmessage(02550, -1.00.5500.53.0)
                        
show_hudmessage(iKiller"20 Kills!!!")
                        
set_task(3.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 40) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        if (
cs_get_user_vip(iKiller)) {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",vip_levelup)
                            
set_hudmessage(00255, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"40 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                        else {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",bird_levelup)
                            
set_hudmessage(25500, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"40 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",pig_levelup)
                        
set_hudmessage(02550, -1.00.5500.53.0)
                        
show_hudmessage(iKiller"40 Kills!!!")
                        
set_task(3.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 80) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        if (
cs_get_user_vip(iKiller)) {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",vip_levelup)
                            
set_hudmessage(00255, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"80 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                        else {
                            
scoremode[iKiller] = true
                            client_cmd
(iKiller,"stopsound")
                            
client_cmd(iKiller,"spk %s",bird_levelup)
                            
set_hudmessage(25500, -1.00.5500.54.0)
                            
show_hudmessage(iKiller"80 Kills!!!")
                            
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                        }
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",pig_levelup)
                        
set_hudmessage(02550, -1.00.5500.53.0)
                        
show_hudmessage(iKiller"80 Kills!!!")
                        
set_task(3.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
            }
        }
    }
    else if (
equal(mapname,"redswar_zm")) {
        if (
iKiller && iVictim && iKiller != iVictim) {
            if (
is_user_alive(iKiller)) {
                
yourpoint[iKiller] += 1
                
if (yourpoint[iKiller] == 10) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",bird_levelup)
                        
set_hudmessage(25500, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"10 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"10 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 20) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",bird_levelup)
                        
set_hudmessage(25500, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"20 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"20 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 40) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",bird_levelup)
                        
set_hudmessage(25500, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"40 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"40 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
                if (
yourpoint[iKiller] == 80) {
                    if (
cs_get_user_team(iKiller) == CS_TEAM_CT) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",bird_levelup)
                        
set_hudmessage(25500, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"80 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                    else if (
cs_get_user_team(iKiller) == CS_TEAM_T) {
                        
scoremode[iKiller] = true
                        client_cmd
(iKiller,"stopsound")
                        
client_cmd(iKiller,"spk %s",zombie_levelup)
                        
set_hudmessage(02550, -1.00.5500.54.0)
                        
show_hudmessage(iKiller"80 Kills!!!")
                        
set_task(4.0,"stop_score_mode",iKiller,"",0,"a",1)
                    }
                }
            }
        }
    }
}

public 
event_new_round() {
    new 
id[32], numtarget
    get_players
(id,num,"ch")
    for (new 
0numi++) {
        
target id[i]
        
spawn_start[target] = true
        win_mode 
0
    
}
    
set_task(0.1,"ZombieTime",0,"",0,"a",1)
    
set_task(5.0,"CheckNemesis")
}

public 
ZombieTime() {
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_zm")) {
        new 
id get_random_player("a")
        
g_mode Modes:random(_:Modes)
        if (
use_command) {
            
g_mode next_mode
            use_command 
false
        
}
        if (
g_mode == INFECTION) {
            
zombie[id] = true
            nemesis
[id] = false
            assassin
[id] = false
            cs_set_user_team
(id,CS_TEAM_T)
            
strip_user_weapons(id)
            
give_item(id,"weapon_knife")
            
set_user_health(id,500)
            
set_user_maxspeed(id,240.0)
            
client_cmd(id,"stopsound")
            
client_cmd(id,"spk %s",zombie_music)
        }
        else if (
g_mode == NEMESIS) {
            
zombie[id] = false
            nemesis
[id] = true
            assassin
[id] = false
            cs_set_user_team
(id,CS_TEAM_T)
            
strip_user_weapons(id)
            
give_item(id,"weapon_knife")
            
set_user_health(id,10000)
            
set_user_maxspeed(id,120.0)
            
client_cmd(id,"stopsound")
            
client_cmd(id,"spk %s",zombie_music)
        }
        else if (
g_mode == ASSASSIN) {
            
zombie[id] = false
            nemesis
[id] = false
            assassin
[id] = true
            cs_set_user_team
(id,CS_TEAM_T)
            
strip_user_weapons(id)
            
give_item(id,"weapon_knife")
            
set_user_health(id,5000)
            
set_user_maxspeed(id,480.0)
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",assassin_music)
        }
        new 
iPlayers[32], iNumiPlayer;
        
get_players(iPlayersiNum"a")
        for (new 
0iNumi++) {
            
iPlayer iPlayers[i]
            if (
iPlayer != id) {
                
set_user_maxspeed(iPlayer,240.0)
                
cs_set_user_team(iPlayer,CS_TEAM_CT)
                
zombie[iPlayer] = false
                nemesis
[iPlayer] = false
                assassin
[iPlayer] = false
                angry
[iPlayer] = false
            
}
        }
    }
}

public 
CheckNemesis() {
    if (
get_birds() == && g_mode == NEMESIS) {
        new 
iPlayers[32], iNumiPlayer;
        
get_players(iPlayersiNum"a")
        for (new 
0iNumi++) {
            
iPlayer iPlayers[i]
            if (
nemesis[iPlayer]) {
                
zombie[iPlayer] = false
                nemesis
[iPlayer] = false
                assassin
[iPlayer] = true
                cs_set_user_team
(iPlayer,CS_TEAM_T)
                
strip_user_weapons(iPlayer)
                
give_item(iPlayer,"weapon_knife")
                
set_user_health(iPlayer,5000)
                
set_user_maxspeed(iPlayer,480.0)
                
client_cmd(0,"stopsound")
                
client_cmd(0,"spk %s",assassin_music)
            }
            else {
                
angry[iPlayer] = true
                set_user_health
(iPlayer,5000)
                
strip_user_weapons(iPlayer)
                
give_item(iPlayer,"weapon_xm1014")
                
cs_set_user_bpammo(iPlayer,CSW_XM1014,999)
                
set_user_health(iPlayer,5000)
                
set_user_maxspeed(iPlayer,480.0)
            }
        }
    }
}

public 
fwHamPlayerSpawnPost(id) {
    if (
spawn_start[id]) {
        
spawn_music[id] = true
        spawn_start
[id] = false
    
}
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_tdm") || equal(mapname,"redswar_bd") || equal(mapname,"redswar_hr") || equal(mapname,"redswar_vip")) {
        if (
spawn_music[id]) {
            if (
is_user_alive(id)) {
                if (
cs_get_user_team(id) == CS_TEAM_CT) {
                    if (
cs_get_user_vip(id) == 1) {
                        
client_cmd(id,"stopsound")
                        
client_cmd(id,"spk %s",vip_music)
                        
spawn_music[id] = false
                    
}
                    else {
                        
client_cmd(id,"stopsound")
                        
client_cmd(id,"spk %s",bird_music)
                        
spawn_music[id] = false
                    
}
                }
                else if (
cs_get_user_team(id) == CS_TEAM_T) {
                    
client_cmd(id,"stopsound")
                    
client_cmd(id,"spk %s",pig_music)
                    
spawn_music[id] = false
                
}
            }
        }
    }
    else if (
equal(mapname,"redswar_zm")) {
        if (
spawn_music[id]) {
            if (
is_user_alive(id)) {
                
client_cmd(id,"stopsound")
                
client_cmd(id,"spk %s",bird_music)
                
spawn_music[id] = false
            
}
        }
    }
}

public 
stop_score_mode(id) { 
    
scoremode[id] = false
}

public 
Bird_Win(id) {
    if (
win_mode == 0) {
        
bird_score++
        
win_mode 1
    
}
}

public 
Pig_Win(id) {
    if (
win_mode == 0) {
        
pig_score++
        
win_mode 1
    
}
}

public 
Bomb_Exploded(id) {
    if (
win_mode == 0) {
        
pig_score++
        
win_mode 1
    
}
}

public 
Hostages_Rescued(id) {
    if (
win_mode == 0) {
        
bird_score++
        
win_mode 1
    
}
}

public 
Hostages_Lost(id) {
    if (
win_mode == 0) {
        
pig_score++
        
win_mode 1
    
}
}

public 
VIP_Dead(id) {
    if (
win_mode == 0) {
        
pig_score++
        
win_mode 1
    
}
}

public 
VIP_Lost(id) {
    if (
win_mode == 0) {
        
pig_score++
        
win_mode 1
    
}
}

public 
TheEnd() {
    new 
mapname[32]
    
get_mapname(mapname,31)
    if (
equal(mapname,"redswar_tdm")) {
        if (
bird_point pig_point) {
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",bird_winner)
        }
        else if (
bird_point pig_point) {
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",pig_winner)
        }
    }
    else if (
equal(mapname,"redswar_bd") || equal(mapname,"redswar_hr") || equal(mapname,"redswar_vip")) {
        if (
bird_score pig_score) {
            new 
id[32], numtarget
            get_players
(id,num,"ch")
            for (new 
0numi++) {
                
target id[i]
                if (
cs_get_user_vip(target)) {
                    
client_cmd(target,"stopsound")
                    
client_cmd(target,"spk %s",vip_winner)
                }
                else {
                    
client_cmd(target,"stopsound")
                    
client_cmd(target,"spk %s",bird_winner)
                }
            }
        }
        else if (
bird_score pig_score) {
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",pig_winner)
        }
    }
    else if (
equal(mapname,"redswar_zm")) {
        if (
bird_score pig_score) {
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",bird_winner)
        }
        else if (
bird_score pig_score) {
            
client_cmd(0,"stopsound")
            
client_cmd(0,"spk %s",zombie_winner)
        }
    }
}

public 
Team_Events( ) 
{
    if (
win_mode == 0) {
    new 
szEvent64 ]
    
read_logargv(2szEventcharsmax(szEvent))
    
    if (
equal(szEvent,"Defused_The_Bomb")) {
        
bird_score++
        
win_mode 1
    
}
    
    else if (
equal(szEvent,"Escaped_As_VIP")) {
        
bird_score++
        
win_mode 1
    
}
    }
}

public 
client_putinserver(id) {
    
spawn_music[id] = true
    spawn_start
[id] = true
}

public 
client_connect(id) {
    
yourpoint[id] = 0
}

public 
client_disconnect(id) {
    
yourpoint[id] = 0
    scoremode
[id] = false
}

stock get_random_player(const flags[]="", const team[]="") {
    new 
iPlayers[32], iNum;
    
get_players(iPlayersiNumflagsteam)
    
    return (
iNum 0) ? iPlayers[random(iNum)] : -1;
}

get_birds() {
    new 
players[32], pnumbirdsid;
    
get_players(playerspnum"ae","CT");

    for (--
pnumpnum >= 0pnum--)
    {
        
id players[pnum];

        if (!
zombie[id])
            
birds++;
    }

    return 
birds;

But still doesn't work!
What exactly does not work? MENU shows?

Logs?
__________________

Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
MihaiGamerXD
Member
Join Date: Aug 2018
Old 12-10-2018 , 11:58   Re: How to make Vote Menu?
Reply With Quote #8

Now it works! Sorry for late reply! But I was tested my code, and works very good!
MihaiGamerXD is online now
Reply


Thread Tools
Display Modes

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 14:21.


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