Parent Directory | Revision Log
Revision 25 - (view) (download)
1 : | ian | 1 | /* |
2 : | cstrike2 v0.1.2 | ||
3 : | Copyright (C) 2006-2007 Ian (Juan) Cammarata | ||
4 : | |||
5 : | ian | 25 | This program is free software: you can redistribute it and/or modify |
6 : | it under the terms of the GNU Affero General Public License as | ||
7 : | published by the Free Software Foundation, either version 3 of the | ||
8 : | License, or (at your option) any later version. | ||
9 : | ian | 1 | |
10 : | ian | 25 | This program is distributed in the hope that it will be useful, |
11 : | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 : | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 : | GNU Affero General Public License for more details. | ||
14 : | ian | 1 | |
15 : | ian | 25 | You should have received a copy of the GNU Affero General Public License |
16 : | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 : | -------------------------------------------------------------------------------- | ||
18 : | http://ian.cammarata.us | ||
19 : | ian | 1 | */ |
20 : | |||
21 : | #if defined _cstrike2_included | ||
22 : | #endinput | ||
23 : | #endif | ||
24 : | #define _cstrike2_included | ||
25 : | |||
26 : | //Set whether play has shield | ||
27 : | stock cs_set_user_shield(id,onoff=1){ | ||
28 : | if(onoff)set_offset_int(id,510,(1<<24)) | ||
29 : | else set_offset_int(id,510,0) | ||
30 : | return 1 | ||
31 : | } | ||
32 : | |||
33 : | // Set Score Attribute | ||
34 : | // 0 nothing | ||
35 : | // 1 dead | ||
36 : | // 2 bomb | ||
37 : | // 4 vip | ||
38 : | stock cs_set_user_scoreattrib(id,attrib=0){ | ||
39 : | message_begin(2,get_user_msgid("ScoreAttrib"),{0,0,0},0) | ||
40 : | write_byte(id) | ||
41 : | write_byte(attrib) | ||
42 : | message_end() | ||
43 : | } | ||
44 : | |||
45 : | // 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. | ||
46 : | // The control characters can be copied and pasted in notepad. | ||
47 : | // 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. | ||
48 : | // 0x03 (ETX) - Use team color from this point forward | ||
49 : | // 0x04 (EOT) - Use location color from this point forward | ||
50 : | // 0x01 (SOH) - Use normal color from this point forward | ||
51 : | // Sample string "^x03Team colored text ^x01Normal color" | ||
52 : | public saytext(sndr,rcvr,txt[]){ | ||
53 : | message_begin(1,get_user_msgid("SayText"),{0,0,0},rcvr) | ||
54 : | write_byte(sndr) | ||
55 : | write_string(txt) | ||
56 : | message_end() | ||
57 : | return PLUGIN_CONTINUE | ||
58 : | } | ||
59 : | public saytextall(sndr,txt[]){ | ||
60 : | message_begin(2,get_user_msgid("SayText"),{0,0,0},0) | ||
61 : | write_byte(sndr) | ||
62 : | write_string(txt) | ||
63 : | message_end() | ||
64 : | return PLUGIN_CONTINUE | ||
65 : | } | ||
66 : | //Be sure to pass this function the text without any color codes in it. | ||
67 : | stock saytextlog(sndr,txt[],saytype[]="say"){ | ||
68 : | if(sndr>0){ | ||
69 : | new name[32],steam[20],team[10] | ||
70 : | get_user_name(sndr,name,31) | ||
71 : | get_user_authid(sndr,steam,19) | ||
72 : | get_user_team(sndr,team,9) | ||
73 : | log_message("^"%s<%d><%s><%s>^" %s ^"%s^"%s",name,get_user_userid(sndr),steam,team,saytype,txt,is_user_alive(sndr)?"":" (dead)") | ||
74 : | } | ||
75 : | else log_message("Server say ^"%s^"",txt) | ||
76 : | return PLUGIN_CONTINUE | ||
77 : | } | ||
78 : | stock weaponstrip(id,noknife=0){ | ||
79 : | new ent=create_entity("player_weaponstrip") | ||
80 : | DispatchSpawn(ent) | ||
81 : | entity_use(ent,id) | ||
82 : | if(!noknife)give_item(id,"weapon_knife") | ||
83 : | remove_entity(ent) | ||
84 : | set_offset_int(id,116,0) | ||
85 : | return 1 | ||
86 : | } |
Contact | ViewVC Help |
Powered by ViewVC 1.0.4 |