1 |
/* |
/* |
2 |
Grab+ v1.2 |
Grab+ v1.2.1 |
3 |
Copyright (C) 2007 Ian (Juan) Cammarata |
Copyright (C) 2007 Ian (Juan) Cammarata |
4 |
|
|
5 |
This program is free software; you can redistribute it and/or modify it under |
This program is free software; you can redistribute it and/or modify it under |
16 |
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
17 |
|
|
18 |
http://ian.cammarata.us/projects/grab_plus |
http://ian.cammarata.us/projects/grab_plus |
19 |
Nov 06 11:21 |
Nov 12 14:35 |
20 |
|
|
21 |
|
|
22 |
Description: |
Description: |
101 |
Change Log: |
Change Log: |
102 |
Key (+ added | - removed | c changed | f fixed) |
Key (+ added | - removed | c changed | f fixed) |
103 |
|
|
104 |
|
v1.2.1 (Nov 12, 2007) |
105 |
|
f: Elimited two run time warnings in the player prethink function. |
106 |
|
|
107 |
v1.2 (Nov 06, 2007) |
v1.2 (Nov 06, 2007) |
108 |
+: Cvars gp_screen_fade and gp_glow to enable/disable these features. |
+: Cvars gp_screen_fade and gp_glow to enable/disable these features. |
109 |
+: Cvar gp_glow_a controls to control alpha of screenfade and glow. |
+: Cvar gp_glow_a controls to control alpha of screenfade and glow. |
125 |
#include <amxmisc> |
#include <amxmisc> |
126 |
#include <fakemeta> |
#include <fakemeta> |
127 |
|
|
128 |
#define VERSION "1.2" |
#define VERSION "1.2.1" |
129 |
#define ADMIN ADMIN_LEVEL_A |
#define ADMIN ADMIN_LEVEL_A |
130 |
|
|
131 |
#define TSK_CHKE 50 |
#define TSK_CHKE 50 |
204 |
|
|
205 |
SVC_SCREENFADE = get_user_msgid( "ScreenFade" ) |
SVC_SCREENFADE = get_user_msgid( "ScreenFade" ) |
206 |
SVC_SCREENSHAKE = get_user_msgid( "ScreenShake" ) |
SVC_SCREENSHAKE = get_user_msgid( "ScreenShake" ) |
|
|
|
|
return PLUGIN_CONTINUE |
|
207 |
} |
} |
208 |
|
|
209 |
public plugin_precache( ) |
public plugin_precache( ) |
210 |
{ |
{ |
211 |
precache_sound( "player/PL_PAIN2.WAV" ) |
precache_sound( "player/PL_PAIN2.WAV" ) |
|
return PLUGIN_CONTINUE |
|
212 |
} |
} |
213 |
|
|
214 |
public fm_player_prethink( id ) |
public fm_player_prethink( id ) |
225 |
|
|
226 |
if( 0 < target <= MAXPLAYERS ) |
if( 0 < target <= MAXPLAYERS ) |
227 |
{ |
{ |
228 |
if( is_grabbed( target, id ) ) return PLUGIN_CONTINUE |
if( is_grabbed( target, id ) ) return FMRES_IGNORED |
229 |
set_grabbed( id, target ) |
set_grabbed( id, target ) |
230 |
} |
} |
231 |
else if( !get_pcvar_num( p_players_only ) ) |
else if( !get_pcvar_num( p_players_only ) ) |
232 |
{ |
{ |
233 |
new movetype |
new movetype |
234 |
if( target ) |
if( target && pev_valid( target ) ) |
235 |
{ |
{ |
236 |
movetype = pev( target, pev_movetype ) |
movetype = pev( target, pev_movetype ) |
237 |
if( !( movetype == MOVETYPE_WALK || movetype == MOVETYPE_STEP || movetype == MOVETYPE_TOSS ) ) |
if( !( movetype == MOVETYPE_WALK || movetype == MOVETYPE_STEP || movetype == MOVETYPE_TOSS ) ) |
238 |
return PLUGIN_CONTINUE |
return FMRES_IGNORED |
239 |
} |
} |
240 |
else |
else |
241 |
{ |
{ |
242 |
|
target = 0 |
243 |
new ent = engfunc( EngFunc_FindEntityInSphere, -1, ret, 12.0 ) |
new ent = engfunc( EngFunc_FindEntityInSphere, -1, ret, 12.0 ) |
244 |
while( !target && ent > 0 ) |
while( !target && ent > 0 ) |
245 |
{ |
{ |
252 |
} |
} |
253 |
if( target ) |
if( target ) |
254 |
{ |
{ |
255 |
if( is_grabbed( target, id ) ) return PLUGIN_CONTINUE |
if( is_grabbed( target, id ) ) return FMRES_IGNORED |
256 |
set_grabbed( id, target ) |
set_grabbed( id, target ) |
257 |
} |
} |
258 |
} |
} |
264 |
if( !pev_valid( target ) || ( pev( target, pev_health ) < 1 && pev( target, pev_max_health ) ) ) |
if( !pev_valid( target ) || ( pev( target, pev_health ) < 1 && pev( target, pev_max_health ) ) ) |
265 |
{ |
{ |
266 |
unset_grabbed( id ) |
unset_grabbed( id ) |
267 |
return PLUGIN_CONTINUE |
return FMRES_IGNORED |
268 |
} |
} |
269 |
|
|
270 |
//Use key choke |
//Use key choke |
281 |
} |
} |
282 |
if( client_data[id][GRABBER] > 0 ) grab_think( client_data[id][GRABBER] ) |
if( client_data[id][GRABBER] > 0 ) grab_think( client_data[id][GRABBER] ) |
283 |
|
|
284 |
return PLUGIN_CONTINUE |
return FMRES_IGNORED |
285 |
} |
} |
286 |
|
|
287 |
public grab_think ( id ) |
public grab_think ( id ) |