Raised This Month: $ Target: $400
 0% 

Force a player to pull out his/her primary


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 12-25-2007 , 13:35   Force a player to pull out his/her primary
Reply With Quote #1

how do you force a player to pull out his/ her primary weapon when after an event?
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 12-25-2007 , 14:49   Re: Force a player to pull out his/her primary
Reply With Quote #2

I think i'll do something like this
Code:
#include <amxmodx>
 
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Unknown"
 
#define PRIMARY_WEAPONS ((1<<CSW_SCOUT) | (1<<CSW_XM1014) | (1<<CSW_MAC10) | (1<<CSW_AUG) | (1<<CSW_UMP45) | (1<<CSW_SG550) | (1<<CSW_GALIL) | (1<<CSW_FAMAS) | (1<<CSW_AWP) | (1<<CSW_MP5NAVY) | (1<<CSW_M249) | (1<<CSW_M3) | (1<<CSW_M4A1) | (1<<CSW_TMP) | (1<<CSW_G3SG1) | (1<<CSW_SG552) | (1<<CSW_AK47) | (1<<CSW_P90))
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
 
 //register_event().
}
 
public event()
{
 static Players[32], Num;
 static Player;
 get_players(Players, Num, "ach");
 
 for(new i = 0 ; i < Num ; i++)
 {
  Player = Players[i];
 
  static Weapons[32], WpnNum;
  get_user_weapons(Player, Weapons, WpnNum);
 
  for(new j = 0 ; j < WpnNum ; j++)
  {
   if(PRIMARY_WEAPONS & ( 1 << Weapons[j]))
   {
    static WpnName[32];
    get_weaponname(Weapons[j], WpnName, sizeof WpnName - 1);
 
    engclient_cmd(Player, WpnName);
   }
  }
 }
}
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 12-26-2007 at 05:18.
Alka is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 12-25-2007 , 16:05   Re: Force a player to pull out his/her primary
Reply With Quote #3

I would just do

Code:
engclient_cmd(client, "slot2");

IIRC slot2 was the primary weapon.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-25-2007 , 16:09   Re: Force a player to pull out his/her primary
Reply With Quote #4

Quote:
Originally Posted by teame06 View Post
I would just do

Code:
engclient_cmd(client, "slot2");

IIRC slot2 was the primary weapon.
It's slot1 but player will select weapon only if his cvar hud_fastwitch is 1.

@alka
Command "use weapon_XXX" is for source.

Code:
if(PRIMARY_WEAPONS & ( 1 << Weapons[j])) {   static WpnName[32];   get_weaponname(Weapons[j], WpnName, sizeof WpnName - 1);     engclient_cmd(Player, WpnName);   return }
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 12-26-2007 , 05:17   Re: Force a player to pull out his/her primary
Reply With Quote #5

Eh, just a little thingy...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 12-29-2007 , 01:26   Re: Force a player to pull out his/her primary
Reply With Quote #6

i cant seem to get any of these working
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
Reply


Thread Tools
Display Modes

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 11:00.


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