AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect Shooting (https://forums.alliedmods.net/showthread.php?t=216559)

ironskillz1 05-22-2013 14:57

Detect Shooting
 
I want to Detect when you shoot with a deagle

This codes the detect when you press the shoot button

Tex: If you dont got any bullets and shoot it will print in the chat

I want it only to print in the chat when you shoot with a bullet

Code:

RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_deagle", "Ham_Attack" )
 
public Ham_Attack(entity)
{
 new id = pev(entity, pev_owner)
 
 if(is_user_alive(id))
 {
  ColorChat(0, GREY, "BanG!")
  }
 }
 return HAM_IGNORED
}


Bos93 05-22-2013 15:18

Re: Detect Shooting
 
pev(entity, pev_owner) -> get_pdata_cbase(pEntity, 41, 4); - It is correct


check - if( !cs_get_weapon_ammo( pEntity) ) return;


All times are GMT -4. The time now is 16:28.

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