AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HNS Awp Block (https://forums.alliedmods.net/showthread.php?t=99198)

zoubiey 08-02-2009 14:59

HNS Awp Block
 
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 :)

TitANious 08-02-2009 15:32

Re: HNS Awp Block
 
There is SO many threads about this SEARCH

Xellath 08-02-2009 15:39

Re: HNS Awp Block
 
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.
    
}



zoubiey 08-02-2009 15:41

Re: HNS Awp Block
 
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..

Exolent[jNr] 08-02-2009 17:41

Re: HNS Awp Block
 
cs_set_user_bpammo( id, CSW_AWP, 0 );

Jon 08-02-2009 19:30

Re: HNS Awp Block
 
Quote:

Originally Posted by TitANious (Post 888615)
There is SO many threads about this SEARCH

Word..


All times are GMT -4. The time now is 18:27.

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