This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Only knives for CT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RuleBreaker
Senior Member
Join Date: May 2011
Old 07-29-2011 , 11:43   Only knives for CT
Reply With Quote #1

How to make that CT can use only knives? I tried this:
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Stefan"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
	register_event("ResetHUD", "newRound", "b")  

	// Add your code here...
}
public fwHamPlayerSpawnPost(id) {
	if(cs_get_user_team(id) == CS_TEAM_CT) {
		new clip, ammo;
		new userweapon = get_user_weapon(id, clip, ammo);
		if(userweapon == CSW_KNIFE) {
		}
		else {
			new origin[3];
			get_user_origin ( id, origin );
			origin[2] -= 500;
			set_user_origin ( id, origin );
			new iwpn, iwpns[32], nwpn[32];
			get_user_weapons ( id, iwpns, iwpn );
			for ( new a = 0; a < iwpn; ++a ) {
				get_weaponname ( iwpns[a], nwpn, 31 );
				engclient_cmd ( id, "drop", nwpn );
			}
			new origin2[3];
			get_user_origin ( id, origin2 );
			origin2[2] += 500;
			set_user_origin ( id, origin2 );
			client_cmd ( id, "weapon_knife" )
		}
	}
}
public newRound(id) {
	if(cs_get_user_team(id) == CS_TEAM_CT) {
		new clip, ammo;
		new userweapon = get_user_weapon(id, clip, ammo);
		if(userweapon == CSW_KNIFE) {
		}
		else {
			new origin[3];
			get_user_origin ( id, origin );
			origin[2] -= 500;
			set_user_origin ( id, origin );
			new iwpn, iwpns[32], nwpn[32];
			get_user_weapons ( id, iwpns, iwpn );
			for ( new a = 0; a < iwpn; ++a ) {
				get_weaponname ( iwpns[a], nwpn, 31 );
				engclient_cmd ( id, "drop", nwpn );
			}
			new origin2[3];
			get_user_origin ( id, origin2 );
			origin2[2] += 500;
			set_user_origin ( id, origin2 );
			client_cmd ( id, "weapon_knife" )
		}
	}
}
but CT can still pick up weapons :\
RuleBreaker is offline
Reply



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 14:36.


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