128 |
+: Cvars mp_autoteambalance and mp_limitteams are set to 0 when a start button is found, and reverted when the map changes. |
+: Cvars mp_autoteambalance and mp_limitteams are set to 0 when a start button is found, and reverted when the map changes. |
129 |
+: Support for a2 maps start/finish buttons. |
+: Support for a2 maps start/finish buttons. |
130 |
+: Commands measure and measure2. |
+: Commands measure and measure2. |
|
+: Multiplayer friendly bhops. |
|
131 |
+: Command 'weapons', gives client one of each speed weapon. |
+: Command 'weapons', gives client one of each speed weapon. |
132 |
+: Ranking by weapon speed. ex: If you beat a map with AWP, you'll be ranked above other weapon scores. |
+: Ranking by weapon speed. ex: If you beat a map with AWP, you'll be ranked above other weapon scores. |
133 |
+: Command countdown to have time countdown from your best time instead of counting up. |
+: Command countdown to have time countdown from your best time instead of counting up. |
135 |
-: Plugin ad on client connect. |
-: Plugin ad on client connect. |
136 |
-: WebMod support since it is a huge security vulnerability. |
-: WebMod support since it is a huge security vulnerability. |
137 |
-: Cvars: climb_webmod, climb_stats_path, climb_stats_url, ip_internal, ip_external |
-: Cvars: climb_webmod, climb_stats_path, climb_stats_url, ip_internal, ip_external |
138 |
c: Tweaked semiclip to hopefully eliminate lag problems reported by some people. |
//c: Tweaked semiclip to hopefully eliminate lag problems reported by some people. |
139 |
|
//c: New semiclip, should be flawless now. |
140 |
c: Cvar climb_water_nodraw changes take effect without reloading map. |
c: Cvar climb_water_nodraw changes take effect without reloading map. |
141 |
c: Database now stores multiple records per map per player. |
c: Database now stores multiple records per map per player. |
142 |
c: Cvar climb_db_pass is now protected. |
c: Cvar climb_db_pass is now protected. |
269 |
#include <cstrike> |
#include <cstrike> |
270 |
#include <cstrike2> |
#include <cstrike2> |
271 |
|
|
272 |
new const VERSION[ ] = "a3.7.3 Nov 18 16:34 MST" |
new const VERSION[ ] = "a3.7.7 Feb 23 18:32 MST" |
273 |
new const TRKCVAR[ ] = "climb_version" |
new const TRKCVAR[ ] = "climb_version" |
274 |
|
|
275 |
new const DONOTHING[ ] = "donothing" |
new const DONOTHING[ ] = "donothing" |
276 |
new const NULLSTR[ ] = "" |
new const NULLSTR[ ] = "" |
277 |
|
|
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] |
344 |
new ST_BTNS[9], FN_BTNS[9], ST_BTN_CNT = 0, FN_BTN_CNT = 0 |
new ST_BTNS[9], FN_BTNS[9], ST_BTN_CNT = 0, FN_BTN_CNT = 0 |
345 |
new dyn_spawn_ids[32], dyn_spawn_count, Float:spawn_tp_orig[3], Float:start_tp_orig[3] |
new dyn_spawn_ids[32], dyn_spawn_count, Float:spawn_tp_orig[3], Float:start_tp_orig[3] |
346 |
|
|
347 |
new bool:sclip[33],Float:post_think_vel[33][3],sc_fcount |
new Float:post_think_vel[33][3] |
348 |
|
|
349 |
new LIMIT_TEAMS_OLD, TEAM_BALANCE_OLD |
new LIMIT_TEAMS_OLD, TEAM_BALANCE_OLD |
350 |
|
|
|
//Bhop fix vars |
|
|
#define MAX_DOORS 500 |
|
|
new door_count = 0, func_doors[MAX_DOORS][3], Float:door_tp_pos[MAX_DOORS][3] |
|
|
new bhop_failid[33], bool:bhop_fail[33] |
|
|
//func_doors[x]{ id, speed, angles } |
|
|
|
|
351 |
//Cvar Pointers |
//Cvar Pointers |
352 |
new p_climb, p_auto, p_boost, p_cpprice, p_startmoney |
new p_climb, p_auto, p_boost, p_cpprice, p_startmoney |
353 |
new p_msg_r, p_msg_g, p_msg_b, p_msg_x, p_msg_y |
new p_msg_r, p_msg_g, p_msg_b, p_msg_x, p_msg_y |
366 |
#define TSK_AUTORSPN 100 //100+: Auto Respawn |
#define TSK_AUTORSPN 100 //100+: Auto Respawn |
367 |
//#define TSK_BOOSTTMR 150 //150+: Solid Boost Timer |
//#define TSK_BOOSTTMR 150 //150+: Solid Boost Timer |
368 |
#define TSK_FLIGHT 200 |
#define TSK_FLIGHT 200 |
369 |
#define TSK_BHOP 250 |
#define TSK_MEASURE2 250 |
|
#define TSK_CLEAR_FAIL 300 |
|
|
#define TSK_MEASURE2 350 |
|
370 |
|
|
371 |
//Status timer[id][TMR_CFLAGS]&=x |
//Status timer[id][TMR_CFLAGS]&=x |
372 |
#define CF_NULL 0 //Passed to change_boost() to remove all boost flags |
#define CF_NULL 0 //Passed to change_boost() to remove all boost flags |
387 |
|
|
388 |
#define SILENT 1 |
#define SILENT 1 |
389 |
|
|
390 |
new SVC_STATUSICON, SVC_TEAMINFO, SVC_ROUNDTIME, SVC_FLASHLIGHT, SVC_SCREENFADE |
//Boost Flags for climb_boost CVAR |
391 |
|
#define SOLID 1 |
392 |
|
#define DJUMP 2 |
393 |
|
#define SJUMP 4 |
394 |
|
|
395 |
|
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 |
|
|
407 |
|
|
408 |
p_climb = register_cvar( "climb", "0", FCVAR_SERVER ) |
p_climb = register_cvar( "climb", "0", FCVAR_SERVER ) |
409 |
p_auto = register_cvar( "climb_auto", "1" ) |
p_auto = register_cvar( "climb_auto", "1" ) |
410 |
p_boost = register_cvar( "climb_boost", "1" ) |
p_boost = register_cvar( "climb_boost", "7" ) |
411 |
p_cpprice = register_cvar( "climb_cpprice", "0" ) |
p_cpprice = register_cvar( "climb_cpprice", "0" ) |
412 |
p_startmoney = register_cvar( "climb_startmoney", "1337" ) |
p_startmoney = register_cvar( "climb_startmoney", "1337" ) |
413 |
|
|
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" ) |
549 |
if( file_exists( ini ) ) |
if( file_exists( ini ) ) |
550 |
{ |
{ |
551 |
new line = 0, text[50], len |
new line = 0, text[50], len |
552 |
while( read_file( ini, line++, text, sizeof(text)-1 , len ) ) |
while( read_file( ini, line++, text, 49 , len ) ) |
553 |
{ |
{ |
554 |
if( !equal( text, ";", 1 ) && !equal( text, "#", 1 ) && !equal( text, "//", 2 ) ) |
if( !equal( text, ";", 1 ) && !equal( text, "#", 1 ) && !equal( text, "//", 2 ) ) |
555 |
{ |
{ |
581 |
} |
} |
582 |
} |
} |
583 |
|
|
|
static last_ent |
|
|
new class[31], key[31], val[31] |
|
|
copy_keyvalue( class, 30, key, 30, val, 30 ) |
|
|
|
|
|
if( ent != last_ent && func_doors[door_count][0] && door_count < MAX_DOORS ) |
|
|
door_count++ |
|
|
|
|
|
if( equal( class, "func_door" ) ) |
|
|
{ |
|
|
//func_doors[x]{ id, speed, angles } |
|
|
|
|
|
if( ent != last_ent ) func_doors[door_count][0] = ent |
|
|
|
|
|
if( equal( key, "speed" ) ) |
|
|
func_doors[door_count][1] = str_to_num(val) |
|
|
if( equal( key, "dmg" ) ) |
|
|
func_doors[door_count][0] = 0 |
|
|
if( equal( key, "angles" ) ) |
|
|
{ |
|
|
new angles[5] |
|
|
parse( val, angles, 4 ) |
|
|
func_doors[door_count][2] = str_to_num( angles ) |
|
|
} |
|
|
last_ent = ent |
|
|
} |
|
|
|
|
584 |
return PLUGIN_CONTINUE |
return PLUGIN_CONTINUE |
585 |
} |
} |
586 |
|
|
588 |
{ |
{ |
589 |
new ent, ent2, tmpstr[33], Float:tmpflt |
new ent, ent2, tmpstr[33], Float:tmpflt |
590 |
|
|
|
if( func_doors[door_count][0] && door_count < MAX_DOORS ) |
|
|
door_count++ |
|
|
|
|
|
//Find tp spots for doors, in case they're used for bhop |
|
|
//func_doors[x]{ id, speed, angles } |
|
|
for( new i = 0; i < door_count; i++ ) |
|
|
{ |
|
|
ent = func_doors[i][0] |
|
|
if( !is_valid_ent( ent ) ) func_doors[i][0] = 0 |
|
|
else |
|
|
{ |
|
|
new Float:dmins[3], Float:dmaxs[3] |
|
|
entity_get_vector( ent, EV_VEC_mins, dmins ) |
|
|
entity_get_vector( ent, EV_VEC_maxs, dmaxs ) |
|
|
|
|
|
new dwid = floatround( dmaxs[0] - dmins[0] ) |
|
|
new dlen = floatround( dmaxs[1] - dmins[1] ) |
|
|
|
|
|
//If the door moves up, or is thin, remove it's id from the array |
|
|
if( func_doors[i][2] < 0 || dwid < 24 || dlen < 24 ) |
|
|
func_doors[i][0] = 0 |
|
|
//Otherwise find a safe tp spot in case it's a bhop door |
|
|
else |
|
|
{ |
|
|
//If it has a targetname, change the id in array to targeter |
|
|
entity_get_string( ent, EV_SZ_targetname, tmpstr, 32 ) |
|
|
if( strlen( tmpstr ) ) |
|
|
{ |
|
|
ent2 = find_ent_by_target( -1, tmpstr ) |
|
|
if( ent2 ) |
|
|
{ |
|
|
func_doors[i][0] = ent2 |
|
|
|
|
|
//If targeter is a button, remove it's id from the array |
|
|
entity_get_string( ent2, EV_SZ_classname, tmpstr, 32 ) |
|
|
if( equal( tmpstr, "func_button" ) ) |
|
|
func_doors[i][0] = 0 |
|
|
} |
|
|
} |
|
|
|
|
|
new Float:tmpvec[3], Float:tmpvec2[3] |
|
|
|
|
|
new Float:dr_tc[3] |
|
|
dr_tc[0] = ( dmaxs[0] + dmins[0] ) / 2 |
|
|
dr_tc[1] = ( dmaxs[1] + dmins[1] ) / 2 |
|
|
dr_tc[2] = dmaxs[2] |
|
|
|
|
|
tmpvec[0] = ( dmaxs[0] + dmins[0] ) / 2 |
|
|
tmpvec[1] = dmaxs[1] + 20 |
|
|
tmpvec[2] = dmaxs[2] + 20 |
|
|
trace_line( ent, dr_tc, tmpvec, tmpvec2 ) |
|
|
if( !trace_hull( tmpvec, HULL_HUMAN ) && tmpvec2[2] == tmpvec[2] ) |
|
|
door_tp_pos[i] = tmpvec |
|
|
else |
|
|
{ |
|
|
tmpvec[1] = dmins[1] - 20 |
|
|
trace_line( ent, dr_tc, tmpvec, tmpvec2 ) |
|
|
if( !trace_hull( tmpvec, HULL_HUMAN ) && tmpvec2[2] == tmpvec[2] ) |
|
|
door_tp_pos[i] = tmpvec |
|
|
else |
|
|
{ |
|
|
tmpvec[0] = dmaxs[0] + 20 |
|
|
tmpvec[1] = ( dmaxs[1] + dmins[1] ) / 2 |
|
|
trace_line( ent, dr_tc, tmpvec, tmpvec2 ) |
|
|
if( !trace_hull( tmpvec, HULL_HUMAN ) && tmpvec2[2] == tmpvec[2] ) |
|
|
door_tp_pos[i] = tmpvec |
|
|
else |
|
|
{ |
|
|
tmpvec[0] = dmins[0] - 20 |
|
|
door_tp_pos[i] = tmpvec |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
591 |
//Store ent id's for start/fin buttons, some maps change target value after timer starts |
//Store ent id's for start/fin buttons, some maps change target value after timer starts |
592 |
ent = find_ent_by_class( -1, "func_button" ) |
ent = find_ent_by_class( -1, "func_button" ) |
593 |
while( ent > 0 ) |
while( ent > 0 ) |
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 |
|
|
1035 |
{ |
{ |
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 |
unsolid( id ) |
//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 |
} |
} |
1060 |
{ |
{ |
1061 |
if( is_climber_alive( id ) ) |
if( is_climber_alive( id ) ) |
1062 |
{ |
{ |
1063 |
unsolid( id ) |
set_solid( id, 0 ); |
1064 |
set_rendering( id, kRenderFxGlowShell, 0, 0, 255, kRenderTransColor, 1 ) |
set_rendering( id, kRenderFxGlowShell, 0, 0, 255, kRenderTransColor, 1 ) |
1065 |
|
//set_pev( id, pev_flags, pev( id, pev_flags ) & FL_FROZEN ) |
1066 |
set_entity_flags( id, FL_FROZEN, 1 ) |
set_entity_flags( id, FL_FROZEN, 1 ) |
1067 |
clmsg( id, "PAUSED - say '/unpause' to resume." ) |
clmsg( id, "PAUSED - say '/unpause' to resume." ) |
1068 |
} |
} |
1283 |
cs_user_spawn( id ) |
cs_user_spawn( id ) |
1284 |
|
|
1285 |
set_pev( id, pev_movetype, MOVETYPE_WALK ) |
set_pev( id, pev_movetype, MOVETYPE_WALK ) |
1286 |
set_pev( id, pev_solid, SOLID_BBOX ) |
set_pev( id, pev_solid, SOLID_SLIDEBOX ) |
1287 |
set_pev( id, pev_effects, 0 ) |
set_pev( id, pev_effects, 0 ) |
1288 |
set_pev( id, pev_deadflag, DEAD_NO ) |
set_pev( id, pev_deadflag, DEAD_NO ) |
1289 |
set_pev( id, pev_takedamage, DAMAGE_AIM ) |
set_pev( id, pev_takedamage, DAMAGE_AIM ) |
1300 |
|
|
1301 |
public ResetHUD( id ) |
public ResetHUD( id ) |
1302 |
{//Spawned |
{//Spawned |
1303 |
if( get_pcvar_num( p_climb ) ) |
if( !get_pcvar_num( p_climb ) ) |
|
{ |
|
|
if( !is_user_bot( id ) && !is_user_hltv( id ) ) |
|
1304 |
{ |
{ |
1305 |
flight_icons( id )//redraw flashlight hud icons |
set_msg_block( SVC_STATUSICON, BLOCK_NOT ); |
1306 |
set_msg_block( SVC_STATUSICON, 2 )//Block buy menu |
set_msg_block( SVC_CLCORPSE, BLOCK_NOT ); |
1307 |
|
return; |
1308 |
|
} |
1309 |
|
|
1310 |
|
if( is_user_bot( id ) || is_user_hltv( id ) ) return; |
1311 |
|
|
1312 |
|
flight_icons( id ); //redraw flashlight hud icons |
1313 |
|
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 |
//set_pev( id, pev_movetype, MOVETYPE_WALK ) |
heal( id ); |
|
//cs_set_user_team( id, 2 ) |
|
1321 |
|
|
1322 |
heal( id ) |
//Execute commands from start/finish config |
1323 |
sfexec( id, 1 )//Execute commands from start/finish config |
sfexec( id, 1 ); |
1324 |
if( get_user_flags( id ) & VIP ) cs_set_user_scoreattrib( id, 4 )//Show admin as VIP on Scoreboard. |
|
1325 |
|
//Show admin as VIP on Scoreboard. |
1326 |
|
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. |
1331 |
if( timer[id][TMR_CFLAGS] & CF_PAUSE ) |
if( timer[id][TMR_CFLAGS] & CF_PAUSE ) |
1332 |
{//If they are paused tp to pause spot and freeze them again. |
{ |
1333 |
new Float:coords[3] |
new Float:coords[3]; |
1334 |
for( new i=0; i<3; i++ ) coords[i] = origins[ id - 1 ][ ORIG_PAUS + i ] |
coords[0] = origins[ id ][ ORIG_PAUSX ]; |
1335 |
teleport( id, coords ) |
coords[1] = origins[ id ][ ORIG_PAUSY ]; |
1336 |
cl_pause( id ) |
coords[2] = origins[ id ][ ORIG_PAUSZ ]; |
1337 |
|
teleport( id, coords ); |
1338 |
|
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 - 1 ][ 0 ] || origins[ id - 1][ 1 ] || origins[ id - 1 ][ 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 |
} |
} |
|
else set_msg_block( SVC_STATUSICON, 0 ) |
|
|
} |
|
1347 |
|
|
1348 |
public run_tasks( ) |
public run_tasks( ) |
1349 |
{ |
{ |
1353 |
|
|
1354 |
public updatebot( ) |
public updatebot( ) |
1355 |
{ |
{ |
1356 |
if(get_pcvar_num(p_climb)) |
if( !get_pcvar_num(p_climb) ) return |
1357 |
{ |
|
|
//new players[32], cl |
|
|
//get_players( players, cl, "ach" ) |
|
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 |
{ |
{ |
1392 |
cs_user_spawn( id ) |
cs_user_spawn( id ) |
1393 |
} |
} |
1394 |
} |
} |
|
//else if(cl>2&&id)server_cmd("kick #%d",get_user_userid(id)) |
|
1395 |
else if( cl == MAXPLAYERS - 1 && id ) |
else if( cl == MAXPLAYERS - 1 && id ) |
1396 |
{ |
{ |
1397 |
set_entity_visibility( id, 1 ) |
set_entity_visibility( id, 1 ) |
1398 |
server_cmd( "kick #%d", get_user_userid( id ) ) |
server_cmd( "kick #%d", get_user_userid( id ) ) |
1399 |
} |
} |
1400 |
else if( is_user_bot( id ) && id ) |
else if( id ) |
1401 |
{ |
{ |
1402 |
set_entity_visibility( id, 0 ) |
set_entity_visibility( id, 0 ) |
1403 |
entity_set_int( id, EV_INT_solid, SOLID_NOT ) |
entity_set_int( id, EV_INT_solid, SOLID_NOT ) |
1406 |
call_think( id ) |
call_think( id ) |
1407 |
} |
} |
1408 |
} |
} |
|
} |
|
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 |
|
|
1456 |
return dif |
return dif |
1457 |
} |
} |
1458 |
|
|
1459 |
|
public boost_enabled( id, boost_type, silent ) |
1460 |
|
{ |
1461 |
|
if( get_pcvar_num( p_boost ) & boost_type ) return true; |
1462 |
|
if( !silent ) clmsg( id, "That boost type has been disabled by the server admin." ); |
1463 |
|
return false; |
1464 |
|
} |
1465 |
|
|
1466 |
stock change_boost( id, newboost, silent = 0 ) |
stock change_boost( id, newboost, silent = 0 ) |
1467 |
{//Change Boost flags |
{//Change Boost flags |
1468 |
if( !( cvar_enabled( id, p_boost, silent ) && isalive( id ) ) && notpaused( id ) ) return PLUGIN_HANDLED |
//if( !( cvar_enabled( id, p_boost, silent ) && isalive( id ) ) && notpaused( id ) ) return; |
1469 |
|
if( !isalive( id ) || !notpaused( id ) ) return; |
1470 |
|
|
1471 |
new msg[151], rmflag, cflags = timer[ id - 1 ][ TMR_CFLAGS ] |
new msg[151], rmflag, cflags = timer[ id ][ TMR_CFLAGS ]; |
1472 |
if( cflags & CF_SOLID ) |
if( cflags & CF_SOLID ) |
1473 |
{ |
{ |
1474 |
if( task_exists( 150 + id ) ) remove_task( 150 + id ) |
if( task_exists( 150 + id ) ) remove_task( 150 + id ); |
1475 |
rmflag = CF_SOLID |
rmflag = CF_SOLID; |
1476 |
msg = "Solid Boost Disabled.^n" |
msg = "Solid Boost Disabled.^n"; |
1477 |
} |
} |
1478 |
else if( cflags & CF_SUPER_JUMP ) |
else if( cflags & CF_SUPER_JUMP ) |
1479 |
{ |
{ |
1480 |
rmflag = CF_SUPER_JUMP |
rmflag = CF_SUPER_JUMP; |
1481 |
msg = "Super Jump Disabled.^n" |
msg = "Super Jump Disabled.^n"; |
1482 |
} |
} |
1483 |
else if( cflags & CF_DOUBLE_JUMP) |
else if( cflags & CF_DOUBLE_JUMP) |
1484 |
{ |
{ |
1485 |
rmflag = CF_DOUBLE_JUMP |
rmflag = CF_DOUBLE_JUMP; |
1486 |
msg = "Double Jump Disabled.^n" |
msg = "Double Jump Disabled.^n"; |
1487 |
} |
} |
1488 |
if( rmflag > 0 ) timer[ id - 1 ][ TMR_CFLAGS ] -= rmflag |
if( rmflag > 0 ) timer[ id ][ TMR_CFLAGS ] -= rmflag; |
1489 |
if( !( rmflag & newboost ) && \ |
if( !( rmflag & newboost ) && |
1490 |
!check_timeout( id, time_stamps[id][TS_BOOST], BOOST_TIMEOUT, ( cflags & CF_START ? timer[id][TMR_CNTTME] / 10 : get_systime() ) ) ) |
!check_timeout( id, time_stamps[id][TS_BOOST], BOOST_TIMEOUT, ( cflags & CF_START ? timer[id][TMR_CNTTME] / 10 : get_systime() ) ) ) |
1491 |
{ |
{ |
1492 |
if( newboost == CF_SOLID ) |
if( newboost == CF_SOLID && boost_enabled( id, SOLID, silent ) ) |
1493 |
{ |
{ |
1494 |
format( msg, 150, "%sSolid Boost Enabled.", msg ) |
format( msg, 150, "%sSolid Boost Enabled.", msg ); |
1495 |
new ida[1] |
new ida[1]; |
1496 |
ida[0] = id |
ida[0] = id; |
1497 |
set_task( 15.0, "solid_boost_timer", 150 + id, ida, 1 ) |
set_task( 15.0, "solid_boost_timer", 150 + id, ida, 1 ); |
1498 |
if( timer[ id - 1 ][ TMR_CFLAGS ] & CF_START ) timer[ id - 1 ][ TMR_CNTBST ]++ |
if( timer[ id ][ TMR_CFLAGS ] & CF_START ) timer[ id ][ TMR_CNTBST ]++; |
1499 |
} |
} |
1500 |
if( newboost == CF_SUPER_JUMP ) format( msg, 150, "%sSuper Jump Enabled.", msg ) |
else if( newboost == CF_SUPER_JUMP && boost_enabled( id, SJUMP, silent ) ) |
1501 |
if( newboost == CF_DOUBLE_JUMP ) format( msg, 150, "%sDouble Jump Enabled.", msg ) |
format( msg, 150, "%sSuper Jump Enabled.", msg ); |
1502 |
timer[ id - 1 ][ TMR_CFLAGS ] |= newboost |
else if( newboost == CF_DOUBLE_JUMP && boost_enabled( id, DJUMP, silent ) ) |
1503 |
|
format( msg, 150, "%sDouble Jump Enabled.", msg ); |
1504 |
|
else return; |
1505 |
|
timer[ id ][ TMR_CFLAGS ] += newboost; |
1506 |
} |
} |
1507 |
if(strlen(msg))clmsg(id,msg) |
clmsg( id, msg ); |
|
return PLUGIN_HANDLED |
|
1508 |
} |
} |
1509 |
|
|
1510 |
//Task to auto disable solid boost after timeout |
//Task to auto disable solid boost after timeout |
1511 |
public solid_boost_timer( ida[] ) |
public solid_boost_timer( ida[] ) |
1512 |
change_boost( ida[0], CF_SOLID ) |
change_boost( ida[0], CF_SOLID ) |
1513 |
|
|
1514 |
/*public server_frame( ) |
//Semi-clip |
1515 |
{//Semi-clip |
public server_frame( ) |
|
if( get_pcvar_num( p_climb ) ) |
|
1516 |
{ |
{ |
1517 |
new players[32], bool:skip[32], num, i, j |
if( !get_pcvar_num( p_climb ) ) return FMRES_IGNORED |
1518 |
new Float:orig_i[3], Float:orig_j[3] |
|
1519 |
new Float:vel_i[3], Float:vel_iz[3] |
new players[32], num, i, j, Float:c1[3], Float:c2[3]; |
1520 |
new id_i, id_j, cflags_i, cflags_j |
new Float:c1z[3], Float:c2z[3]; |
1521 |
get_players( players, num, "ac" ) |
new id_i, id_j, cflags_i, cflags_j; |
1522 |
|
get_players( players, num, "ach" ); |
1523 |
|
|
1524 |
|
//new Float:c1d[3],Float:c2d[3],xyadd,zadd |
1525 |
for( i = 0; i < num; i++ ) |
for( i = 0; i < num; i++ ) |
1526 |
{ |
{ |
1527 |
id_i = players[i] |
id_i = players[ i ]; |
1528 |
cflags_i = timer[id_i][TMR_CFLAGS] |
cflags_i = timer[id_i][TMR_CFLAGS]; |
|
|
|
1529 |
if( !( cflags_i & CF_PAUSE ) ) |
if( !( cflags_i & CF_PAUSE ) ) |
1530 |
{ |
{ |
1531 |
entity_get_vector( id_i, EV_VEC_origin, orig_i ) |
//Auto Semiclip |
1532 |
entity_get_vector( id_i, EV_VEC_velocity, vel_i ) |
entity_get_vector( id_i, EV_VEC_origin, c1 ); |
|
|
|
|
vel_iz[0] = vel_i[0] > 0 ? -70.0 : 70.0 |
|
|
vel_iz[1] = vel_i[1] > 0 ? -70.0 : 70.0 |
|
|
vel_iz[2] = vel_i[2] > 0 ? -120.0 : 120.0 |
|
|
|
|
|
if( !vel_i[0] ) vel_i[0] = vel_iz[0] * -1 |
|
|
if( !vel_i[1] ) vel_i[1] = vel_iz[1] * -1 |
|
|
if( !vel_i[2] ) vel_i[2] = vel_iz[2] * -1 |
|
1533 |
|
|
1534 |
|
c1z[2] = c1[2]; |
1535 |
|
c1[2] = 0.0; |
1536 |
for( j=0; j<num; j++ ) |
for( j=0; j<num; j++ ) |
1537 |
{ |
{ |
1538 |
if( i != j ) |
id_j = players[j]; |
1539 |
|
cflags_j = timer[id_j][TMR_CFLAGS]; |
1540 |
|
if( !( cflags_j & CF_SOLID ) && i != j ) |
1541 |
{ |
{ |
1542 |
id_j = players[j] |
entity_get_vector( id_j, EV_VEC_origin, c2 ); |
|
cflags_j = timer[id_j][TMR_CFLAGS] |
|
1543 |
|
|
1544 |
if( ( !( cflags_i & CF_SOLID && cflags_j & CF_SOLID ) || skip[i] ) && !( cflags_j & CF_PAUSE ) ) |
c2z[2] = c2[2]; |
1545 |
|
c2[2] = 0.0; |
1546 |
|
if( vector_distance( c1, c2 ) < 90 && vector_distance( c1z, c2z ) < 110) |
1547 |
{ |
{ |
1548 |
entity_get_vector( id_j, EV_VEC_origin, orig_j ) |
if( !(cflags_i & CF_SOLID && cflags_j & CF_SOLID ) ) |
|
|
|
|
if( is_between_f( orig_j[0], orig_i[0] + vel_iz[0], orig_i[0] + vel_i[0] ) && |
|
|
is_between_f( orig_j[1], orig_i[1] + vel_iz[1], orig_i[1] + vel_i[1] ) && |
|
|
is_between_f( orig_j[2], orig_i[2] + vel_iz[2], orig_i[2] + vel_i[2] ) ) |
|
1549 |
{ |
{ |
1550 |
unsolid( id_i ) |
set_solid( id_i, 0 ); |
1551 |
unsolid( id_j ) |
set_solid( id_j, 0 ); |
1552 |
skip[i] = true |
j = num; |
|
skip[j] = true |
|
|
//maybe reset j first time i runs this, to unsolid anyone they might be boosting with |
|
1553 |
} |
} |
1554 |
} |
} |
1555 |
} |
} |
1556 |
|
if( j + 1 == num ) set_solid( id_i ); |
1557 |
} |
} |
|
if( !skip[i] ) solid( id_i ) |
|
|
} |
|
|
} |
|
|
} |
|
|
return PLUGIN_CONTINUE |
|
|
}*/ |
|
|
public server_frame( ) |
|
|
{ |
|
|
if( !get_pcvar_num(p_climb) ) |
|
|
return PLUGIN_CONTINUE |
|
1558 |
|
|
|
sc_fcount++ |
|
|
if( sc_fcount > 9 ) sc_fcount = 0 |
|
1559 |
|
|
1560 |
//Semi-clip |
//Semiclip touch detection |
1561 |
new players[32],num,i,j,Float:c1[3],Float:c2[3] |
if( pev( id_i, pev_solid ) == SOLID_NOT ) |
1562 |
new Float:c1z[3],Float:c2z[3] |
{ |
1563 |
new id_i,id_j,cflags_i,cflags_j |
new class[9], ptr, Float:v_orig[3]; |
1564 |
get_players(players,num,"ac") |
pev( id_i, pev_origin, v_orig ); |
1565 |
//new Float:c1d[3],Float:c2d[3],xyadd,zadd |
//v_orig[2] -= 18; |
1566 |
for(i=0;i<num;i++){ |
v_orig[2] -= 10; |
1567 |
id_i=players[i] |
|
1568 |
cflags_i=timer[id_i][TMR_CFLAGS] |
new ent = engfunc( EngFunc_FindEntityInSphere, MAXPLAYERS, v_orig, 16.0 ); |
1569 |
if(!(cflags_i&CF_PAUSE)){ |
while( ent > MAXPLAYERS ) |
1570 |
//solid(players[i]) |
{ |
1571 |
entity_get_vector(id_i,EV_VEC_origin,c1) |
pev( ent, pev_classname, ptr, class, 8 ); |
1572 |
//entity_get_vector(players[i],EV_VEC_velocity,c1d) |
//trigger_teleport, trigger_once, trigger_multiple, trigger_gravity, trigger_push, trigger_hurt, func_door |
1573 |
c1z[2]=c1[2] |
//if( equal( class, "trigger_", 8 ) || equal( class, "func_", 5 ) && !equal( class, "func_water" ) ) |
1574 |
c1[2]=0.0 |
if( equal( class, "trigger_teleport" ) || equal( class, "trigger_hurt" ) || |
1575 |
for(j=0;j<num;j++){ |
equal( class, "trigger_once" ) || equal( class, "trigger_multiple" ) || |
1576 |
id_j=players[j] |
equal( class, "trigger_gravity" ) || equal( class, "trigger_push" ) || |
1577 |
cflags_j=timer[id_j][TMR_CFLAGS] |
equal( class, "func_door" ) ) |
1578 |
if(!(cflags_j&CF_SOLID)&&i!=j){ |
{ |
1579 |
entity_get_vector(id_j,EV_VEC_origin,c2) |
dllfunc( DLLFunc_Touch, ent, id_i ); |
1580 |
//entity_get_vector(players[j],EV_VEC_velocity,c2d) |
//break; |
|
c2z[2]=c2[2] |
|
|
c2[2]=0.0 |
|
|
if(vector_distance(c1,c2)<90&&vector_distance(c1z,c2z)<110){ |
|
|
if(!(cflags_i&CF_SOLID&&cflags_j&CF_SOLID)){//&&vector_distance(c1,c2)>25&&vector_distance(c1z,c2z)>30)){ |
|
|
unsolid(id_i) |
|
|
unsolid(id_j) |
|
|
j=num |
|
|
} |
|
1581 |
} |
} |
1582 |
|
ent = engfunc( EngFunc_FindEntityInSphere, ent, v_orig, 16.0 ); |
1583 |
} |
} |
1584 |
if(j+1==num)solid(id_i) |
|
1585 |
} |
} |
1586 |
} |
} |
1587 |
} |
} |
1588 |
return PLUGIN_CONTINUE |
|
1589 |
|
return FMRES_IGNORED |
1590 |
} |
} |
1591 |
|
|
1592 |
stock bool:is_between_f( Float:mid, Float:a, Float:b ) |
stock bool:is_between_f( Float:mid, Float:a, Float:b ) |
1611 |
if( !get_pcvar_num( p_climb ) || is_user_bot( id ) || !is_climber_alive( id ) ) |
if( !get_pcvar_num( p_climb ) || is_user_bot( id ) || !is_climber_alive( id ) ) |
1612 |
return PLUGIN_CONTINUE |
return PLUGIN_CONTINUE |
1613 |
|
|
1614 |
if( sclip[id] && sc_fcount == 9 ) entity_set_int( id, EV_INT_solid, SOLID_BBOX ) |
/* |
1615 |
|
//Auto Semiclip |
1616 |
|
new Float:vOrig[3], ent, count, Float:range |
1617 |
|
|
1618 |
|
range = pev( id, pev_speed ) * 0.5 + 50.0 |
1619 |
|
|
1620 |
|
pev( id, pev_origin, vOrig ) |
1621 |
|
|
1622 |
|
//if( !( timer[ id ][ TMR_CFLAGS ] & CF_SOLID ) ) |
1623 |
|
//{ |
1624 |
|
ent = engfunc( EngFunc_FindEntityInSphere, -1, vOrig, range ) |
1625 |
|
while( ent <= MAXPLAYERS ) |
1626 |
|
{ |
1627 |
|
if( ent != id ) |
1628 |
|
{ |
1629 |
|
set_solid( ent, 0 ) |
1630 |
|
count++ |
1631 |
|
} |
1632 |
|
ent = engfunc( EngFunc_FindEntityInSphere, ent, vOrig, range ) |
1633 |
|
} |
1634 |
|
//} |
1635 |
|
if( count ) set_solid( id, 0 ) |
1636 |
|
else set_solid( id ) |
1637 |
|
|
1638 |
|
|
1639 |
|
//Semiclip touch detection |
1640 |
|
if( pev( id, pev_solid ) == SOLID_NOT ) |
1641 |
|
{ |
1642 |
|
new class[9], ptr |
1643 |
|
//pev( id, pev_origin, vOrig ) |
1644 |
|
|
1645 |
|
new ent = engfunc( EngFunc_FindEntityInSphere, MAXPLAYERS, vOrig, 17.0 ) |
1646 |
|
while( ent > 0 ) |
1647 |
|
{ |
1648 |
|
pev( ent, pev_classname, ptr, class, 8 ) |
1649 |
|
if( equal( class, "trigger_", 8 ) || equal( class, "func_", 5 ) ) |
1650 |
|
dllfunc( DLLFunc_Touch, ent, id ) |
1651 |
|
ent = engfunc( EngFunc_FindEntityInSphere, ent, vOrig, 17.0 ) |
1652 |
|
} |
1653 |
|
|
1654 |
|
} |
1655 |
|
*/ |
1656 |
|
|
1657 |
//Detect button use. Replicated from HL SDK |
//Detect button use. Replicated from HL SDK |
1658 |
if( get_user_button( id ) & IN_USE && !( get_user_oldbutton( id ) & IN_USE ) ) |
if( get_user_button( id ) & IN_USE && !( get_user_oldbutton( id ) & IN_USE ) ) |
1737 |
if( !( get_pcvar_num(p_climb) && get_pcvar_num(p_boost) && is_climber_alive( id ) ) || is_user_bot(id) ) |
if( !( get_pcvar_num(p_climb) && get_pcvar_num(p_boost) && is_climber_alive( id ) ) || is_user_bot(id) ) |
1738 |
return PLUGIN_CONTINUE |
return PLUGIN_CONTINUE |
1739 |
|
|
|
if( sclip[id] ) entity_set_int( id, EV_INT_solid, SOLID_NOT ) |
|
|
|
|
1740 |
if( _:get_distance( _:post_think_vel[id], { 0, 0, 0 } ) ) |
if( _:get_distance( _:post_think_vel[id], { 0, 0, 0 } ) ) |
1741 |
{ |
{ |
1742 |
entity_set_vector( id, EV_VEC_velocity, post_think_vel[id] ) |
entity_set_vector( id, EV_VEC_velocity, post_think_vel[id] ) |
1754 |
{ |
{ |
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 |
for( new i=0; i<3; i++ ) origins[id][ORIG_PAUS+i] = coords[i] |
|
1758 |
origins[id][ORIG_PAUS+3] = entity_get_float( id, EV_FL_gravity ) |
origins[id][ORIG_PAUSX] = coords[0] |
1759 |
|
origins[id][ORIG_PAUSY] = coords[1] |
1760 |
|
origins[id][ORIG_PAUSZ] = coords[2] |
1761 |
|
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 |
1914 |
} |
} |
1915 |
|
|
1916 |
//Execute commands from start/finish config |
//Execute commands from start/finish config |
1917 |
public sfexec(id,clevent){ |
public sfexec( id, clevent ) |
1918 |
|
{ |
1919 |
new clstat[3],cflags=timer[id][TMR_CFLAGS] |
new clstat[3],cflags=timer[id][TMR_CFLAGS] |
1920 |
/*switch(timer[id][TMR_CFLAGS]){ |
|
|
case TMR_CFLAGS_STOP: clstat="ns" |
|
|
case TMR_CFLAGS_STRT: clstat="st" |
|
|
case TMR_CFLAGS_FNSH: clstat="fn" |
|
|
}*/ |
|
1921 |
if(is_finished(id))clstat="fn" |
if(is_finished(id))clstat="fn" |
1922 |
else if(cflags&CF_STOP)clstat="ns" |
else if(cflags&CF_STOP)clstat="ns" |
1923 |
else if(cflags&CF_START)clstat="st" |
else if(cflags&CF_START)clstat="st" |
|
//else if(timer[id][TMR_CFLAGS]&CF_FINISH)clstat="fn" |
|
|
//if(equal(clstat,"ns")&&(get_user_flags(id)&VIP||timer[id][TMR_SESFIN]>0))clstat="fn" |
|
1924 |
|
|
1925 |
for(new i=0;i<sfcount;i++){ |
new cmdstat[3], cmdevent[2], cmdtype[3], cmd[60], idtype[5], name[24] |
1926 |
new cmdstat[3],cmdevent[2],cmdtype[3],cmd[60],idtype[5] |
for( new i = 0; i < sfcount; i++ ) |
1927 |
parse(sfactions[i],cmdstat,2,cmdevent,1,cmdtype,2,cmd,sizeof(cmd)-1,idtype,4) |
{ |
1928 |
if((equali(cmdstat,clstat)||equali(cmdstat,"ay"))&&str_to_num(cmdevent)&clevent){ |
parse( sfactions[i], cmdstat, 2, cmdevent, 1, cmdtype, 2, cmd, 59, idtype, 4 ) |
1929 |
if(equali(cmdtype,"sc")){ |
if( ( equali( cmdstat, clstat ) || equali( cmdstat, "ay" ) ) && str_to_num( cmdevent ) & clevent ) |
1930 |
if(equali(idtype,"uid"))format(cmd,sizeof(cmd)-1,cmd,get_user_userid(id)) |
{ |
1931 |
else{ |
if( equali( cmdtype, "sc" ) ) |
1932 |
new name[24] |
{ |
1933 |
get_user_name(id,name,sizeof(name)-1) |
if( equali( idtype, "uid" ) ) |
1934 |
format(name,sizeof(name),"^"%s^"",name) |
format( cmd, 59, cmd, get_user_userid( id ) ) |
1935 |
format(cmd,sizeof(cmd)-1,cmd,name) |
else |
1936 |
|
{ |
1937 |
|
get_user_name( id, name, 23 ) |
1938 |
|
format( name, 23, "^"%s^"", name ) |
1939 |
|
format( cmd, 59, cmd, name ) |
1940 |
client_print(id,print_chat,cmd) |
client_print(id,print_chat,cmd) |
1941 |
} |
} |
1942 |
server_cmd(cmd) |
server_cmd(cmd) |
1943 |
} |
} |
1944 |
else{ |
else |
1945 |
|
{ |
1946 |
client_cmd(id,cmd) |
client_cmd(id,cmd) |
1947 |
} |
} |
1948 |
} |
} |
1949 |
} |
} |
|
return PLUGIN_HANDLED |
|
1950 |
} |
} |
1951 |
|
|
1952 |
//Update frags to reorder scoreboard |
//Update frags to reorder scoreboard |
2008 |
players[i] = pdata[i][2] |
players[i] = pdata[i][2] |
2009 |
} |
} |
2010 |
|
|
|
/*public get_limit(){ |
|
|
//if(get_pcvar_num(p_webmod)) |
|
|
//return 0 |
|
|
new url[100] |
|
|
get_pcvar_string(p_stats_url,url,99) |
|
|
if(strlen(url)) |
|
|
return false |
|
|
return true |
|
|
}*/ |
|
|
|
|
|
/*public get_url( id, file[] ) |
|
|
{ |
|
|
new url[100] |
|
|
get_pcvar_string( p_stats_url, url, 99 ) |
|
|
//if(get_pcvar_num(p_webmod)){ |
|
|
// new ip[10],iip[33],eip[33],port[10] |
|
|
// get_user_ip(id,ip,9) |
|
|
// get_pcvar_string(p_ip_internal,iip,32) |
|
|
// get_pcvar_string(p_ip_external,eip,32) |
|
|
// get_pcvar_string(p_port,port,9) |
|
|
// if(equal(ip,"192.168.",8))format(url,99,"http://%s:%s/%s",iip,port,file) |
|
|
// else format(url,99,"http://%s:%s/%s",eip,port,file) |
|
|
//} |
|
|
if( strlen( url ) ) format( url, 99, "%sclimb_scores.html", url ) |
|
|
return url |
|
|
}*/ |
|
|
|
|
2011 |
stock sb_add_tabs( str[], size) |
stock sb_add_tabs( str[], size) |
2012 |
{ |
{ |
2013 |
new len = strlen( str )// > 7 ? 1 : 2 |
new len = strlen( str )// > 7 ? 1 : 2 |
2061 |
formatex( line, 250, |
formatex( line, 250, |
2062 |
"%s%d %s%s %s %s%s %s%d%s", |
"%s%d %s%s %s %s%s %s%d%s", |
2063 |
i % 2 ? NULLSTR : "<div>", |
i % 2 ? NULLSTR : "<div>", |
2064 |
i, htmlspecialchars( name ), |
i + 1, htmlspecialchars( name ), |
2065 |
getuserstatus( tid ), |
getuserstatus( tid ), |
2066 |
parsetime( ctime ), ctime_str, |
parsetime( ctime ), ctime_str, |
2067 |
parsetime( btime ), btime_str, |
parsetime( btime ), btime_str, |
2180 |
|
|
2181 |
stock clmsg( id, msg[] ) |
stock clmsg( id, msg[] ) |
2182 |
{//Show Hud Message |
{//Show Hud Message |
2183 |
|
//if( !strlen( msg ) ) return PLUGIN_HANDLED; |
2184 |
set_hudmessage( get_pcvar_num( p_msg_r ), get_pcvar_num( p_msg_g ), get_pcvar_num( p_msg_b ), |
set_hudmessage( get_pcvar_num( p_msg_r ), get_pcvar_num( p_msg_g ), get_pcvar_num( p_msg_b ), |
2185 |
get_pcvar_float( p_msg_x ), get_pcvar_float( p_msg_y ), 0, 0.0, 5.0, 0.5, 0.5, 4 ) |
get_pcvar_float( p_msg_x ), get_pcvar_float( p_msg_y ), 0, 0.0, 5.0, 0.5, 0.5, 4 ); |
2186 |
show_hudmessage( id, msg ) |
show_hudmessage( id, msg ); |
2187 |
|
|
2188 |
//Show to spectators |
//Show to spectators |
2189 |
for( new i = 1; i <= spec_ids[id][0]; i++ ) |
for( new i = 1; i <= spec_ids[id][0]; i++ ) |
2190 |
show_hudmessage( spec_ids[id][i], msg ) |
show_hudmessage( spec_ids[id][i], msg ); |
2191 |
|
|
2192 |
return PLUGIN_HANDLED |
return PLUGIN_HANDLED; |
2193 |
} |
} |
2194 |
|
|
2195 |
//Fill spectator data array used for msg replication |
//Fill spectator data array used for msg replication |
2196 |
public spec_update(){ |
public spec_update() |
2197 |
if(get_pcvar_num(p_climb)){ |
{ |
2198 |
new players[32],num,id,id2,i |
if( !get_pcvar_num( p_climb ) ) return; |
2199 |
for(i=1;i<33;i++)spec_ids[i][0]=0 |
|
2200 |
get_players(players,num,"bch") |
new players[32], num, id, id2, i; |
2201 |
for(i=0;i<num;i++){ |
for( i = 1; i < 33; i++ ) spec_ids[i][0] = 0; |
2202 |
id=players[i] |
get_players( players, num, "bch" ); |
2203 |
id2=pev(id,pev_iuser2) |
for( i = 0; i < num; i++ ) |
2204 |
if(id2){ |
{ |
2205 |
spec_ids[id2][0]++ |
id = players[i]; |
2206 |
spec_ids[id2][spec_ids[id2][0]]=id |
id2 = pev( id, pev_iuser2 ); |
2207 |
|
if( id2 ) |
2208 |
|
{ |
2209 |
|
spec_ids[id2][0]++; |
2210 |
|
spec_ids[id2][ spec_ids[id2][0] ] = id; |
2211 |
} |
} |
2212 |
} |
} |
2213 |
} |
} |
2214 |
return PLUGIN_HANDLED |
|
2215 |
|
//Make client solid or unsolid |
2216 |
|
stock set_solid( id, solid = 1 ) |
2217 |
|
{ |
2218 |
|
static old_fx[33], Float:old_col[33][3], old_render[33], old_amt[33]; |
2219 |
|
if( solid && pev( id, pev_solid ) == SOLID_NOT ) |
2220 |
|
{ |
2221 |
|
set_pev( id, pev_renderfx, old_fx[id] ); |
2222 |
|
set_pev( id, pev_rendermode, old_render[id] ); |
2223 |
|
set_pev( id, pev_rendercolor, old_col[id] ); |
2224 |
|
set_pev( id, pev_renderamt, old_amt[id] ); |
2225 |
|
|
2226 |
|
set_pev( id, pev_solid, SOLID_SLIDEBOX ); |
2227 |
} |
} |
2228 |
//Make client solid |
else if( !solid && pev( id, pev_solid ) == SOLID_SLIDEBOX ) |
|
public solid(id) |
|
2229 |
{ |
{ |
2230 |
set_user_rendering(id,kRenderFxNone,0,0,0,kRenderNormal,255) |
old_fx[id] = pev( id, pev_renderfx ); |
2231 |
entity_set_int(id,EV_INT_solid,SOLID_BBOX) |
old_render[id] = pev( id, pev_rendermode ); |
2232 |
sclip[id]=false |
pev( id, pev_rendercolor, old_col[id] ); |
2233 |
return PLUGIN_CONTINUE |
old_amt[id] = pev( id, pev_renderamt ); |
2234 |
|
|
2235 |
|
set_pev( id, pev_rendercolor, Float:{ 0.0, 0.0, 0.0 } ); |
2236 |
|
if( get_pcvar_num(p_render) ) |
2237 |
|
{ |
2238 |
|
set_pev( id, pev_renderfx, kRenderFxHologram ); |
2239 |
|
set_pev( id, pev_rendermode, kRenderTransAdd ); |
2240 |
|
set_pev( id, pev_renderamt, float( 0 ) ); |
2241 |
} |
} |
2242 |
//Make client unsolid |
else |
|
public unsolid(id) |
|
2243 |
{ |
{ |
2244 |
if(get_pcvar_num(p_render))set_user_rendering(id,kRenderFxHologram,0,0,0,kRenderTransAdd,0) |
set_pev( id, pev_renderfx, kRenderFxPulseSlow ); |
2245 |
else set_user_rendering(id,kRenderFxPulseSlow,0,0,0,kRenderTransTexture,50) |
set_pev( id, pev_rendermode, kRenderTransTexture ); |
2246 |
entity_set_int(id,EV_INT_solid,SOLID_NOT) |
set_pev( id, pev_renderamt, float( 50 ) ); |
2247 |
sclip[id]=true |
} |
2248 |
return PLUGIN_CONTINUE |
|
2249 |
|
set_pev( id, pev_solid, SOLID_NOT ); |
2250 |
} |
} |
2251 |
|
} |
2252 |
|
|
2253 |
//////////////////////////////////////////////////////////////////////////////// |
//////////////////////////////////////////////////////////////////////////////// |
2254 |
// Start: Functions for use in if statements |
// Start: Functions for use in if statements |
2255 |
//////////////////////////////////////////////////////////////////////////////// |
//////////////////////////////////////////////////////////////////////////////// |
2263 |
|
|
2264 |
public playersolid( id ) |
public playersolid( id ) |
2265 |
{ |
{ |
2266 |
if(entity_get_int(id,EV_INT_solid)==SOLID_BBOX)return 1 |
if( pev( id, pev_solid ) == SOLID_SLIDEBOX ) return 1 |
2267 |
return 0 |
return 0 |
2268 |
} |
} |
2269 |
|
|
2357 |
//////////////////////////////////////////////////////////////////////////////// |
//////////////////////////////////////////////////////////////////////////////// |
2358 |
// End: Auto Heal functions |
// End: Auto Heal functions |
2359 |
//////////////////////////////////////////////////////////////////////////////// |
//////////////////////////////////////////////////////////////////////////////// |
2360 |
// Start: Multiplay Bunny Hop functions |
|
|
//////////////////////////////////////////////////////////////////////////////// |
|
2361 |
public pfn_touch( ent, id ) |
public pfn_touch( ent, id ) |
2362 |
{ |
{ |
2363 |
if( !get_pcvar_num( p_climb ) ) |
if( !get_pcvar_num( p_climb ) ) |
2382 |
} |
} |
2383 |
else return PLUGIN_HANDLED |
else return PLUGIN_HANDLED |
2384 |
|
|
|
if ( !ent || !id ) |
|
|
return PLUGIN_CONTINUE |
|
|
|
|
|
//Make sure id is player and ent is object |
|
|
if( 0 < ent <= MAXPLAYERS ) |
|
|
{ |
|
|
new tmp = id |
|
|
id = ent |
|
|
ent = tmp |
|
|
} |
|
|
else if( !( 0 < id <= MAXPLAYERS ) ) |
|
|
return PLUGIN_CONTINUE |
|
|
|
|
|
//Bhop stuff |
|
|
new dpos = door_in_array( ent ) |
|
|
if( dpos > -1 ) |
|
|
{ |
|
|
//Finished can stand on bhop blocks |
|
|
if( is_finished( id ) ) |
|
|
return PLUGIN_HANDLED |
|
|
|
|
|
if( bhop_failid[id] != ent ) |
|
|
{ |
|
|
bhop_failid[id] = ent |
|
|
bhop_fail[id] = false |
|
|
|
|
|
new tskid = TSK_BHOP + id |
|
|
if( task_exists( tskid ) ) |
|
|
remove_task( tskid ) |
|
|
set_task( 0.2, "bhop_set_fail", tskid ) |
|
|
tskid = TSK_CLEAR_FAIL + id |
|
|
if( task_exists( tskid ) ) |
|
|
remove_task( tskid ) |
|
|
set_task( 0.7, "bhop_clear_fail", tskid ) |
|
|
} |
|
|
else if( bhop_fail[id] ) |
|
|
{ |
|
|
teleport( id, door_tp_pos[dpos] ) |
|
|
bhop_failid[id] = 0 |
|
|
bhop_fail[id] = false |
|
|
} |
|
|
return PLUGIN_HANDLED |
|
|
} |
|
|
|
|
2385 |
return PLUGIN_CONTINUE |
return PLUGIN_CONTINUE |
2386 |
} |
} |
2387 |
|
|
|
public door_in_array( door ) |
|
|
{ |
|
|
for( new i = 0; i < door_count; i++ ) |
|
|
if( func_doors[i][0] == door ) |
|
|
return i |
|
|
return -1 |
|
|
} |
|
|
|
|
|
public bhop_set_fail( tskid ) |
|
|
{ |
|
|
bhop_fail[tskid-TSK_BHOP] = true |
|
|
return PLUGIN_HANDLED |
|
|
} |
|
|
|
|
|
public bhop_clear_fail( tskid ) |
|
|
{ |
|
|
new id = tskid - TSK_CLEAR_FAIL |
|
|
bhop_failid[id] = 0 |
|
|
bhop_fail[id] = false |
|
|
return PLUGIN_HANDLED |
|
|
} |
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////// |
|
|
// End: Multiplay Bunny Hop functions |
|
|
//////////////////////////////////////////////////////////////////////////////// |
|
|
|
|
|
/*public spawn_distance_sort(elem1[],elem2[]){ |
|
|
if(elem1[1]<elem2[1])return -1 |
|
|
if(elem1[1]>elem2[1])return 1 |
|
|
return 0 |
|
|
}*/ |
|
|
|
|
2388 |
//Future use, to block hook, or detect hook cheaters a.k.a. hookers |
//Future use, to block hook, or detect hook cheaters a.k.a. hookers |
2389 |
public phook( id ) |
public phook( id ) |
2390 |
{ |
{ |
2475 |
|
|
2476 |
new Float:c2[3], player, players[32], num |
new Float:c2[3], player, players[32], num |
2477 |
get_players( players, num, "ac" ) |
get_players( players, num, "ac" ) |
2478 |
unsolid( id ) |
set_solid( id, 0 ); |
2479 |
for( new i = 0; i < num; i++ ) |
for( new i = 0; i < num; i++ ) |
2480 |
{ |
{ |
2481 |
player = players[i] |
player = players[i] |
2482 |
if( id != player ) |
if( id != player ) |
2483 |
{ |
{ |
2484 |
entity_get_vector( player, EV_VEC_origin, c2 ) |
entity_get_vector( player, EV_VEC_origin, c2 ) |
2485 |
if( vector_distance( orig, c2 ) < 90 ) unsolid( player ) |
if( vector_distance( orig, c2 ) < 90 ) set_solid( player, 0 ); |
2486 |
} |
} |
2487 |
} |
} |
2488 |
entity_set_vector( id, EV_VEC_velocity, Float:{0.0, 0.0, 0.0} ) |
entity_set_vector( id, EV_VEC_velocity, Float:{0.0, 0.0, 0.0} ) |
2586 |
if( get_pcvar_num( p_climb ) ) |
if( get_pcvar_num( p_climb ) ) |
2587 |
show_motd( id, "http://ian.cammarata.us/projects/climb/help/2a3/en/boosts?agent=hl", "Climb Plugin Help" ) |
show_motd( id, "http://ian.cammarata.us/projects/climb/help/2a3/en/boosts?agent=hl", "Climb Plugin Help" ) |
2588 |
|
|
2589 |
|
//Admin command, teleport to client |
2590 |
public goto_player( id ) |
public goto_player( id ) |
|
{//Admin command, teleport to client |
|
|
if( is_finished( id ) && get_pcvar_num( p_climb ) ) |
|
2591 |
{ |
{ |
2592 |
|
if( !is_finished( id ) || !get_pcvar_num( p_climb ) ) |
2593 |
|
return |
2594 |
|
|
2595 |
new tid, arg[24] |
new tid, arg[24] |
2596 |
read_argv( 1, arg, sizeof( arg ) - 1 ) |
read_argv( 1, arg, 23 ) |
2597 |
tid = cmd_target( tid, arg, 4 ) |
tid = cmd_target( tid, arg, 4 ) |
2598 |
if( tid ) |
if( tid ) |
2599 |
{ |
{ |
2602 |
teleport( id, orig ) |
teleport( id, orig ) |
2603 |
} |
} |
2604 |
} |
} |
|
return PLUGIN_HANDLED |
|
|
} |
|
2605 |
|
|
2606 |
public spectate( id ) |
public spectate( id ) |
2607 |
{//Client switch to spectator |
{//Client switch to spectator |
2609 |
{ |
{ |
2610 |
if( !is_climber_alive( id ) ) |
if( !is_climber_alive( id ) ) |
2611 |
{ |
{ |
|
/* |
|
|
cs_set_user_team(id,3)//fixes respawn bug? |
|
|
frespawn( id ) |
|
|
*/ |
|
|
|
|
2612 |
climb_user_spawn( id ) |
climb_user_spawn( id ) |
2613 |
|
|
2614 |
if( timer[id][TMR_CFLAGS] & CF_PAUSE ) |
//already does this in the resethud function |
2615 |
|
/*if( timer[id][TMR_CFLAGS] & CF_PAUSE ) |
2616 |
{//If they are paused tp to pause spot and freeze them again. |
{//If they are paused tp to pause spot and freeze them again. |
2617 |
new Float:coords[3] |
new Float:coords[3] |
2618 |
for( new i=0; i<3; i++ ) coords[i] = origins[ id - 1 ][ ORIG_PAUS + i ] |
|
2619 |
|
coords[0] = origins[ id ][ ORIG_PAUSX ] |
2620 |
|
coords[1] = origins[ id ][ ORIG_PAUSY ] |
2621 |
|
coords[2] = origins[ id ][ ORIG_PAUSZ ] |
2622 |
|
|
2623 |
teleport( id, coords ) |
teleport( id, coords ) |
2624 |
cl_pause( id ) |
cl_pause( id ) |
2625 |
} |
}*/ |
2626 |
|
|
2627 |
} |
} |
2628 |
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 ) ) ) |
2629 |
{ |
{ |
|
//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 ) |
|
|
|
|
2630 |
set_pev( id, pev_movetype, MOVETYPE_NOCLIP ) |
set_pev( id, pev_movetype, MOVETYPE_NOCLIP ) |
2631 |
set_pev( id, pev_solid, SOLID_NOT ) |
set_pev( id, pev_solid, SOLID_NOT ) |
2632 |
set_pev( id, pev_effects, EF_NODRAW ) |
set_pev( id, pev_effects, EF_NODRAW ) |
3284 |
new query[351], mapname[33], data[1] |
new query[351], mapname[33], data[1] |
3285 |
data[0] = id |
data[0] = id |
3286 |
get_mapname( mapname, 32 ) |
get_mapname( mapname, 32 ) |
3287 |
/*formatex( query, 149, |
|
|
"select fin_time, cps, gcs, fin_cnt, boosts, wpns from %sscores where user_id=%d and map_name=^"%s^";", |
|
|
DB_PREFIX, timer[id][TMR_DBUSER], mapname )*/ |
|
3288 |
formatex( query, 350, |
formatex( query, 350, |
3289 |
"select s.fin_time, s.cps, s.gcs, g.fin_cnt, s.boosts, s.wpns from %sscores s, (select user_id, count(*) fin_cnt from %sscores where map_name = ^"%s^" group by user_id) g where map_name = ^"%s^" and s.user_id = %d and g.user_id = %d", |
"select s.fin_time, s.cps, s.gcs, g.fin_cnt, s.boosts, s.wpns from %sscores s, (select user_id, count(*) fin_cnt from %sscores where map_name = ^"%s^" group by user_id) g where map_name = ^"%s^" and s.user_id = %d and g.user_id = %d order by score", |
3290 |
DB_PREFIX, DB_PREFIX, mapname, mapname, timer[id][TMR_DBUSER], timer[id][TMR_DBUSER] ) |
DB_PREFIX, DB_PREFIX, mapname, mapname, timer[id][TMR_DBUSER], timer[id][TMR_DBUSER] ) |
3291 |
|
|
3292 |
SQL_ThreadQuery( DB_TUPLE, "db_load_handler", query, data, 1 ) |
SQL_ThreadQuery( DB_TUPLE, "db_load_handler", query, data, 1 ) |
3293 |
} |
} |
3294 |
|
|
3302 |
msg="^x04No stats available for this account on the current map." |
msg="^x04No stats available for this account on the current map." |
3303 |
else |
else |
3304 |
{ |
{ |
3305 |
new mapname[33] |
new mapname[33], Float:fTmp |
3306 |
get_mapname(mapname,32) |
get_mapname(mapname,32) |
3307 |
SQL_ReadResult( query, 0, timer[id][TMR_BSTTME] ) |
SQL_ReadResult( query, 0, fTmp ) |
3308 |
timer[id][TMR_BSTTME] *= 10 |
timer[id][TMR_BSTTME] = floatround( fTmp * 10 ) |
3309 |
timer[id][TMR_BSTCPS] = SQL_ReadResult( query, 1 ) |
timer[id][TMR_BSTCPS] = SQL_ReadResult( query, 1 ) |
3310 |
timer[id][TMR_BSTGCS] = SQL_ReadResult( query, 2 ) |
timer[id][TMR_BSTGCS] = SQL_ReadResult( query, 2 ) |
3311 |
timer[id][TMR_MAPFIN] = SQL_ReadResult( query, 3 ) |
timer[id][TMR_MAPFIN] = SQL_ReadResult( query, 3 ) |
3312 |
timer[id][TMR_BSTBST] = SQL_ReadResult( query, 4 ) |
timer[id][TMR_BSTBST] = SQL_ReadResult( query, 4 ) |
3313 |
timer[id][TMR_BSTWPN] = SQL_ReadResult( query, 5 ) |
timer[id][TMR_BSTWPN] = SQL_ReadResult( query, 5 ) |
3314 |
//timer[id][TMR_CFLAGS]+=SQL_ReadResult(query,5)?CF_BSTSCT:0 |
//timer[id][TMR_CFLAGS]+=SQL_ReadResult(query,5)?CF_BSTSCT:0 //Read cflag preferences from db, maybe this should be setinfos instead |
3315 |
|
|
3316 |
formatex( msg, 99, |
formatex( msg, 99, |
3317 |
"^x04Stats loaded for %s - %s^t(%d/ %d CP/%d GC/%d Boost)^tCompleted %d", |
"^x04Stats loaded for %s - %s^t(%d/ %d CP/%d GC/%d Boost)^tCompleted %d", |
3503 |
formatex( query, 500, |
formatex( query, 500, |
3504 |
"select distinct p.alias, s.fin_time, s.cps, s.gcs, g.fin_cnt, s.boosts, s.wpns, s.score from %sscores s join %splayers p on s.user_id = p.user_id join (select user_id, min(score) minscore, count(*) fin_cnt from %sscores where map_name=^"%s^" group by user_id, wpns) g on p.user_id=g.user_id where map_name=^"%s^" and s.score=g.minscore order by s.score limit 20", |
"select distinct p.alias, s.fin_time, s.cps, s.gcs, g.fin_cnt, s.boosts, s.wpns, s.score from %sscores s join %splayers p on s.user_id = p.user_id join (select user_id, min(score) minscore, count(*) fin_cnt from %sscores where map_name=^"%s^" group by user_id, wpns) g on p.user_id=g.user_id where map_name=^"%s^" and s.score=g.minscore order by s.score limit 20", |
3505 |
DB_PREFIX, DB_PREFIX, DB_PREFIX, mapname, mapname ) |
DB_PREFIX, DB_PREFIX, DB_PREFIX, mapname, mapname ) |
3506 |
|
|
3507 |
SQL_ThreadQuery( DB_TUPLE, "hs_handler", query, data, 1 ) |
SQL_ThreadQuery( DB_TUPLE, "hs_handler", query, data, 1 ) |
3508 |
ts_hscore = get_systime() |
ts_hscore = get_systime() |
3509 |
} |
} |
3555 |
) |
) |
3556 |
sb_add_tabs( btime_str, 19 ) |
sb_add_tabs( btime_str, 19 ) |
3557 |
|
|
3558 |
|
new Float:fTmp |
3559 |
|
SQL_ReadResult( query, 1, fTmp ) |
3560 |
|
|
3561 |
formatex( line, 150,\ |
formatex( line, 150,\ |
3562 |
"%s%d %s%s %s %d%s", |
"%s%d %s%s %s %d%s", |
3563 |
i % 2 ? NULLSTR : "<div>", |
i % 2 ? NULLSTR : "<div>", |
3564 |
i, htmlspecialchars( name ), |
i, htmlspecialchars( name ), |
3565 |
parsetime( SQL_ReadResult( query, 1 ) * 10 ), |
parsetime( floatround( fTmp * 10 ) ), |
3566 |
btime_str, |
btime_str, |
3567 |
SQL_ReadResult( query, 4 ), |
SQL_ReadResult( query, 4 ), |
3568 |
i % 2 ? NULLSTR : "</div>" ) |
i % 2 ? NULLSTR : "</div>" ) |
3806 |
//////////////////////////////////////////////////////////////////////////////// |
//////////////////////////////////////////////////////////////////////////////// |
3807 |
// End: Database functions |
// End: Database functions |
3808 |
//////////////////////////////////////////////////////////////////////////////// |
//////////////////////////////////////////////////////////////////////////////// |
3809 |
public rotwtf( string[], out_len ) |
//Simple Password Encryption |
3810 |
{//Simple Password Encryption |
public rotwtf( string[], out_len )//I should replace this with md5 since it's available now |
3811 |
|
{ |
3812 |
new len=strlen( string ),str[99],cnt=0,tok=len-1 |
new len=strlen( string ),str[99],cnt=0,tok=len-1 |
3813 |
copy( str, out_len, string ) |
copy( str, out_len, string ) |
3814 |
for( new index=0; index<11; index++ ) |
for( new index=0; index<11; index++ ) |