--- climb.sma 2008/01/21 06:14:04 37 +++ climb.sma 2008/02/18 12:15:29 38 @@ -269,7 +269,7 @@ #include #include -new const VERSION[ ] = "a3.7.5 Jan 20 23:00 MST" +new const VERSION[ ] = "a3.7.6 Feb 18 05:11 MST" new const TRKCVAR[ ] = "climb_version" new const DONOTHING[ ] = "donothing" @@ -300,10 +300,10 @@ #define ORIGINS_SIZE 48 new Float:origins[33][ORIGINS_SIZE] #define ORIG_UNGC 40 -#define ORIG_PAUS 44 -//#define ORIG_X 0 -//#define ORIG_Y 1 -//#define ORIG_Z 2 +#define ORIG_PAUSX 44 +#define ORIG_PAUSY 45 +#define ORIG_PAUSZ 46 +#define ORIG_PAUSG 47 #define ORIG_GRAV 3 new time_stamps[33][5]//time_stamps[id][x] @@ -392,7 +392,7 @@ #define DJUMP 2 #define SJUMP 4 -new SVC_STATUSICON, SVC_TEAMINFO, SVC_ROUNDTIME, SVC_FLASHLIGHT, SVC_SCREENFADE +new SVC_STATUSICON, SVC_TEAMINFO, SVC_ROUNDTIME, SVC_FLASHLIGHT, SVC_SCREENFADE, SVC_CLCORPSE; new SCORES_PATH[100], HSCORES_PATH[100] @@ -421,57 +421,58 @@ register_cvar( "climb_db_serverid", NULLSTR ) register_cvar( "climb_db_exists", "0" ) - p_msg_r = register_cvar( "climb_msg_r", "0" ) - p_msg_g = register_cvar( "climb_msg_g", "150" ) - p_msg_b = register_cvar( "climb_msg_b", "250" ) - p_msg_x = register_cvar( "climb_msg_x", "0.05" ) - p_msg_y = register_cvar( "climb_msg_y", "0.5" ) - - p_light_r = register_cvar( "climb_light_r", "255" ) - p_light_g = register_cvar( "climb_light_g", "255" ) - p_light_b = register_cvar( "climb_light_b", "255" ) - - p_sounds = register_cvar( "climb_sounds", "1" ) - p_render = register_cvar( "climb_unsolid_type", "0" ) - p_start_respawn = register_cvar( "climb_start_respawn", "0" ) - p_water_nodraw = register_cvar( "climb_water_nodraw", "0" ) - - p_stats_hsurl = register_cvar( "climb_stats_hsurl", NULLSTR ) //Use %s in place of map name - p_stats_msg = register_cvar( "climb_stats_msg", NULLSTR ) - - p_allow_spectators = get_cvar_pointer( "allow_spectators" ) - p_teambalance = get_cvar_pointer( "mp_autoteambalance" ) - p_limitteams = get_cvar_pointer( "mp_limitteams" ) + p_msg_r = register_cvar( "climb_msg_r", "0" ); + p_msg_g = register_cvar( "climb_msg_g", "150" ); + p_msg_b = register_cvar( "climb_msg_b", "250" ); + p_msg_x = register_cvar( "climb_msg_x", "0.05" ); + p_msg_y = register_cvar( "climb_msg_y", "0.5" ); + + p_light_r = register_cvar( "climb_light_r", "255" ); + p_light_g = register_cvar( "climb_light_g", "255" ); + p_light_b = register_cvar( "climb_light_b", "255" ); + + p_sounds = register_cvar( "climb_sounds", "1" ); + p_render = register_cvar( "climb_unsolid_type", "0" ); + p_start_respawn = register_cvar( "climb_start_respawn", "0" ); + p_water_nodraw = register_cvar( "climb_water_nodraw", "0" ); + + p_stats_hsurl = register_cvar( "climb_stats_hsurl", NULLSTR ); //Use %s in place of map name + p_stats_msg = register_cvar( "climb_stats_msg", NULLSTR ); + + p_allow_spectators = get_cvar_pointer( "allow_spectators" ); + p_teambalance = get_cvar_pointer( "mp_autoteambalance" ); + p_limitteams = get_cvar_pointer( "mp_limitteams" ); - MAXPLAYERS = get_maxplayers( ) + MAXPLAYERS = get_maxplayers( ); - TEAM_BALANCE_OLD = get_pcvar_num( p_teambalance ) - LIMIT_TEAMS_OLD = get_pcvar_num( p_limitteams ) + TEAM_BALANCE_OLD = get_pcvar_num( p_teambalance ); + LIMIT_TEAMS_OLD = get_pcvar_num( p_limitteams ); //Message Pseudo-Constants - SVC_STATUSICON = get_user_msgid( "StatusIcon" ) - SVC_TEAMINFO = get_user_msgid( "TeamInfo" ) - SVC_ROUNDTIME = get_user_msgid( "RoundTime" ) - SVC_FLASHLIGHT = get_user_msgid( "Flashlight" ) - SVC_SCREENFADE = get_user_msgid( "ScreenFade" ) + SVC_STATUSICON = get_user_msgid( "StatusIcon" ); + SVC_TEAMINFO = get_user_msgid( "TeamInfo" ); + SVC_ROUNDTIME = get_user_msgid( "RoundTime" ); + SVC_FLASHLIGHT = get_user_msgid( "Flashlight" ); + SVC_SCREENFADE = get_user_msgid( "ScreenFade" ); + SVC_CLCORPSE = get_user_msgid( "ClCorpse" ); //These commands get blocked always. - register_clcmd( "fullupdate", "block_cmd2" ) + register_clcmd( "fullupdate", "block_cmd2" ); //These commands get blocked when climb is enabled. - register_clcmd( "chooseteam", "spectate" ) - register_clcmd( "buy", "block_cmd" ) - register_clcmd( "buyammo1", "block_cmd" ) - register_clcmd( "buyammo2", "block_cmd" ) - register_clcmd( "buyequip", "block_cmd" ) + register_clcmd( "chooseteam", "spectate" ); + register_clcmd( "buy", "block_cmd" ); + register_clcmd( "buyammo1", "block_cmd" ); + register_clcmd( "buyammo2", "block_cmd" ); + register_clcmd( "buyequip", "block_cmd" ); - register_clcmd( "jointeam", "block_jointeam" ) + register_clcmd( "jointeam", "block_jointeam" ); //Commands to detect cheats. - register_clcmd( "+hook", "phook" ) - register_clcmd( "+rope", "phook" ) - register_clcmd( "-hook", "mhook" ) - register_clcmd( "-rope", "mhook" ) + register_clcmd( "+hook", "phook" ); + register_clcmd( "+rope", "phook" ); + register_clcmd( "-hook", "mhook" ); + register_clcmd( "-rope", "mhook" ); //Commands referencing function 'donothing' are picked up by the more flexible code in the client_command forward. register_clcmd( "say help", "help_msg" ) @@ -673,17 +674,6 @@ } } - //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" ) - } - }*/ - //Remove map built in start button sounds ent = find_ent_by_class( -1, "ambient_generic" ) while( ent > 0 ) @@ -925,7 +915,9 @@ //Do gocheck new cppos = timer[id][TMR_CPPOS] * 4 - for( new i=0; i<3; i++ ) coords[i] = origins[id][cppos + i] + coords[0] = origins[id][cppos] + coords[1] = origins[id][cppos + 1] + coords[2] = origins[id][cppos + 2] entity_set_float( id, EV_FL_gravity, origins[id][3] ) teleport( id, coords ) @@ -1044,7 +1036,7 @@ cflags_new += CF_START set_entity_flags( id, FL_FROZEN, 0 ) //set_solid( id, 0 ); - entity_set_float( id, EV_FL_gravity, origins[id][ORIG_PAUS + ORIG_GRAV] ) + entity_set_float( id, EV_FL_gravity, origins[id][ORIG_PAUSG] ) clmsg( id, "UNPAUSED" ) sfexec( id, 2 ) } @@ -1310,40 +1302,45 @@ {//Spawned if( !get_pcvar_num( p_climb ) ) { - set_msg_block( SVC_STATUSICON, 0 ) - return + set_msg_block( SVC_STATUSICON, BLOCK_NOT ); + set_msg_block( SVC_CLCORPSE, BLOCK_NOT ); + return; } - if( !is_user_bot( id ) && !is_user_hltv( id ) ) - return + if( is_user_bot( id ) || is_user_hltv( id ) ) return; + + flight_icons( id ); //redraw flashlight hud icons + set_msg_block( SVC_STATUSICON, BLOCK_SET ); //Block buy menu + set_msg_block( SVC_CLCORPSE, BLOCK_SET ); //block client corpses - flight_icons( id )//redraw flashlight hud icons - set_msg_block( SVC_STATUSICON, 2 )//Block buy menu + flight_icons( id ); //redraw flashlight hud icons if( is_climber_alive( id ) ) { - heal( id ) + heal( id ); //Execute commands from start/finish config - sfexec( id, 1 ) + sfexec( id, 1 ); //Show admin as VIP on Scoreboard. - if( get_user_flags( id ) & VIP ) cs_set_user_scoreattrib( id, 4 ) + if( get_user_flags( id ) & VIP ) cs_set_user_scoreattrib( id, 4 ); + + new cppos = timer[id][TMR_CPPOS] * 4; //If they are paused tp to pause spot and freeze them again. if( timer[id][TMR_CFLAGS] & CF_PAUSE ) { - new Float:coords[3] - coords[0] = origins[ id ][ ORIG_PAUS + 0 ] - coords[1] = origins[ id ][ ORIG_PAUS + 1 ] - coords[2] = origins[ id ][ ORIG_PAUS + 2 ] - teleport( id, coords ) - cl_pause( id ) + new Float:coords[3]; + coords[0] = origins[ id ][ ORIG_PAUSX ]; + coords[1] = origins[ id ][ ORIG_PAUSY ]; + coords[2] = origins[ id ][ ORIG_PAUSZ ]; + teleport( id, coords ); + cl_pause( id ); } - //Teleport to cp, start, or primary spawn position - else if( origins[ id ][ 0 ] || origins[ id ][ 1 ] || origins[ id ][ 2 ]) gocheck( id ) - else if( !teleport( id, start_tp_orig ) ) teleport( id, spawn_tp_orig ) + else if( origins[ id ][ cppos ] || origins[ id ][ cppos+1 ] || origins[ id ][ cppos+2 ] ) gocheck( id ); + else teleport( id, start_tp_orig ); + //else if( !teleport( id, start_tp_orig ) ) teleport( id, spawn_tp_orig ); //no need to tp to spawn_tp_orig, they're already there } sortcssb( ) } @@ -1359,7 +1356,6 @@ if( !get_pcvar_num(p_climb) ) return new id = find_player( "i" ) - //if(0 0 ) { - set_entity_visibility( ent, 0 ) - ent = find_ent_by_class( ent, "func_water" ) + set_entity_visibility( ent, 0 ); + ent = find_ent_by_class( ent, "func_water" ); } - nodraw = true + nodraw = true; } else if( !get_pcvar_num( p_water_nodraw ) && nodraw ) { - new ent = find_ent_by_class( -1, "func_water" ) + new ent = find_ent_by_class( -1, "func_water" ); while( ent > 0 ) { - set_entity_visibility( ent, 1 ) - ent = find_ent_by_class( ent, "func_water" ) + set_entity_visibility( ent, 1 ); + ent = find_ent_by_class( ent, "func_water" ); } - nodraw = false + nodraw = false; } } @@ -1759,10 +1755,10 @@ new Float:coords[3] entity_get_vector( id, EV_VEC_origin, coords ) - origins[id][ORIG_PAUS] = coords[0] - origins[id][ORIG_PAUS+1] = coords[1] - origins[id][ORIG_PAUS+2] = coords[2] - origins[id][ORIG_PAUS+ORIG_GRAV] = entity_get_float( id, EV_FL_gravity ) + origins[id][ORIG_PAUSX] = coords[0] + origins[id][ORIG_PAUSY] = coords[1] + origins[id][ORIG_PAUSZ] = coords[2] + origins[id][ORIG_PAUSG] = entity_get_float( id, EV_FL_gravity ) } return PLUGIN_CONTINUE } @@ -1788,7 +1784,7 @@ //new cflags = timer[id][TMR_CFLAGS] - if( btn_type == 1 )//Start Button + if( btn_type == 1 && !check_timeout( id, time_stamps[id][TS_SPAWN], SPAWN_TIMEOUT ) )//Start Button { new Float:orig[3], bool:need_respawn = true //Float:view[3] if( timer[id][TMR_CFLAGS] & CF_START ) need_respawn = false @@ -2619,9 +2615,9 @@ {//If they are paused tp to pause spot and freeze them again. new Float:coords[3] - coords[0] = origins[ id ][ ORIG_PAUS + 0 ] - coords[1] = origins[ id ][ ORIG_PAUS + 1 ] - coords[2] = origins[ id ][ ORIG_PAUS + 2 ] + coords[0] = origins[ id ][ ORIG_PAUSX ] + coords[1] = origins[ id ][ ORIG_PAUSY ] + coords[2] = origins[ id ][ ORIG_PAUSZ ] teleport( id, coords ) cl_pause( id ) @@ -2630,19 +2626,6 @@ } else if( get_user_flags( id ) & VIP ? 1 : ( cvar_enabled( id, p_allow_spectators ) ) ) { - //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 ) - set_pev( id, pev_movetype, MOVETYPE_NOCLIP ) set_pev( id, pev_solid, SOLID_NOT ) set_pev( id, pev_effects, EF_NODRAW )