269 |
#include <cstrike> |
#include <cstrike> |
270 |
#include <cstrike2> |
#include <cstrike2> |
271 |
|
|
272 |
new const VERSION[ ] = "a3.7.5 Jan 20 23:00 MST" |
new const VERSION[ ] = "a3.7.6 Feb 18 05:11 MST" |
273 |
new const TRKCVAR[ ] = "climb_version" |
new const TRKCVAR[ ] = "climb_version" |
274 |
|
|
275 |
new const DONOTHING[ ] = "donothing" |
new const DONOTHING[ ] = "donothing" |
300 |
#define ORIGINS_SIZE 48 |
#define ORIGINS_SIZE 48 |
301 |
new Float:origins[33][ORIGINS_SIZE] |
new Float:origins[33][ORIGINS_SIZE] |
302 |
#define ORIG_UNGC 40 |
#define ORIG_UNGC 40 |
303 |
#define ORIG_PAUS 44 |
#define ORIG_PAUSX 44 |
304 |
//#define ORIG_X 0 |
#define ORIG_PAUSY 45 |
305 |
//#define ORIG_Y 1 |
#define ORIG_PAUSZ 46 |
306 |
//#define ORIG_Z 2 |
#define ORIG_PAUSG 47 |
307 |
#define ORIG_GRAV 3 |
#define ORIG_GRAV 3 |
308 |
|
|
309 |
new time_stamps[33][5]//time_stamps[id][x] |
new time_stamps[33][5]//time_stamps[id][x] |
392 |
#define DJUMP 2 |
#define DJUMP 2 |
393 |
#define SJUMP 4 |
#define SJUMP 4 |
394 |
|
|
395 |
new SVC_STATUSICON, SVC_TEAMINFO, SVC_ROUNDTIME, SVC_FLASHLIGHT, SVC_SCREENFADE |
new SVC_STATUSICON, SVC_TEAMINFO, SVC_ROUNDTIME, SVC_FLASHLIGHT, SVC_SCREENFADE, SVC_CLCORPSE; |
396 |
|
|
397 |
new SCORES_PATH[100], HSCORES_PATH[100] |
new SCORES_PATH[100], HSCORES_PATH[100] |
398 |
|
|
421 |
register_cvar( "climb_db_serverid", NULLSTR ) |
register_cvar( "climb_db_serverid", NULLSTR ) |
422 |
register_cvar( "climb_db_exists", "0" ) |
register_cvar( "climb_db_exists", "0" ) |
423 |
|
|
424 |
p_msg_r = register_cvar( "climb_msg_r", "0" ) |
p_msg_r = register_cvar( "climb_msg_r", "0" ); |
425 |
p_msg_g = register_cvar( "climb_msg_g", "150" ) |
p_msg_g = register_cvar( "climb_msg_g", "150" ); |
426 |
p_msg_b = register_cvar( "climb_msg_b", "250" ) |
p_msg_b = register_cvar( "climb_msg_b", "250" ); |
427 |
p_msg_x = register_cvar( "climb_msg_x", "0.05" ) |
p_msg_x = register_cvar( "climb_msg_x", "0.05" ); |
428 |
p_msg_y = register_cvar( "climb_msg_y", "0.5" ) |
p_msg_y = register_cvar( "climb_msg_y", "0.5" ); |
429 |
|
|
430 |
p_light_r = register_cvar( "climb_light_r", "255" ) |
p_light_r = register_cvar( "climb_light_r", "255" ); |
431 |
p_light_g = register_cvar( "climb_light_g", "255" ) |
p_light_g = register_cvar( "climb_light_g", "255" ); |
432 |
p_light_b = register_cvar( "climb_light_b", "255" ) |
p_light_b = register_cvar( "climb_light_b", "255" ); |
433 |
|
|
434 |
p_sounds = register_cvar( "climb_sounds", "1" ) |
p_sounds = register_cvar( "climb_sounds", "1" ); |
435 |
p_render = register_cvar( "climb_unsolid_type", "0" ) |
p_render = register_cvar( "climb_unsolid_type", "0" ); |
436 |
p_start_respawn = register_cvar( "climb_start_respawn", "0" ) |
p_start_respawn = register_cvar( "climb_start_respawn", "0" ); |
437 |
p_water_nodraw = register_cvar( "climb_water_nodraw", "0" ) |
p_water_nodraw = register_cvar( "climb_water_nodraw", "0" ); |
438 |
|
|
439 |
p_stats_hsurl = register_cvar( "climb_stats_hsurl", NULLSTR ) //Use %s in place of map name |
p_stats_hsurl = register_cvar( "climb_stats_hsurl", NULLSTR ); //Use %s in place of map name |
440 |
p_stats_msg = register_cvar( "climb_stats_msg", NULLSTR ) |
p_stats_msg = register_cvar( "climb_stats_msg", NULLSTR ); |
441 |
|
|
442 |
p_allow_spectators = get_cvar_pointer( "allow_spectators" ) |
p_allow_spectators = get_cvar_pointer( "allow_spectators" ); |
443 |
p_teambalance = get_cvar_pointer( "mp_autoteambalance" ) |
p_teambalance = get_cvar_pointer( "mp_autoteambalance" ); |
444 |
p_limitteams = get_cvar_pointer( "mp_limitteams" ) |
p_limitteams = get_cvar_pointer( "mp_limitteams" ); |
445 |
|
|
446 |
MAXPLAYERS = get_maxplayers( ) |
MAXPLAYERS = get_maxplayers( ); |
447 |
|
|
448 |
TEAM_BALANCE_OLD = get_pcvar_num( p_teambalance ) |
TEAM_BALANCE_OLD = get_pcvar_num( p_teambalance ); |
449 |
LIMIT_TEAMS_OLD = get_pcvar_num( p_limitteams ) |
LIMIT_TEAMS_OLD = get_pcvar_num( p_limitteams ); |
450 |
|
|
451 |
//Message Pseudo-Constants |
//Message Pseudo-Constants |
452 |
SVC_STATUSICON = get_user_msgid( "StatusIcon" ) |
SVC_STATUSICON = get_user_msgid( "StatusIcon" ); |
453 |
SVC_TEAMINFO = get_user_msgid( "TeamInfo" ) |
SVC_TEAMINFO = get_user_msgid( "TeamInfo" ); |
454 |
SVC_ROUNDTIME = get_user_msgid( "RoundTime" ) |
SVC_ROUNDTIME = get_user_msgid( "RoundTime" ); |
455 |
SVC_FLASHLIGHT = get_user_msgid( "Flashlight" ) |
SVC_FLASHLIGHT = get_user_msgid( "Flashlight" ); |
456 |
SVC_SCREENFADE = get_user_msgid( "ScreenFade" ) |
SVC_SCREENFADE = get_user_msgid( "ScreenFade" ); |
457 |
|
SVC_CLCORPSE = get_user_msgid( "ClCorpse" ); |
458 |
|
|
459 |
//These commands get blocked always. |
//These commands get blocked always. |
460 |
register_clcmd( "fullupdate", "block_cmd2" ) |
register_clcmd( "fullupdate", "block_cmd2" ); |
461 |
|
|
462 |
//These commands get blocked when climb is enabled. |
//These commands get blocked when climb is enabled. |
463 |
register_clcmd( "chooseteam", "spectate" ) |
register_clcmd( "chooseteam", "spectate" ); |
464 |
register_clcmd( "buy", "block_cmd" ) |
register_clcmd( "buy", "block_cmd" ); |
465 |
register_clcmd( "buyammo1", "block_cmd" ) |
register_clcmd( "buyammo1", "block_cmd" ); |
466 |
register_clcmd( "buyammo2", "block_cmd" ) |
register_clcmd( "buyammo2", "block_cmd" ); |
467 |
register_clcmd( "buyequip", "block_cmd" ) |
register_clcmd( "buyequip", "block_cmd" ); |
468 |
|
|
469 |
register_clcmd( "jointeam", "block_jointeam" ) |
register_clcmd( "jointeam", "block_jointeam" ); |
470 |
|
|
471 |
//Commands to detect cheats. |
//Commands to detect cheats. |
472 |
register_clcmd( "+hook", "phook" ) |
register_clcmd( "+hook", "phook" ); |
473 |
register_clcmd( "+rope", "phook" ) |
register_clcmd( "+rope", "phook" ); |
474 |
register_clcmd( "-hook", "mhook" ) |
register_clcmd( "-hook", "mhook" ); |
475 |
register_clcmd( "-rope", "mhook" ) |
register_clcmd( "-rope", "mhook" ); |
476 |
|
|
477 |
//Commands referencing function 'donothing' are picked up by the more flexible code in the client_command forward. |
//Commands referencing function 'donothing' are picked up by the more flexible code in the client_command forward. |
478 |
register_clcmd( "say help", "help_msg" ) |
register_clcmd( "say help", "help_msg" ) |
674 |
} |
} |
675 |
} |
} |
676 |
|
|
|
//If Cvar set, set func_water ents to no draw, helps many peoples FPS |
|
|
/*if( get_pcvar_num( p_water_nodraw ) ) |
|
|
{ |
|
|
ent = find_ent_by_class( -1, "func_water" ) |
|
|
while( ent > 0 ) |
|
|
{ |
|
|
set_entity_visibility( ent, 0 ) |
|
|
ent=find_ent_by_class( ent, "func_water" ) |
|
|
} |
|
|
}*/ |
|
|
|
|
677 |
//Remove map built in start button sounds |
//Remove map built in start button sounds |
678 |
ent = find_ent_by_class( -1, "ambient_generic" ) |
ent = find_ent_by_class( -1, "ambient_generic" ) |
679 |
while( ent > 0 ) |
while( ent > 0 ) |
915 |
|
|
916 |
//Do gocheck |
//Do gocheck |
917 |
new cppos = timer[id][TMR_CPPOS] * 4 |
new cppos = timer[id][TMR_CPPOS] * 4 |
918 |
for( new i=0; i<3; i++ ) coords[i] = origins[id][cppos + i] |
coords[0] = origins[id][cppos] |
919 |
|
coords[1] = origins[id][cppos + 1] |
920 |
|
coords[2] = origins[id][cppos + 2] |
921 |
entity_set_float( id, EV_FL_gravity, origins[id][3] ) |
entity_set_float( id, EV_FL_gravity, origins[id][3] ) |
922 |
teleport( id, coords ) |
teleport( id, coords ) |
923 |
|
|
1036 |
cflags_new += CF_START |
cflags_new += CF_START |
1037 |
set_entity_flags( id, FL_FROZEN, 0 ) |
set_entity_flags( id, FL_FROZEN, 0 ) |
1038 |
//set_solid( id, 0 ); |
//set_solid( id, 0 ); |
1039 |
entity_set_float( id, EV_FL_gravity, origins[id][ORIG_PAUS + ORIG_GRAV] ) |
entity_set_float( id, EV_FL_gravity, origins[id][ORIG_PAUSG] ) |
1040 |
clmsg( id, "UNPAUSED" ) |
clmsg( id, "UNPAUSED" ) |
1041 |
sfexec( id, 2 ) |
sfexec( id, 2 ) |
1042 |
} |
} |
1302 |
{//Spawned |
{//Spawned |
1303 |
if( !get_pcvar_num( p_climb ) ) |
if( !get_pcvar_num( p_climb ) ) |
1304 |
{ |
{ |
1305 |
set_msg_block( SVC_STATUSICON, 0 ) |
set_msg_block( SVC_STATUSICON, BLOCK_NOT ); |
1306 |
return |
set_msg_block( SVC_CLCORPSE, BLOCK_NOT ); |
1307 |
|
return; |
1308 |
} |
} |
1309 |
|
|
1310 |
if( !is_user_bot( id ) && !is_user_hltv( id ) ) |
if( is_user_bot( id ) || is_user_hltv( id ) ) return; |
|
return |
|
1311 |
|
|
1312 |
flight_icons( id )//redraw flashlight hud icons |
flight_icons( id ); //redraw flashlight hud icons |
1313 |
set_msg_block( SVC_STATUSICON, 2 )//Block buy menu |
set_msg_block( SVC_STATUSICON, BLOCK_SET ); //Block buy menu |
1314 |
|
set_msg_block( SVC_CLCORPSE, BLOCK_SET ); //block client corpses |
1315 |
|
|
1316 |
|
flight_icons( id ); //redraw flashlight hud icons |
1317 |
|
|
1318 |
if( is_climber_alive( id ) ) |
if( is_climber_alive( id ) ) |
1319 |
{ |
{ |
1320 |
heal( id ) |
heal( id ); |
1321 |
|
|
1322 |
//Execute commands from start/finish config |
//Execute commands from start/finish config |
1323 |
sfexec( id, 1 ) |
sfexec( id, 1 ); |
1324 |
|
|
1325 |
//Show admin as VIP on Scoreboard. |
//Show admin as VIP on Scoreboard. |
1326 |
if( get_user_flags( id ) & VIP ) cs_set_user_scoreattrib( id, 4 ) |
if( get_user_flags( id ) & VIP ) cs_set_user_scoreattrib( id, 4 ); |
1327 |
|
|
1328 |
|
new cppos = timer[id][TMR_CPPOS] * 4; |
1329 |
|
|
1330 |
//If they are paused tp to pause spot and freeze them again. |
//If they are paused tp to pause spot and freeze them again. |
1331 |
if( timer[id][TMR_CFLAGS] & CF_PAUSE ) |
if( timer[id][TMR_CFLAGS] & CF_PAUSE ) |
1332 |
{ |
{ |
1333 |
new Float:coords[3] |
new Float:coords[3]; |
1334 |
coords[0] = origins[ id ][ ORIG_PAUS + 0 ] |
coords[0] = origins[ id ][ ORIG_PAUSX ]; |
1335 |
coords[1] = origins[ id ][ ORIG_PAUS + 1 ] |
coords[1] = origins[ id ][ ORIG_PAUSY ]; |
1336 |
coords[2] = origins[ id ][ ORIG_PAUS + 2 ] |
coords[2] = origins[ id ][ ORIG_PAUSZ ]; |
1337 |
teleport( id, coords ) |
teleport( id, coords ); |
1338 |
cl_pause( id ) |
cl_pause( id ); |
1339 |
} |
} |
|
|
|
1340 |
//Teleport to cp, start, or primary spawn position |
//Teleport to cp, start, or primary spawn position |
1341 |
else if( origins[ id ][ 0 ] || origins[ id ][ 1 ] || origins[ id ][ 2 ]) gocheck( id ) |
else if( origins[ id ][ cppos ] || origins[ id ][ cppos+1 ] || origins[ id ][ cppos+2 ] ) gocheck( id ); |
1342 |
else if( !teleport( id, start_tp_orig ) ) teleport( id, spawn_tp_orig ) |
else teleport( id, start_tp_orig ); |
1343 |
|
//else if( !teleport( id, start_tp_orig ) ) teleport( id, spawn_tp_orig ); //no need to tp to spawn_tp_orig, they're already there |
1344 |
} |
} |
1345 |
sortcssb( ) |
sortcssb( ) |
1346 |
} |
} |
1356 |
if( !get_pcvar_num(p_climb) ) return |
if( !get_pcvar_num(p_climb) ) return |
1357 |
|
|
1358 |
new id = find_player( "i" ) |
new id = find_player( "i" ) |
|
//if(0<cl<3&&!id){ |
|
1359 |
new cl = get_playersnum( ) |
new cl = get_playersnum( ) |
1360 |
if( cl < MAXPLAYERS - 2 && !id ) |
if( cl < MAXPLAYERS - 2 && !id ) |
1361 |
{ |
{ |
1409 |
|
|
1410 |
public check_cvars( ) |
public check_cvars( ) |
1411 |
{ |
{ |
1412 |
static bool:nodraw |
static bool:nodraw; |
1413 |
if( get_pcvar_num( p_water_nodraw ) && !nodraw ) |
if( get_pcvar_num( p_water_nodraw ) && !nodraw ) |
1414 |
{ |
{ |
1415 |
new ent = find_ent_by_class( -1, "func_water" ) |
new ent = find_ent_by_class( -1, "func_water" ); |
1416 |
while( ent > 0 ) |
while( ent > 0 ) |
1417 |
{ |
{ |
1418 |
set_entity_visibility( ent, 0 ) |
set_entity_visibility( ent, 0 ); |
1419 |
ent = find_ent_by_class( ent, "func_water" ) |
ent = find_ent_by_class( ent, "func_water" ); |
1420 |
} |
} |
1421 |
nodraw = true |
nodraw = true; |
1422 |
} |
} |
1423 |
else if( !get_pcvar_num( p_water_nodraw ) && nodraw ) |
else if( !get_pcvar_num( p_water_nodraw ) && nodraw ) |
1424 |
{ |
{ |
1425 |
new ent = find_ent_by_class( -1, "func_water" ) |
new ent = find_ent_by_class( -1, "func_water" ); |
1426 |
while( ent > 0 ) |
while( ent > 0 ) |
1427 |
{ |
{ |
1428 |
set_entity_visibility( ent, 1 ) |
set_entity_visibility( ent, 1 ); |
1429 |
ent = find_ent_by_class( ent, "func_water" ) |
ent = find_ent_by_class( ent, "func_water" ); |
1430 |
} |
} |
1431 |
nodraw = false |
nodraw = false; |
1432 |
} |
} |
1433 |
} |
} |
1434 |
|
|
1755 |
new Float:coords[3] |
new Float:coords[3] |
1756 |
entity_get_vector( id, EV_VEC_origin, coords ) |
entity_get_vector( id, EV_VEC_origin, coords ) |
1757 |
|
|
1758 |
origins[id][ORIG_PAUS] = coords[0] |
origins[id][ORIG_PAUSX] = coords[0] |
1759 |
origins[id][ORIG_PAUS+1] = coords[1] |
origins[id][ORIG_PAUSY] = coords[1] |
1760 |
origins[id][ORIG_PAUS+2] = coords[2] |
origins[id][ORIG_PAUSZ] = coords[2] |
1761 |
origins[id][ORIG_PAUS+ORIG_GRAV] = entity_get_float( id, EV_FL_gravity ) |
origins[id][ORIG_PAUSG] = entity_get_float( id, EV_FL_gravity ) |
1762 |
} |
} |
1763 |
return PLUGIN_CONTINUE |
return PLUGIN_CONTINUE |
1764 |
} |
} |
1784 |
|
|
1785 |
//new cflags = timer[id][TMR_CFLAGS] |
//new cflags = timer[id][TMR_CFLAGS] |
1786 |
|
|
1787 |
if( btn_type == 1 )//Start Button |
if( btn_type == 1 && !check_timeout( id, time_stamps[id][TS_SPAWN], SPAWN_TIMEOUT ) )//Start Button |
1788 |
{ |
{ |
1789 |
new Float:orig[3], bool:need_respawn = true //Float:view[3] |
new Float:orig[3], bool:need_respawn = true //Float:view[3] |
1790 |
if( timer[id][TMR_CFLAGS] & CF_START ) need_respawn = false |
if( timer[id][TMR_CFLAGS] & CF_START ) need_respawn = false |
2615 |
{//If they are paused tp to pause spot and freeze them again. |
{//If they are paused tp to pause spot and freeze them again. |
2616 |
new Float:coords[3] |
new Float:coords[3] |
2617 |
|
|
2618 |
coords[0] = origins[ id ][ ORIG_PAUS + 0 ] |
coords[0] = origins[ id ][ ORIG_PAUSX ] |
2619 |
coords[1] = origins[ id ][ ORIG_PAUS + 1 ] |
coords[1] = origins[ id ][ ORIG_PAUSY ] |
2620 |
coords[2] = origins[ id ][ ORIG_PAUS + 2 ] |
coords[2] = origins[ id ][ ORIG_PAUSZ ] |
2621 |
|
|
2622 |
teleport( id, coords ) |
teleport( id, coords ) |
2623 |
cl_pause( id ) |
cl_pause( id ) |
2626 |
} |
} |
2627 |
else if( get_user_flags( id ) & VIP ? 1 : ( cvar_enabled( id, p_allow_spectators ) ) ) |
else if( get_user_flags( id ) & VIP ? 1 : ( cvar_enabled( id, p_allow_spectators ) ) ) |
2628 |
{ |
{ |
|
//Move client way outside the map so we don't have to see their retarded model |
|
|
new Float:orig[3] |
|
|
entity_get_vector( id, EV_VEC_origin, orig ) |
|
|
entity_set_vector( id, EV_VEC_origin, Float:{ 99999.9, 99999.9, 99999.9 } ) |
|
|
|
|
|
//Set a task to move them back to where they were originally |
|
|
new ida[4] |
|
|
ida[0] = id |
|
|
ida[1] = _:orig[0] |
|
|
ida[2] = _:orig[1] |
|
|
ida[3] = _:orig[2] |
|
|
set_task( 0.1, "tsk_spec_tp_back", _, ida, 4 ) |
|
|
|
|
2629 |
set_pev( id, pev_movetype, MOVETYPE_NOCLIP ) |
set_pev( id, pev_movetype, MOVETYPE_NOCLIP ) |
2630 |
set_pev( id, pev_solid, SOLID_NOT ) |
set_pev( id, pev_solid, SOLID_NOT ) |
2631 |
set_pev( id, pev_effects, EF_NODRAW ) |
set_pev( id, pev_effects, EF_NODRAW ) |