Сброс скорости игрока

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
67
Реакции
4
Ошибка
Сброс скорости игрока
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5263 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Oct 27 2019 16:23:31
Built from: https://github.com/alliedmodders/amxmodx/commit/15a14a0
Build ID: 5263:15a14a0
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.693-dev
Build date: 18:20:58 Jan 28 2020 (2117)
Build from: https://github.com/dreamstalker/rehlds/commit/c4cecf5
ReGamedll
ReGameDLL version: 5.17.0.466-dev
Build date: 02:56:24 May 27 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/bffb373
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5263 ini Start ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 3] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 4] ReAPI RUN - reapi_amxx_i386.so v5.14.0.195-dev pl1 ANY Never
[ 5] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[ 6] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[ 7] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[ 8] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[ 9] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[10] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[11] CSX RUN - csx_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
11 plugins, 11 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] WebHS 0.1 kanagava fb_web_online.a running
[ 2] FreshBans 1.3.8b kanagava fresh_bans_138_ running
[ 3] Admin Loader 3.3 neygomon admin_loader.am running
[ 4] Admin Commands 1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 5] Slots Reservation 1.9.0.5263 AMXX Dev Team adminslots.amxx running
[ 6] Menus Front-End 1.9.0.5263 AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.9.0.5263 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.9.0.5263 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0.5263 AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.9.0.5263 AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.9.0.5263 AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.9.0.5263 AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.9.0.5263 AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.9.0.5263 AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.9.0.5263 AMXX Dev Team adminvote.amxx running
[ 16] Team Select 1.6.0 F@nt0M teamselect.amxx running
[ 17] unknown unknown unknown motd_model.amxx running
[ 18] Pause Plugins 1.9.0.5263 AMXX Dev Team pausecfg.amxx running
[ 19] Knife DeathMatch 1.1 Lucky deathmatch.amxx running
[ 20] AFK Protection 2.3 rapara13/Nordic afk.amxx running
[ 21] Spring 1.9 wellasgood spring.amxx running
[ 22] [190] Army Ranks Ultim 19.11.29 SKAJIbnEJIb army_ranks_ulti running
[ 23] [190] Chat RBS 19.12.23 SKAJIbnEJIb chat_rbs.amxx running
[ 24] [190] NewYear RBS 19.12.23 SKAJIbnEJIb newyear_rbs.amx running
[ 25] Stats Configuration 18.05.15 SKAJIbnEJIb & AM statscfg_rbs.am running
[ 26] [183] StatsX RBS 19.08.28 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 27] [183] CsStats MySQL 19.08.27 SKAJIbnEJIb csstats_mysql.a running
[ 28] Spectator Bots 2.1 SISA specbots.amxx running
[ 29] [MG] Sky 1.0 Nickron mg_sky.amxx running
[ 30] Cam Change 1.1 Bl0ck Cam_Change.amxx running
[ 31] Knife Mode 1.0 Exodus Dex_Knive.amxx running
[ 32] [JBI] :: [Hats] 1.0 BlazeBest jbi_hats.amxx running
[ 33] Parachute 1.1 ReHLDS Team parachute.amxx running
33 plugins, 33 running
Автор плагина
xPaw
Версия плагина
1.0
Исходный код
#include < amxmodx >
#include < engine >
#include < fakemeta >
#include < hamsandwich >
#include < fun >

static const BALL_BOUNCE_GROUND[ ] = "kickball/bounce.wav";
static const g_szBallModel[ ] = "models/ball.mdl";
static const g_szBallName[ ] = "ball";

new g_iBall, g_szFile[ 128 ], g_szMapname[ 32 ], g_iButtonsMenu, g_iTrailSprite;
new bool:g_bNeedBall, cSpeed, cDistance;
new Float:g_vOrigin[ 3 ];

public plugin_init( ) {
register_plugin( "Jailbreak | Football", "1.0", "xPaw" );

/* Cvars */
cSpeed = register_cvar("football_speed", "500.0");
cDistance = register_cvar("football_distance", "820");

/* Register Forward */
register_forward(FM_PlayerPreThink, "PlayerPreThink", 0)

/* Current Weapon */
register_event("CurWeapon", "CurWeapon", "be");

RegisterHam( Ham_ObjectCaps, "player", "FwdHamObjectCaps", 1 );
register_logevent( "EventRoundStart", 2, "1=Round_Start" );

register_think( g_szBallName, "FwdThinkBall" );
register_touch( g_szBallName, "player", "FwdTouchPlayer" );

new const szEntity[ ][ ] = {
"worldspawn", "func_wall", "func_door", "func_door_rotating",
"func_wall_toggle", "func_breakable", "func_pushable", "func_train",
"func_illusionary", "func_button", "func_rot_button", "func_rotating"
}

for( new i; i < sizeof szEntity; i++ )
register_touch( g_szBallName, szEntity[ i ], "FwdTouchWorld" );

g_iButtonsMenu = menu_create( "\rСоздание \yМячей", "HandleButtonsMenu" );

menu_additem( g_iButtonsMenu, "\rСоздать\w мяч", "1" );
menu_additem( g_iButtonsMenu, "\rЗагрузить\w мяч", "2" );
menu_additem( g_iButtonsMenu, "\rУдалить\y все\w мячи", "3" );
menu_additem( g_iButtonsMenu, "\rСохранить", "4" );

register_clcmd( "say /ball", "CmdButtonsMenu", ADMIN_CVAR );
register_clcmd( "say /reset", "UpdateBall" );
}
public PlayerPreThink(id) {
if(!is_user_alive(id))
return PLUGIN_CONTINUE;

if( is_valid_ent( g_iBall ) ) {
static iOwner; iOwner = pev( g_iBall, pev_iuser1 );
if( iOwner != id )
set_user_maxspeed(id, 230.0)
}
return PLUGIN_HANDLED;
}
public CurWeapon(id) {
if(!is_user_alive(id))
return PLUGIN_CONTINUE;
if( is_valid_ent( g_iBall ) ) {
static iOwner; iOwner = pev( g_iBall, pev_iuser1 );
if( iOwner == id )
set_user_maxspeed(id, get_pcvar_float(cSpeed))
}
return PLUGIN_HANDLED;
}
public UpdateBall( id ) {
if( !id || get_user_flags( id ) & ADMIN_CVAR ) {
if( is_valid_ent( g_iBall ) ) {
entity_set_vector( g_iBall, EV_VEC_velocity, Float:{ 0.0, 0.0, 0.0 } ); // To be sure ?
entity_set_origin( g_iBall, g_vOrigin );

entity_set_int( g_iBall, EV_INT_movetype, MOVETYPE_BOUNCE );
entity_set_size( g_iBall, Float:{ -15.0, -15.0, 0.0 }, Float:{ 15.0, 15.0, 12.0 } );
entity_set_int( g_iBall, EV_INT_iuser1, 0 );
}
}

return PLUGIN_HANDLED;
}

public plugin_precache( ) {
precache_model( g_szBallModel );
precache_sound( BALL_BOUNCE_GROUND );

g_iTrailSprite = precache_model( "sprites/laserbeam.spr" );

get_mapname( g_szMapname, 31 );
strtolower( g_szMapname );

// File
new szDatadir[ 64 ];
get_localinfo( "amxx_datadir", szDatadir, charsmax( szDatadir ) );

formatex( szDatadir, charsmax( szDatadir ), "%s", szDatadir );

if( !dir_exists( szDatadir ) )
mkdir( szDatadir );

formatex( g_szFile, charsmax( g_szFile ), "%s/ball.ini", szDatadir );

if( !file_exists( g_szFile ) ) {
write_file( g_szFile, "// Ball Spawn Editor", -1 );
write_file( g_szFile, " ", -1 );

return; // We dont need to load file
}

new szData[ 256 ], szMap[ 32 ], szOrigin[ 3 ][ 16 ];
new iFile = fopen( g_szFile, "rt" );

while( !feof( iFile ) ) {
fgets( iFile, szData, charsmax( szData ) );

if( !szData[ 0 ] || szData[ 0 ] == ';' || szData[ 0 ] == ' ' || ( szData[ 0 ] == '/' && szData[ 1 ] == '/' ) )
continue;

parse( szData, szMap, 31, szOrigin[ 0 ], 15, szOrigin[ 1 ], 15, szOrigin[ 2 ], 15 );

if( equal( szMap, g_szMapname ) ) {
new Float:vOrigin[ 3 ];

vOrigin[ 0 ] = str_to_float( szOrigin[ 0 ] );
vOrigin[ 1 ] = str_to_float( szOrigin[ 1 ] );
vOrigin[ 2 ] = str_to_float( szOrigin[ 2 ] );

CreateBall( 0, vOrigin );

g_vOrigin = vOrigin;

break;
}
}

fclose( iFile );
}

public CmdButtonsMenu( id ) {
if( get_user_flags( id ) & ADMIN_CVAR )
menu_display( id, g_iButtonsMenu, 0 );

return PLUGIN_HANDLED;
}

public HandleButtonsMenu( id, iMenu, iItem ) {
if( iItem == MENU_EXIT )
return PLUGIN_HANDLED;

new szKey[ 2 ], _Access, _Callback;
menu_item_getinfo( iMenu, iItem, _Access, szKey, 1, "", 0, _Callback );

new iKey = str_to_num( szKey );

switch( iKey ) {
case 1: {
if( pev_valid( g_iBall ) )
return PLUGIN_CONTINUE;

CreateBall( id );
}
case 2: {
if( is_valid_ent( g_iBall ) ) {
entity_set_vector( g_iBall, EV_VEC_velocity, Float:{ 0.0, 0.0, 0.0 } ); // To be sure ?
entity_set_origin( g_iBall, g_vOrigin );

entity_set_int( g_iBall, EV_INT_movetype, MOVETYPE_BOUNCE );
entity_set_size( g_iBall, Float:{ -15.0, -15.0, 0.0 }, Float:{ 15.0, 15.0, 12.0 } );
entity_set_int( g_iBall, EV_INT_iuser1, 0 );
client_print( id, print_chat, "* Successfully loaded ball!" );
}
}
case 3: {
new iEntity;

while( ( iEntity = find_ent_by_class( iEntity, g_szBallName ) ) > 0 )
remove_entity( iEntity );
client_print( id, print_chat, "* Successfully removed the balls!" );
}
case 4: {
new iBall, iEntity, Float:vOrigin[ 3 ];

while( ( iEntity = find_ent_by_class( iEntity, g_szBallName ) ) > 0 )
iBall = iEntity;

if( iBall > 0 )
entity_get_vector( iBall, EV_VEC_origin, vOrigin );
else
return PLUGIN_HANDLED;

new bool:bFound, iPos, szData[ 32 ], iFile = fopen( g_szFile, "r+" );

if( !iFile )
return PLUGIN_HANDLED;

while( !feof( iFile ) ) {
fgets( iFile, szData, 31 );
parse( szData, szData, 31 );

iPos++;

if( equal( szData, g_szMapname ) ) {
bFound = true;

new szString[ 256 ];
formatex( szString, 255, "%s %f %f %f", g_szMapname, vOrigin[ 0 ], vOrigin[ 1 ], vOrigin[ 2 ] );

write_file( g_szFile, szString, iPos - 1 );

break;
}
}

if( !bFound )
fprintf( iFile, "%s %f %f %f^n", g_szMapname, vOrigin[ 0 ], vOrigin[ 1 ], vOrigin[ 2 ] );

fclose( iFile );

client_print( id, print_chat, "* Successfully saved ball!" );
}
default: return PLUGIN_HANDLED;
}

menu_display( id, g_iButtonsMenu, 0 );

return PLUGIN_HANDLED;
}

public EventRoundStart( ) {
if( !g_bNeedBall )
return;

if( !is_valid_ent( g_iBall ) )
CreateBall( 0, g_vOrigin );
else {
entity_set_vector( g_iBall, EV_VEC_velocity, Float:{ 0.0, 0.0, 0.0 } ); // To be sure ?
entity_set_origin( g_iBall, g_vOrigin );

entity_set_int( g_iBall, EV_INT_solid, SOLID_BBOX );
entity_set_int( g_iBall, EV_INT_movetype, MOVETYPE_BOUNCE );
entity_set_size( g_iBall, Float:{ -15.0, -15.0, 0.0 }, Float:{ 15.0, 15.0, 12.0 } );
entity_set_int( g_iBall, EV_INT_iuser1, 0 );
}
}

public FwdHamObjectCaps( id ) {
if( pev_valid( g_iBall ) && is_user_alive( id ) ) {
static iOwner; iOwner = pev( g_iBall, pev_iuser1 );

if( iOwner == id )
KickBall( id );
}
}

// BALL BRAIN :)
////////////////////////////////////////////////////////////
public FwdThinkBall( iEntity ) {
if( !is_valid_ent( g_iBall ) )
return PLUGIN_HANDLED;

entity_set_float( iEntity, EV_FL_nextthink, halflife_time( ) + 0.05 );

static Float:vOrigin[ 3 ], Float:vBallVelocity[ 3 ];
entity_get_vector( iEntity, EV_VEC_origin, vOrigin );
entity_get_vector( iEntity, EV_VEC_velocity, vBallVelocity );

static iOwner; iOwner = pev( iEntity, pev_iuser1 );
static iSolid; iSolid = pev( iEntity, pev_solid );

// Trail --- >
static Float:flGametime, Float:flLastThink;
flGametime = get_gametime( );

if( flLastThink < flGametime ) {
if( floatround( vector_length( vBallVelocity ) ) > 10 ) {
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_KILLBEAM );
write_short( g_iBall );
message_end( );

message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_BEAMFOLLOW );
write_short( g_iBall );
write_short( g_iTrailSprite );
write_byte( 10 );
write_byte( 10 );
write_byte( 0 );
write_byte( 50 );
write_byte( 255 );
write_byte( 200 );
message_end( );
}

flLastThink = flGametime + 3.0;
}
// Trail --- <

if( iOwner > 0 ) {
static Float:vOwnerOrigin[ 3 ];
entity_get_vector( iOwner, EV_VEC_origin, vOwnerOrigin );

static const Float:vVelocity[ 3 ] = { 1.0, 1.0, 0.0 };

if( !is_user_alive( iOwner ) ) {
entity_set_int( iEntity, EV_INT_iuser1, 0 );

vOwnerOrigin[ 2 ] += 5.0;

entity_set_origin( iEntity, vOwnerOrigin );
entity_set_vector( iEntity, EV_VEC_velocity, vVelocity );

return PLUGIN_CONTINUE;
}

if( iSolid != SOLID_NOT )
set_pev( iEntity, pev_solid, SOLID_NOT );

static Float:vAngles[ 3 ], Float:vReturn[ 3 ];
entity_get_vector( iOwner, EV_VEC_v_angle, vAngles );

vReturn[ 0 ] = ( floatcos( vAngles[ 1 ], degrees ) * 55.0 ) + vOwnerOrigin[ 0 ];
vReturn[ 1 ] = ( floatsin( vAngles[ 1 ], degrees ) * 55.0 ) + vOwnerOrigin[ 1 ];
vReturn[ 2 ] = vOwnerOrigin[ 2 ];
vReturn[ 2 ] -= ( entity_get_int( iOwner, EV_INT_flags ) & FL_DUCKING ) ? 10 : 30;

entity_set_vector( iEntity, EV_VEC_velocity, vVelocity );
entity_set_origin( iEntity, vReturn );
} else {
if( iSolid != SOLID_BBOX )
set_pev( iEntity, pev_solid, SOLID_BBOX );

static Float:flLastVerticalOrigin;

if( vBallVelocity[ 2 ] == 0.0 ) {
static iCounts;

if( flLastVerticalOrigin > vOrigin[ 2 ] ) {
iCounts++;

if( iCounts > 10 ) {
iCounts = 0;

UpdateBall( 0 );
}
} else {
iCounts = 0;

if( PointContents( vOrigin ) != CONTENTS_EMPTY )
UpdateBall( 0 );
}

flLastVerticalOrigin = vOrigin[ 2 ];
}
}

return PLUGIN_CONTINUE;
}

KickBall( id ) {
set_user_maxspeed(id, 230.0)
static Float:vOrigin[ 3 ];
entity_get_vector( g_iBall, EV_VEC_origin, vOrigin );

if( PointContents( vOrigin ) != CONTENTS_EMPTY )
return PLUGIN_HANDLED;

new Float:vVelocity[ 3 ];
velocity_by_aim( id, get_pcvar_num(cDistance), vVelocity );

set_pev( g_iBall, pev_solid, SOLID_BBOX );
entity_set_size( g_iBall, Float:{ -15.0, -15.0, 0.0 }, Float:{ 15.0, 15.0, 12.0 } );
entity_set_int( g_iBall, EV_INT_iuser1, 0 );
entity_set_vector( g_iBall, EV_VEC_velocity, vVelocity );

return PLUGIN_CONTINUE;
}

// BALL TOUCHES
////////////////////////////////////////////////////////////
public FwdTouchPlayer( Ball, id ) {
if( is_user_bot( id ) )
return PLUGIN_CONTINUE;

static iOwner; iOwner = pev( Ball, pev_iuser1 );

if( iOwner == 0 ) {
entity_set_int( Ball, EV_INT_iuser1, id );
set_user_maxspeed(id, get_pcvar_float(cSpeed))
}
return PLUGIN_CONTINUE;
}

public FwdTouchWorld( Ball, World ) {
static Float:vVelocity[ 3 ];
entity_get_vector( Ball, EV_VEC_velocity, vVelocity );

if( floatround( vector_length( vVelocity ) ) > 10 ) {
vVelocity[ 0 ] *= 0.85;
vVelocity[ 1 ] *= 0.85;
vVelocity[ 2 ] *= 0.85;

entity_set_vector( Ball, EV_VEC_velocity, vVelocity );

emit_sound( Ball, CHAN_ITEM, BALL_BOUNCE_GROUND, 1.0, ATTN_NORM, 0, PITCH_NORM );
}

return PLUGIN_CONTINUE;
}


// ENTITIES CREATING
////////////////////////////////////////////////////////////
CreateBall( id, Float:vOrigin[ 3 ] = { 0.0, 0.0, 0.0 } ) {
if( !id && vOrigin[ 0 ] == 0.0 && vOrigin[ 1 ] == 0.0 && vOrigin[ 2 ] == 0.0 )
return 0;

g_bNeedBall = true;

g_iBall = create_entity( "info_target" );

if( is_valid_ent( g_iBall ) ) {
entity_set_string( g_iBall, EV_SZ_classname, g_szBallName );
entity_set_int( g_iBall, EV_INT_solid, SOLID_BBOX );
entity_set_int( g_iBall, EV_INT_movetype, MOVETYPE_BOUNCE );
entity_set_model( g_iBall, g_szBallModel );
entity_set_size( g_iBall, Float:{ -15.0, -15.0, 0.0 }, Float:{ 15.0, 15.0, 12.0 } );

entity_set_float( g_iBall, EV_FL_framerate, 0.0 );
entity_set_int( g_iBall, EV_INT_sequence, 0 );

entity_set_float( g_iBall, EV_FL_nextthink, get_gametime( ) + 0.05 );

client_print( id, print_chat, "* Successfully created ball!" );

if( id > 0 ) {
new iOrigin[ 3 ];
get_user_origin( id, iOrigin, 3 );
IVecFVec( iOrigin, vOrigin );

vOrigin[ 2 ] += 5.0;

entity_set_origin( g_iBall, vOrigin );
} else
entity_set_origin( g_iBall, vOrigin );

g_vOrigin = vOrigin;

return g_iBall;
}

return -1;
}
Ребята, здравствуйте! Поставил данный плагин на knife сервер, а в итоге оказалось что он сбрасывает скорость игрока. А это не есть хорошо. Ибо у меня есть пару функций выдачи скорости на сервере. Но данный плагин их блокирует и меняет как хочет.

Я попробовал удалить всё что связано с set_use_maxspeed, но в итоге при компиляции вылезло 16 errors.

Можете глянуть пожалуйста, чего я не так удалил?

Удалял с исходника:
set_user_maxspeed(id, 230.0)
set_user_maxspeed(id, get_pcvar_float(cSpeed))

Исходник с которого удалял, прикрепляю.
6 Июн 2020
А так же скриншот ошибок возникающих при компиляции:
 
В этой теме было размещено решение! Перейти к решению.

Download all Attachments

  • 14.9 KB Просмотры: 168
  • 21.2 KB Просмотры: 171
Последнее редактирование:

hajimura

Е777КХ05
Сообщения
287
Реакции
223
Помог
6 раз(а)
CTapbIu, в коде остались условия, в которых ничего не происходило, т.е. пустые условия, т.е. ненужные
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу