Raised This Month: $ Target: $400
 0% 

only the primarz weapon ??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 11-11-2005 , 15:12   only the primarz weapon ??
Reply With Quote #1

is there a way to force the players to use just the primary weapon ???
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 11-11-2005 , 16:48  
Reply With Quote #2

This should let the player use only primary weapons and the knife:
Code:
#include <amxmodx> public plugin_init() {   register_event("CurWeapon", "Check_Weapon", "be"); } #define MAX_PRIMARY 19 new bool:g_bPrimary[33]; new g_szPrimary[MAX_PRIMARY][] = {   "weapon_m4a1","weapon_galil",   "weapon_ak47","weapon_scout",   "weapon_sg552","weapon_awp",   "weapon_g3sg1","weapon_famas",   "weapon_aug","weapon_sg550",   "weapon_m3","weapon_xm1014",   "weapon_mac10","weapon_mp5navy",   "weapon_ump45","weapon_tmp",   "weapon_p90","weapon_m249",   "weapon_knife" } public Check_Weapon( id ) {   new clip, ammo, weapon = get_user_weapon(id,clip,ammo);   new szWeapName[33];   get_weaponname(weapon, szWeapName, 32);   g_bPrimary[id] = false;   for(new i = 0; i < MAX_PRIMARY; i++)   {     if(equali(szWeapName, g_szPrimary[i]))       g_bPrimary[id] = true;   }   if(!g_bPrimary[id])   {     for(new i = 0; i < MAX_PRIMARY; i++)     {       if(equali(szWeapName, g_szPrimary[i]))         client_cmd(id, "%s", g_szPrimary[i]);       else         client_cmd(id, "weapon_knife");     }   } }
Untested

If there's a better way, lemme know.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 11-12-2005 , 05:58  
Reply With Quote #3

ok thx
i will test it
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 11-12-2005 , 06:03  
Reply With Quote #4

you can just use the knife no other weapons
it should be possible that you can use the grenades too
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 11-13-2005 , 07:45  
Reply With Quote #5

vex plz help
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-13-2005 , 12:56  
Reply With Quote #6

Change this:

Code:
 new szWeapName[33];  get_weaponname(id, szWeapName, 32);

Into this:

Code:
 new clip, ammo, weapon = get_user_weapon(id,clip,ammo);  new szWeapName[33];  get_weaponname(weapon, szWeapName, 32);

get_weaponname takes a weapon index
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 11-13-2005 , 14:35  
Reply With Quote #7

Oh, doh..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 11-13-2005 , 16:23  
Reply With Quote #8

thx guys
it works great
+ karma 4 u
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
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 23:36.


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