Mensajes: 72
Temas: 33
Registro en: Apr 2015
Reputación:
0
Lo que quiero es Blockear el Jump y el duck durante freezetime, una vez terminado el freezetime, puedan usarlo normalmente.
Mensajes: 2,454
Temas: 14
Registro en: Oct 2013
Reputación:
51
08/12/2016, 12:59 PM
(Última modificación: 08/12/2016, 01:06 PM por Manu.)
Probá algo así re loco:
EDIT: Versión número 2 (?)
Código PHP: #include <amxmodx> #include <engine> #include <hamsandwich>
new g_iMaxPlayers, HamHook:g_pHamSpawn;
public plugin_init( ) { register_plugin( "Block Jump & Duck", "1.0", "Manu" ); register_logevent( "ev_RoundStart", 2, "1=Round_Start" ); register_event( "HLTV", "ev_RoundCommencing", "a", "1=0", "2=0" ); DisableHamForward( g_pHamSpawn = RegisterHam( Ham_Spawn, "player", "fw_PlayerSpawn_Post", true ) ); g_iMaxPlayers = get_maxplayers( ); }
public ev_RoundCommencing( ) { if( get_cvar_num( "mp_freezetime" ) >= 1 ) EnableHamForward( g_pHamSpawn ); }
public ev_RoundStart( ) { DisableHamForward( g_pHamSpawn ); for( new iPlayer = 1; iPlayer <= g_iMaxPlayers; iPlayer++ ) { if( is_user_alive( iPlayer ) && entity_get_int( iPlayer, EV_INT_flags ) & FL_FROZEN ) entity_set_int( iPlayer, EV_INT_flags, entity_get_int( iPlayer, EV_INT_flags ) & ~FL_FROZEN ); } }
public fw_PlayerSpawn_Post( iId ) { drop_to_floor( iId ); entity_set_int( iId, EV_INT_flags, entity_get_int( iId, EV_INT_flags ) | FL_FROZEN ); }
No hago trabajos privados. Si necesitás ayuda, abrí un nuevo tema.
¿Buscás un ejemplo o algún modo de juego? Podés echarle un vistazo a mis aportes.
Mensajes: 72
Temas: 33
Registro en: Apr 2015
Reputación:
0
Muy bueno jejeje pero lo que hace es congelarlo, quiero bloquear el jump y el duck los comandos durante el freezetime
Mensajes: 2,454
Temas: 14
Registro en: Oct 2013
Reputación:
51
(08/12/2016, 01:21 PM)jul escribió: Muy bueno jejeje pero lo que hace es congelarlo, quiero bloquear el jump y el duck los comandos durante el freezetime
¿Cuál es la diferencia?
No hago trabajos privados. Si necesitás ayuda, abrí un nuevo tema.
¿Buscás un ejemplo o algún modo de juego? Podés echarle un vistazo a mis aportes.
Mensajes: 72
Temas: 33
Registro en: Apr 2015
Reputación:
0
Este puede saltar igual y en el momento de dropear un arma aun compañero esta sale hacia otra direccion
Mensajes: 2,454
Temas: 14
Registro en: Oct 2013
Reputación:
51
Probá este otro re loco.
Código PHP: #include <amxmodx> #include <engine> #include <hamsandwich>
new HamHook:g_pHamPlayerJump, HamHook:g_pHamPlayerDuck;
public plugin_init( ) { register_plugin( "Block Jump & Duck", "1.0", "Manu" ); register_logevent( "ev_RoundStart", 2, "1=Round_Start" ); register_event( "HLTV", "ev_RoundCommencing", "a", "1=0", "2=0" ); DisableHamForward( g_pHamPlayerJump = RegisterHam( Ham_Player_Jump, "player", "fw_PlayerJumpOrDuck_Pre" ) ); DisableHamForward( g_pHamPlayerDuck = RegisterHam( Ham_Player_Duck, "player", "fw_PlayerJumpOrDuck_Pre" ) ); }
public fw_PlayerJumpOrDuck_Pre( iId ) { static iOldButtons; iOldButtons = entity_get_int( iId, EV_INT_oldbuttons ); if( ~iOldButtons & IN_JUMP || ~iOldButtons & IN_DUCK ) { iOldButtons |= (IN_JUMP | IN_DUCK); entity_set_int( iId, EV_INT_oldbuttons, iOldButtons ); return HAM_HANDLED; } return HAM_IGNORED; }
public ev_RoundCommencing( ) { EnableHamForward( g_pHamPlayerJump ); EnableHamForward( g_pHamPlayerDuck ); }
public ev_RoundStart( ) { DisableHamForward( g_pHamPlayerJump ); DisableHamForward( g_pHamPlayerDuck ); }
No hago trabajos privados. Si necesitás ayuda, abrí un nuevo tema.
¿Buscás un ejemplo o algún modo de juego? Podés echarle un vistazo a mis aportes.
Mensajes: 72
Temas: 33
Registro en: Apr 2015
Reputación:
0
|