AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block cts from taking weapons from ground. (https://forums.alliedmods.net/showthread.php?t=117635)

benamo6 02-03-2010 06:12

Block cts from taking weapons from ground.
 
I need to block CT's from taking weapons from ground, Ive tried this:
But it have bugs, it block CT's taking weapons that they throw, but they can pick up weapons that map spawns or that other players drop.

PHP Code:

  RegisterHam(Ham_Touch"weaponbox""fw_TouchWeapon"

PHP Code:

public fw_TouchWeapon(weaponid
{
  if (
cs_get_user_team(id) == CS_TEAM_CT
   return 
HAM_SUPERCEDE

    return 
HAM_IGNORED



reinert 02-03-2010 09:08

Re: Block cts from taking weapons from ground.
 
it may be helpful, just add all weapon models there :).

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <cstrike>

public plugin_init()
   
register_forward(FM_Touch"wp_touch");

public 
wp_touch(entid)
{
   if(!
pev_valid(ent) || !pev_valid(id) || !is_user_alive(id))
      return 
FMRES_IGNORED
   
   
static CsTeamsteam team cs_get_user_team(id)
   new 
mdl[32]
   
   
pev(entpev_modelmdl31)
   
   if(
team == CS_TEAM_T)
   {
      if(
equal(mdl"models/w_m4a1.mdl") || equal(mdl"models/w_usp.mdl"))
         return 
FMRES_SUPERCEDE
   
}
   return 
FMRES_IGNORED




All times are GMT -4. The time now is 07:25.

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