[Half-Life AMXX] / include / cstrike2.inc Repository:
ViewVC logotype

View of /include/cstrike2.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25 - (download) (annotate)
Tue Nov 20 22:36:56 2007 UTC (16 years, 4 months ago) by ian
File size: 2962 byte(s)
Applied AGPLv3 license.
/*
cstrike2 v0.1.2
Copyright (C) 2006-2007 Ian (Juan) Cammarata

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------
http://ian.cammarata.us
*/

#if defined _cstrike2_included
  #endinput
#endif
#define _cstrike2_included

//Set whether play has shield
stock cs_set_user_shield(id,onoff=1){
	if(onoff)set_offset_int(id,510,(1<<24))
	else set_offset_int(id,510,0)
	return 1
}

//	Set Score Attribute
//	0 nothing
//	1 dead
//	2 bomb
//	4 vip
stock cs_set_user_scoreattrib(id,attrib=0){
	message_begin(2,get_user_msgid("ScoreAttrib"),{0,0,0},0)
	write_byte(id)
	write_byte(attrib)
	message_end()
}

//	Radio and chat strings can have control characters embedded to set colors. For the control characters to be used, one must be at the start of the string.
//	The control characters can be copied and pasted in notepad.
//	0x02 (STX) - Use team color up to the end of the player name. This only works at the start of the string, and precludes using the other control characters.
//	0x03 (ETX) - Use team color from this point forward
//	0x04 (EOT) - Use location color from this point forward
//	0x01 (SOH) - Use normal color from this point forward
//	Sample string "^x03Team colored text ^x01Normal color"
public saytext(sndr,rcvr,txt[]){
	message_begin(1,get_user_msgid("SayText"),{0,0,0},rcvr)
	write_byte(sndr)
	write_string(txt)
	message_end()
	return PLUGIN_CONTINUE
}
public saytextall(sndr,txt[]){
	message_begin(2,get_user_msgid("SayText"),{0,0,0},0)
	write_byte(sndr)
	write_string(txt)
	message_end()
	return PLUGIN_CONTINUE
}
//Be sure to pass this function the text without any color codes in it.
stock saytextlog(sndr,txt[],saytype[]="say"){
	if(sndr>0){
		new name[32],steam[20],team[10]
		get_user_name(sndr,name,31)
		get_user_authid(sndr,steam,19)
		get_user_team(sndr,team,9)
		log_message("^"%s<%d><%s><%s>^" %s ^"%s^"%s",name,get_user_userid(sndr),steam,team,saytype,txt,is_user_alive(sndr)?"":" (dead)")
	}
	else log_message("Server say ^"%s^"",txt)
	return PLUGIN_CONTINUE
}
stock weaponstrip(id,noknife=0){
	new ent=create_entity("player_weaponstrip")
	DispatchSpawn(ent)
	entity_use(ent,id)
	if(!noknife)give_item(id,"weapon_knife")
	remove_entity(ent)
	set_offset_int(id,116,0)
	return 1
}

Contact
ViewVC Help
Powered by ViewVC 1.0.4