Raised This Month: $ Target: $400
 0% 

HNS Awp Block


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zoubiey
Member
Join Date: Jul 2009
Location: Sweden / Piteå
Old 08-02-2009 , 14:59   HNS Awp Block
Reply With Quote #1

Hello, I have some problem with my awp block. It gives me an awp with 3 ammo (as i want) but it gives me 30 bm ammo to and if you step on it again it reload your bp ammo to full. Want to know whats the problem.

EDIT: I also want to know how to change so only CT can have it instead of only T.

Here is the code:
PHP Code:
actionAwp(idbool:OverrideTimer)
{
    switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_T:
        {
             
//get game time
             
new Float:fTime halflife_time();
 
             
//make sure player is alive
             
if (fTime >= gfAwpNextUse[id] || OverrideTimer)
             {
                  
give_item(id"weapon_awp");
                  
cs_set_weapon_ammo(find_ent_by_owner(1"weapon_awp"id), 3);
                  
cs_set_user_bpammo(1CSW_AWP0);
 
                  
//sets the time when the player can use the awp block again
                  
gfAwpNextUse[id] = fTime get_cvar_float("bm_awpcooldown");
  
                  
//setup hud message
                  
set_hudmessage(2552550, -1.00.3506.010.01.01.0);
  
                  
//Show Message
                  
new szPlayerName[32];
                  
get_user_name(idszPlayerName32);
       
                  
show_hudmessage(0"%s got an Awp with 3 bullets!"szPlayerName);
             }
             else
             {
                  
set_hudmessage(gHudRedgHudGreengHudBluegfTextXgfTextYgHudEffectsgfHudFxTimegfHudHoldTimegfHudFadeInTimegfHudFadeOutTimegHudChannel);
                  
show_hudmessage(id"Awp block next use: Next Round");
             }
        }
        case 
CS_TEAM_CT:
        {
              
set_hudmessage(gHudRedgHudGreengHudBluegfTextXgfTextYgHudEffectsgfHudFxTimegfHudHoldTimegfHudFadeInTimegfHudFadeOutTimegHudChannel);
              
show_hudmessage(id"You're a CT, you cant get an AWP!");
        }
        case 
CS_TEAM_SPECTATOR:
        {
              
set_hudmessage(gHudRedgHudGreengHudBluegfTextXgfTextYgHudEffectsgfHudFxTimegfHudHoldTimegfHudFadeInTimegfHudFadeOutTimegHudChannel);
              
show_hudmessage(id"You're a Spectator, you cant get an AWP!");
        }
    }

I hope any1 could help me
zoubiey is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 08-02-2009 , 15:32   Re: HNS Awp Block
Reply With Quote #2

There is SO many threads about this SEARCH
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 08-02-2009 , 15:39   Re: HNS Awp Block
Reply With Quote #3

PHP Code:
new bool:gHasAWP33 ];

// ...

actionAwpid )
{
    if ( !
gHasAWPid ] )
    {
        
give_itemid"weapon_awp" );
        
        
gHasAWPid ] = true;
        
// Simple way to do it, just reset the bool at round start/end. Also, if you want to give the awp to Ts only, just add a get_user_team( id ) == 1 check.
    
}

__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
zoubiey
Member
Join Date: Jul 2009
Location: Sweden / Piteå
Old 08-02-2009 , 15:41   Re: HNS Awp Block
Reply With Quote #4

I've been searching for 5 days now -.- I only found this:

give_item(id, "weapon_awp");
cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_awp", id), 3);
cs_set_user_bpammo(1, CSW_AWP, 0);


But it wont work, only 3 ammo works and not the bp ammo. Link me to the right post if you know where it is because I cant find it..
zoubiey is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-02-2009 , 17:41   Re: HNS Awp Block
Reply With Quote #5

cs_set_user_bpammo( id, CSW_AWP, 0 );
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 08-02-2009 , 19:30   Re: HNS Awp Block
Reply With Quote #6

Quote:
Originally Posted by TitANious View Post
There is SO many threads about this SEARCH
Word..
Jon 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 18:27.


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