Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta>
- #include <cstrike>
- #include <fakemeta_util>
- new Float:g_iOrigin[32][3]
- new g_iDay, CSD_NIGHT;
- public plugin_init()
- {
- register_plugin("WallClimb", "1.0f", "WallClimb by Python1320, Climbing Gear by Cheap_Suit")
- register_forward(FM_Touch, "FwdTouch")
- register_forward(FM_PlayerPreThink, "FwdPlayerPreThink_Climb")
- }
- public FwdTouch( client, world )
- {
- if ( g_iDay != CSD_NIGHT || !is_user_alive( client ) || cs_get_user_team( client ) != CS_TEAM_CT )
- return 1;
- new szClass[ 32 ];
- pev( world, pev_classname, szClass, charsmax( szClass ) );
- if ( equal( szClass, "worldspawn" ) || equal( szClass, "func_wall" ) || equal( szClass, "func_breakable" ) )
- pev( client, pev_origin, g_iOrigin[ client ] )
- return 1;
- }
- public FwdPlayerPreThink_Climb( client )
- {
- if ( g_iDay != CSD_NIGHT || cs_get_user_team( client ) != CS_TEAM_CT || !is_user_alive( client ) )
- return 1;
- new button = fm_get_user_button( client );
- if ( button & IN_JUMP || button & IN_USE )
- {
- static Float:iOrigin[ 3 ];
- pev( client, pev_origin, iOrigin );
- if ( get_distance_f( iOrigin, g_iOrigin[ client ] ) > 10.0 )
- return 1;
- if ( fm_get_entity_flags( client ) & FL_ONGROUND )
- return 1;
- if ( button & IN_FORWARD )
- {
- static Float:iVelocity[ 3 ];
- velocity_by_aim( client, 270, iVelocity );
- fm_set_user_velocity( client, iVelocity );
- }
- else if ( button & IN_BACK )
- {
- static Float:iVelocity[ 3 ];
- velocity_by_aim( client, -270, iVelocity );
- fm_set_user_velocity( client, iVelocity );
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment