Raised This Month: $ Target: $400
 0% 

2Bombs? :S


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asd13
Member
Join Date: Apr 2009
Old 07-28-2010 , 13:14   2Bombs? :S
Reply With Quote #1

Why it gives sometimes 2 bombs? :S
PHP Code:
new bool:HasC4[33];

public 
plugin_init( ) {
    
RegisterHamHam_Spawn ,    "player" ,    "PlayerSpawned" );
}

public 
PlayerSpawnedid ) {
    if( 
is_user_aliveid ) && ( get_user_flagsid ) & VipFlags ) ) {
        if( 
get_pcvar_numiEnable ) ) {
            
give_itemid "weapon_hegrenade" );
            
give_itemid "weapon_flashbang" );
            
give_itemid "weapon_smokegrenade" );
            
cs_set_user_bpammoid CSW_FLASHBANG );
            
cs_set_user_armorid 100CS_ARMOR_VESTHELM );
            
            if( 
cs_get_user_teamid ) == CS_TEAM_CT )
                
cs_set_user_defuseid );
            
            
ShowMenuid );
        }
    }
}

public 
ShowMenuid ) {
    new 
menu menu_create"Vali Relv:" "MenuHandler" );
    
    if( 
iRound == ) {
        
menu_additemmenu "USP" ,    "1" );
        
menu_additemmenu "GLOCK" ,    "2" );
        
menu_additemmenu "DEAGLE" ,    "3" );
    }
    
    if( 
iRound ) {
        
menu_additemmenu "M4A1/Deagle" "4" );
        
menu_additemmenu "AK47/Deagle" "5" );
    }
    
    if( 
iRound ) {
        
menu_additemmenu "AWP/Deagle" "6" );
    }
    
    
menu_setpropmenu MPROP_EXIT MEXIT_ALL );
    
menu_displayid menu );
}

public 
MenuHandlerid menuitem ) {
    if( 
item == MENU_EXIT ) {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ];
    new 
accesscallback;
    
    
menu_item_getinfomenu item access data iName 63 callback );
    new 
key str_to_numdata );
    switch( 
key ) {
        case 
1: {
            if( 
user_has_weaponid CSW_C4 ) && cs_get_user_teamid ) == CS_TEAM_T )
                
HasC4[id] = true;
            else
                
HasC4[id] = false;
            
            
strip_user_weaponsid );
            
give_itemid "weapon_usp" );
            
give_itemid "weapon_knife" );
            
give_itemid "weapon_hegrenade" );
            
give_itemid "weapon_flashbang" );
            
give_itemid "weapon_smokegrenade" )
            
cs_set_user_bpammoid CSW_USP 100 );
            
cs_set_user_bpammoid CSW_FLASHBANG );
            
cs_set_user_armorid 100CS_ARMOR_VESTHELM );
            
            if( 
cs_get_user_teamid ) == CS_TEAM_CT )
                
cs_set_user_defuseid );
            
            if( 
HasC4[id] ) {
                
give_itemid "weapon_c4" );
            }
            
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
        case 
2: {
            if( 
user_has_weaponid CSW_C4 ) && cs_get_user_teamid ) == CS_TEAM_T )
                
HasC4[id] = true;
            else
                
HasC4[id] = false;
            
            
strip_user_weaponsid );
            
give_itemid "weapon_glock18" );
            
give_itemid "weapon_knife" );
            
give_itemid "weapon_hegrenade" );
            
give_itemid "weapon_flashbang" );
            
give_itemid "weapon_smokegrenade" )
            
cs_set_user_bpammoid CSW_GLOCK18 120 );
            
cs_set_user_bpammoid CSW_FLASHBANG );
            
cs_set_user_armorid 100CS_ARMOR_VESTHELM );
            
            if( 
cs_get_user_teamid ) == CS_TEAM_CT )
                
cs_set_user_defuseid );
            
            if( 
HasC4[id] ) {
                
give_itemid "weapon_c4" );
            }
            
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
        case 
3: {
            if( 
user_has_weaponid CSW_C4 ) && cs_get_user_teamid ) == CS_TEAM_T )
                
HasC4[id] = true;
            else
                
HasC4[id] = false;
            
            
strip_user_weaponsid );
            
give_itemid "weapon_deagle" );
            
give_itemid "weapon_knife" );
            
give_itemid "weapon_hegrenade" );
            
give_itemid "weapon_flashbang" );
            
give_itemid "weapon_smokegrenade" )
            
cs_set_user_bpammoid CSW_DEAGLE 35 );
            
cs_set_user_bpammoid CSW_FLASHBANG );
            
cs_set_user_armorid 100CS_ARMOR_VESTHELM );
            
            if( 
cs_get_user_teamid ) == CS_TEAM_CT )
                
cs_set_user_defuseid );
            
            if( 
HasC4[id] ) {
                
give_itemid "weapon_c4" );
            }
            
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
        case 
4: {
            if( 
user_has_weaponid CSW_C4 ) && cs_get_user_teamid ) == CS_TEAM_T )
                
HasC4[id] = true;
            else
                
HasC4[id] = false;
            
            
strip_user_weaponsid );
            
give_itemid "weapon_m4a1" );
            
give_itemid "weapon_knife" );
            
give_itemid "weapon_deagle" );
            
give_itemid "weapon_hegrenade" );
            
give_itemid "weapon_flashbang" );
            
give_itemid "weapon_smokegrenade" )
            
cs_set_user_bpammoid CSW_M4A1 90 );
            
cs_set_user_bpammoid CSW_DEAGLE 35 );
            
cs_set_user_bpammoid CSW_FLASHBANG );
            
cs_set_user_armorid 100CS_ARMOR_VESTHELM );
            
            if( 
cs_get_user_teamid ) == CS_TEAM_CT )
                
cs_set_user_defuseid );
            
            if( 
HasC4[id] ) {
                
give_itemid "weapon_c4" );
            }
            
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
        case 
5: {
            if( 
user_has_weaponid CSW_C4 ) && cs_get_user_teamid ) == CS_TEAM_T )
                
HasC4[id] = true;
            else
                
HasC4[id] = false;
            
            
strip_user_weaponsid );
            
give_itemid "weapon_ak47" );
            
give_itemid "weapon_knife" );
            
give_itemid "weapon_deagle" );
            
give_itemid "weapon_hegrenade" );
            
give_itemid "weapon_flashbang" );
            
give_itemid "weapon_smokegrenade" )
            
cs_set_user_bpammoid CSW_AK47 90 );
            
cs_set_user_bpammoid CSW_DEAGLE 35 );
            
cs_set_user_bpammoid CSW_FLASHBANG );
            
cs_set_user_armorid 100CS_ARMOR_VESTHELM );
            
            if( 
cs_get_user_teamid ) == CS_TEAM_CT )
                
cs_set_user_defuseid );
            
            if( 
HasC4[id] ) {
                
give_itemid "weapon_c4" );
            }
            
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
        case 
6: {
            if( 
user_has_weaponid CSW_C4 ) && cs_get_user_teamid ) == CS_TEAM_T )
                
HasC4[id] = true;
            else
                
HasC4[id] = false;
            
            
strip_user_weaponsid );
            
give_itemid "weapon_awp" );
            
give_itemid "weapon_knife" );
            
give_itemid "weapon_deagle" );
            
give_itemid "weapon_hegrenade" );
            
give_itemid "weapon_flashbang" );
            
give_itemid "weapon_smokegrenade" )
            
cs_set_user_bpammoid CSW_AWP 30 );
            
cs_set_user_bpammoid CSW_DEAGLE 35 );
            
cs_set_user_bpammoid CSW_FLASHBANG );
            
cs_set_user_armorid 100CS_ARMOR_VESTHELM );
            
            if( 
cs_get_user_teamid ) == CS_TEAM_CT )
                
cs_set_user_defuseid );
            
            if( 
HasC4[id] ) {
                
give_itemid "weapon_c4" );
            }
            
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
    }
    
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;

asd13 is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 07-28-2010 , 13:16   Re: 2Bombs? :S
Reply With Quote #2

cs_set_user_bpammo( id , CSW_FLASHBANG , "2" )
Vechta is offline
FlyingHorse
Senior Member
Join Date: Apr 2010
Location: Under your bed.
Old 07-28-2010 , 13:18   Re: 2Bombs? :S
Reply With Quote #3

Quote:
Originally Posted by Vechta View Post
cs_set_user_bpammo( id , CSW_FLASHBANG , "2" )
U even know what ur doing? Wtf does the amount of flashbangs have to do with the bomb?
FlyingHorse is offline
Send a message via Skype™ to FlyingHorse
Vechta
Veteran Member
Join Date: Jun 2010
Old 07-28-2010 , 13:23   Re: 2Bombs? :S
Reply With Quote #4

Quote:
Originally Posted by FlyingHorse View Post
U even know what ur doing? Wtf does the amount of flashbangs have to do with the bomb?
i think the number the amount of bomb ..

Last edited by Vechta; 07-28-2010 at 13:36.
Vechta is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-28-2010 , 13:27   Re: 2Bombs? :S
Reply With Quote #5

The the what ?

That's the number of flashbangs, not bombs (C4).

Also for the record, 2 should be an integer, just 2 not "2" (string).
__________________
Hunter-Digital is offline
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 07-28-2010 , 13:33   Re: 2Bombs? :S
Reply With Quote #6

what about that?
Code:
public bomb_planted(id)
{

cs_set_user_bpammo(id, CSW_C4, 0)
	
}
After planting one of the bombs, the other will be ereased.
Gadzislaw007 is offline
asd13
Member
Join Date: Apr 2009
Old 07-28-2010 , 13:34   Re: 2Bombs? :S
Reply With Quote #7

Meanwhile people run around and there are 2 bombs? I think best is to fix that when users respawn it only gives one bomb not two..
asd13 is offline
katna
Senior Member
Join Date: May 2010
Old 07-28-2010 , 16:25   Re: 2Bombs? :S
Reply With Quote #8

PHP Code:
if( HasC4[id] ) {
                
give_itemid "weapon_c4" );
 } 
if a user have a bomb , don't give im another one
PHP Code:
if( !HasC4[id] ) {
                
give_itemid "weapon_c4" );
 } 
katna is offline
asd13
Member
Join Date: Apr 2009
Old 07-28-2010 , 16:52   Re: 2Bombs? :S
Reply With Quote #9

Now everyone, ct or t no matther got bomb with VipFlags ...

Last edited by asd13; 07-28-2010 at 16:56.
asd13 is offline
DaxProxy
Senior Member
Join Date: Sep 2007
Old 07-28-2010 , 17:11   Re: 2Bombs? :S
Reply With Quote #10

Quote:
Originally Posted by asd13 View Post
Now everyone, ct or t no matther got bomb with VipFlags ...
PHP Code:
if( HasC4[id] ) {
                
give_itemid "weapon_c4" );
            } 
-->

PHP Code:
if(!HasC4[id] && cs_user_team(id) == CSW_TERRORIST) {
                
give_itemid "weapon_c4" );
            } 
Kui see ei aita...siis lihtsalt tee kontroll:
PHP Code:

(Im not sure if cs_user_team is correct function name)

Prethink:
if(
cs_user_team(id) != CSW_TERRORIST){
client_cmd(c4drop)
}
Vmsellist 
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739

Last edited by DaxProxy; 07-28-2010 at 17:14.
DaxProxy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:13.


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