Raised This Month: $344 Target: $400
 86%   Almost there!

Knife round not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ssproxima
Senior Member
Join Date: Jan 2015
Old 03-05-2021 , 22:52   Knife round not working
Reply With Quote #1

Can someone help me to fix this plugin. Everything is working fine except knife round does not initiate.

PHP Code:
#include <amxmodx> 
#include <amxmisc>
#include <engine>  
#include <fun> 
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fakemeta_util>
#if AMXX_VERSION_NUM < 183
    #include <chatcolor>
    #include <dhudmessage>
#endif
new VERSION[] = "4.0"

new gMsgStatusIconChoose;
new 
bool:gBlockBuyZone;
new 
bool:g_bSpr false
new const g_weapons[][] =
{
    
"Knife""Shotgun""Deagle""AWP""M4A1""AK-47""TMP""Unlimited Nades""GayGun""Scout" 
}
public 
plugin_init() 

    
register_plugin("Special Round"VERSION"Abhishek")  /* Idea By : Constantine | Credits to : Exolent, Abhishek */
    
register_clcmd("say /spr""StartSpr"ADMIN_BAN);
    
register_clcmd("drop""DropBlock");
    
register_cvar("SpecialRound"VERSIONFCVAR_SERVER|FCVAR_SPONLY)
    
register_logevent("endSPR",2,"1=Round_End")
    
register_touch("weaponbox""player""WeaponTouch");
    
RegisterHam(Ham_Spawn"player""PlayerSpawn"1)
    
gMsgStatusIcon get_user_msgid("StatusIcon");
    
register_message(gMsgStatusIcon"MessageStatusIcon");
}

public 
PlayerSpawn(id){
    if(
g_bSprSendItems(id)
}

public 
StartSpr(idlvlcid

    if(!
cmd_access(idlvlcid0))
        return 
PLUGIN_HANDLED;
    if(
g_bSpr == false)
    {
        new 
SprMenu menu_create("Special Round Selector""HandleSpr")
        new 
szWeapons[64]
        
menu_setprop(SprMenuMPROP_NUMBER_COLOR"\w" );
        for(new 
isizeof(g_weapons); i++){
            
formatex(szWeaponscharsmax(szWeapons), "\y%s \rRound"g_weapons[i])  
            
menu_additem(SprMenuszWeapons)
        }
        
menu_displayidSprMenu );
        return 
SprMenu;
    }
    else{
        
client_print_color(00"^4[SPR] ^3SPR is Already ^4Running!");
        return 
PLUGIN_HANDLED;
    }


public 
client_putinserver(id)
{
    if(
g_bSpr
    {
        
client_print_color(id0,"^3[SPR] ^4Special Round is going on.")
    }
}

public 
HandleSpr(idSprMenuitem

    if( 
item == MENU_EXIT 
    { 
        
menu_destroy(SprMenu); 
        return 
PLUGIN_HANDLED
    }
    new 
players[32], numberPlayer
    get_players
(playersnumber,"a")
    switch(
item)  
    { 
        case 
0
        {  
            
g_bSpr true
            Choose 
0
            BlockBuy
()
            
give_item(Player"weapon_knife")
            
client_print_color(00"^3[SPR] ^4Admin Choose ^3Knife ^4Round!")    
        } 
        case 
1equipWeapon(1"weapon_xm1014"CSW_XM1014240"ShotGun"
        case 
2equipWeapon(2"weapon_deagle"CSW_DEAGLE240,"Deagle"
        case 
3equipWeapon(3"weapon_awp"CSW_AWP240"Awp")  
        case 
4equipWeapon(4"weapon_m4a1"CSW_M4A1240,"M4A1")  
        case 
5equipWeapon(5"weapon_ak47"CSW_AK47240,"AK47")
        case 
6equipWeapon(6"weapon_tmp"CSW_TMP240,"Tmp"
        case 
7equipWeapon(7"weapon_hegrenade"CSW_HEGRENADE240,"Unlimated Grenades")
        case 
8equipWeapon(8"weapon_g3sg1"CSW_G3SG1240,"Gay Gun")
        case 
9equipWeapon(9"weapon_scout"CSW_SCOUT240,"Scout")
    } 
    
client_print_color(id0,"** ^3[SPR] ^4You cannot pickup a Weapon during Special Round!"); 
    
menu_destroy(SprMenu); 
    return 
PLUGIN_HANDLED
}

public 
SendItems(id)
{
    switch(
Choose){
        case 
0: {             
            
fm_strip_user_weapons(id)  
            
give_item(id"weapon_knife")                   
        }  
        case 
1GiveWeapon(id"weapon_xm1014"CSW_XM1014240
        case 
2GiveWeapon(id"weapon_deagle"CSW_DEAGLE240
        case 
3GiveWeapon(id"weapon_awp"CSW_AWP240
        case 
4GiveWeapon(id"weapon_m4a1"CSW_M4A1240)  
        case 
5GiveWeapon(id"weapon_ak47"CSW_AK47240
        case 
6GiveWeapon(id"weapon_tmp"CSW_TMP240
        case 
7GiveWeapon(id"weapon_hegrenade"CSW_HEGRENADE240
        case 
8GiveWeapon(id"weapon_g3sg1"CSW_G3SG1240)
        case 
9GiveWeapon(id"weapon_scout"CSW_SCOUT240)
    }  
}

public 
endSPR()
{
    if(
g_bSpr)
    {
        new 
players[32], numberPlayer
        get_players
(playersnumber,"a")
    
        for(new 
i=0numberi++)
        {   
            
Player players[i]
            if(
Choose == 8)
                
cs_set_user_bpammo(PlayerCSW_HEGRENADE1)
            if(
is_user_alive(Player))
            {
                if(
get_user_team(Player) == 1)
                    
GiveWeapon(Player"weapon_glock18"CSW_GLOCK18120)
                else if(
get_user_team(Player) == 2)
                    
GiveWeapon(Player"weapon_usp"CSW_USP120)    
            }
        }
        
g_bSpr false
        
gBlockBuyZone false;
        
client_print_color(00,"^3[SPR] ^4Special Round is over now!"); 
    }
}

public 
DropBlock(id)
{
    if(
g_bSpr)
    {
        
client_print_color(id0"^3[SPR] ^4You cannot drop a weapon during Special Round!");
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}

public 
WeaponTouch(entid
{  
    if(
g_bSpr)
        return 
PLUGIN_HANDLED;
    return 
PLUGIN_CONTINUE;
}

public 
MessageStatusIcon(msgIDdestreceiver) {
    
    if(
gBlockBuyZone && get_msg_arg_int(1)) {        
        new const 
buyzone[] = "buyzone";
        new 
icon[sizeof(buyzone) + 1];
        
get_msg_arg_string(2iconcharsmax(icon));
        if(
equal(iconbuyzone)) {
            
RemoveFromBuyzone(receiver);
            
set_msg_arg_int(1ARG_BYTE0);            
        }        
    }    
    return 
PLUGIN_CONTINUE;   
}

BlockBuy() {
    
message_begin(MSG_BROADCASTgMsgStatusIcon);
    
write_byte(0);
    
write_string("buyzone");
    
message_end();
    new 
players[32], pnum;
    
get_players(playerspnum"a");

    while(
pnum-- > 0) {
        
RemoveFromBuyzone(players[pnum]);
    }
    
gBlockBuyZone true;   
}
RemoveFromBuyzone(idset_pdata_int(id235get_pdata_int(id23555) & -255)

stock equipWeapon(const choiceweapon[], ammoamt, print[])
{
    
Choose choice
    g_bSpr 
true;
    
BlockBuy()
    new 
players[32], numberPlayer
    get_players
(playersnumber,"a")
    for(new 
i=0numberi++)
    {    
        
Player players[i]
        
fm_strip_user_weapons(Player)  
        
give_item(Playerweapon)
        
give_item(Player"weapon_knife")
        
cs_set_user_bpammo(Playerammoamt)    
    }
    
set_dhudmessage(255255255, -1.0, -0.6525.03.5)
    
show_dhudmessage(0"Admin has Started^n-= [ %s Round ]=-^n Lets have Fun!!", print)
    
client_print_color(00"^3[SPR] ^4Admin Choose ^3%s ^4Round!", print)
}

stock GiveWeapon(id, const weapon[], ammoamt)
{    
    
fm_strip_user_weapons(id)  
    
give_item(idweapon)
    
give_item(id"weapon_knife")
    
cs_set_user_bpammo(idammoamt)    

ssproxima is offline
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 03-06-2021 , 12:01   Re: Knife round not working
Reply With Quote #2

stable version
Download
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
ssproxima
Senior Member
Join Date: Jan 2015
Old 03-06-2021 , 13:08   Re: Knife round not working
Reply With Quote #3

Quote:
Originally Posted by Sanjay Singh View Post
stable version
Download
Thanks
ssproxima is offline
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 06:36.


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