AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hook bought weapon (https://forums.alliedmods.net/showthread.php?t=251527)

IAmReallyCool 11-14-2014 16:35

Hook bought weapon
 
Hi. How can I hook the moment when e.g. weapon_m4a1 is bought from the shop?

meTaLiCroSS 11-14-2014 20:45

Re: Hook bought weapon
 
Quote:

Originally Posted by IAmReallyCool (Post 2224242)
Hi. How can I hook the moment when e.g. weapon_m4a1 is bought from the shop?

Check cstrike.inc on the latest dev build of amxx. They included forwards for catching the same events you're asking for :)

HamletEagle 11-15-2014 04:26

Re: Hook bought weapon
 
Or use cs_buy forward from ConnorMcLeod if you don't want to use 1.8.3

IAmReallyCool 11-15-2014 05:14

Re: Hook bought weapon
 
Thanks, I will check it. Won't Weappickup do in my case?

HamletEagle 11-15-2014 06:01

Re: Hook bought weapon
 
WeapPickup event is called only an entity pickup a weapon( like from the ground ). If you want to detect the moment when a weapon is added to player hook Ham_AddPlayerItem( pickup, buy, given by other plugins etc ). If you need to catch the moment when he buy it from the shop use cs_buy forward.

IAmReallyCool 11-15-2014 07:18

Re: Hook bought weapon
 
Thanks a lot Ham_AddPlayerItem will perfectly do!


All times are GMT -4. The time now is 17:46.

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