Page 1 of 1
Breakable Hint
Posted: 21 Jun 2017, 21:36
by Raheem
Description :
Cvars :
ze_breakhint_mode 2 // Breakable Hint Message mode (0 = Disabled | 1 = Text Message | 2 = HUD | 3 = DHUD).
ze_breakhint_hud_rand_colors 1 // Breakable Hint Message HUD random colors (1 = Enabled | 0 = Disabled).
ze_breakhint_hud_red 0 // Breakable Hint Message HUD Red color (0..255).
ze_breakhint_hud_green 200 // Breakable Hint Message HUD Green color (0..255).
ze_breakhint_hud_blue 0 // Breakable Hint Message HUD Blue color (0..255).
ze_breakhint_distance "500.0" // Required distance to detect Breakable entity (0.0 = Distance exceeded)
Installation & Instructions :
Translation Key :
MSG_BREAK_HINT = "You can break this Entity!"
Changelog :
Spoiler!
Version: 1.0
Version: 1.1
Version: 1.2 [Current Version ]
Fix bug : Ignoring entities that have a spawnflag: '1' (TRIGGER ONLY)
Optimization : Optimize code with ReAPI functions.
Addition : Add new Cvars for HUD colors + random colors.
Addition : Add new HUD type "Director HUD / Text Message".
Improvement : Add translation key 'MSG_BREAK_HINT'.
Removal : Delete mode "Chat".
Screenshots :
Text Message (print_center)
HUD
DHUD
Downloads :
Re: Breakable Hint
Posted: 29 Jul 2017, 05:38
by Raheem
New version available: 1.1
Re: Breakable Hint
Posted: 29 Jan 2018, 20:36
by ArminC
For normal mod (or other):
Code: Select all
#include <amxmodx>
#include <engine>
#include <reapi>
// Defines
#define AIMTASK 500
// Cvars
new cvar_message_type
public plugin_init()
{
register_plugin("Breakable Hint", "1.1", "Raheem")
// Cvars
cvar_message_type = register_cvar("break_hint_type", "1")
// Tasks
set_task(0.5, "Check_AimTask", AIMTASK, _, _, "b")
}
public Check_AimTask()
{
if (get_pcvar_num(cvar_message_type) == 0)
{
remove_task(AIMTASK, 0)
return
}
for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
{
if (!is_user_alive(id))
continue
new iEntIndex, iBody
get_user_aiming(id, iEntIndex, iBody)
if(is_valid_ent(iEntIndex) && !is_user_connected(iEntIndex))
{
new szClassName[32]
get_entvar(iEntIndex, var_classname, szClassName, charsmax(szClassName))
if(equal(szClassName, "func_breakable"))
{
if (get_pcvar_num(cvar_message_type) == 1)
{
set_hudmessage(random(256), random(256), random(256), 0.1, -0.3, 2, 2.0, 2.0)
show_hudmessage(id, "You can break this entity!")
}
else if (get_pcvar_num(cvar_message_type) == 2)
{
client_print(id, print_center, "You can break this entity!")
}
}
}
}
}
Re: Breakable Hint
Posted: 03 Aug 2018, 13:49
by czirimbolo
I would like to see HP of Entity when I aim to it. Is it possible to make it Raheem?
Re: Breakable Hint
Posted: 03 Aug 2018, 14:21
by Raheem
Here it's (I consider this a new version 1.2, i'll update main post soon):
Code: Select all
#include <zombie_escape>
// Defines
#define AIMTASK 500
// Cvars
new cvar_message_type
public plugin_init()
{
register_plugin("[ZE] Breakable Hint", "1.2", "Raheem")
// Cvars
cvar_message_type = register_cvar("ze_break_hint_type", "1")
// Tasks
set_task(0.5, "Check_AimTask", AIMTASK, _, _, "b")
}
public Check_AimTask()
{
if (get_pcvar_num(cvar_message_type) == 0)
{
remove_task(AIMTASK, 0)
return
}
for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
{
if (!is_user_alive(id))
continue
new iEntIndex, iBody
get_user_aiming(id, iEntIndex, iBody)
if(pev_valid(iEntIndex) && !is_user_connected(iEntIndex))
{
new szClassName[32], iHealth
iHealth = floatround(get_entvar(iEntIndex, var_health))
get_entvar(iEntIndex, var_classname, szClassName, charsmax(szClassName))
if(equal(szClassName, "func_breakable"))
{
if (get_pcvar_num(cvar_message_type) == 1)
{
set_hudmessage(random(256), random(256), random(256), 0.1, -0.3, 2, 2.0, 2.0)
show_hudmessage(id, "[Hint] You can break this Entity!^n Health: %i", iHealth)
}
else if (get_pcvar_num(cvar_message_type) == 2)
{
static szMessage[64]
formatex(szMessage, charsmax(szMessage), "[Hint] You can break this Entity!^n Health: %i", iHealth)
engfunc(EngFunc_ClientPrintf, id, engprint_center, szMessage)
}
}
}
}
}
Screenshots:
Re: Breakable Hint
Posted: 05 Aug 2018, 18:52
by czirimbolo
I cant compile:
//// ze_breakable_hint.sma
//
// C:\Users\macie\Desktop\Compiler v1.8.3\scripting\ze_breakable_hint.sma(36) : error 017: undefined symbol "is_valid_ent"
//
// 1 Error.
// Could not locate output file compiled\ze_breakable_hint.amx (compile failed).
//
// Compilation Time: 0,75 sec
// ----------------------------------------
Re: Breakable Hint
Posted: 05 Aug 2018, 19:35
by Night Fury
czirimbolo wrote: ↑ 5 years ago
I cant compile:
//// ze_breakable_hint.sma
//
// C:\Users\macie\Desktop\Compiler v1.8.3\scripting\ze_breakable_hint.sma(36) : error 017: undefined symbol "is_valid_ent"
//
// 1 Error.
// Could not locate output file compiled\ze_breakable_hint.amx (compile failed).
//
// Compilation Time: 0,75 sec
// ----------------------------------------
Add
Re: Breakable Hint
Posted: 05 Aug 2018, 20:16
by czirimbolo
Compiled but dont see HP of entity
Re: Breakable Hint
Posted: 06 Aug 2018, 11:36
by Raheem
Please try now, updated the post.
Re: Breakable Hint
Posted: 06 Aug 2018, 20:59
by czirimbolo
ze_break_hint_type 2 in cfg. and its working like on screens. THanks
Re: Breakable Hint
Posted: 02 Sep 2018, 17:38
by th3_king
There is a problem with print_chat in this plugin Hint Break, and It causes problems to players game also in other servers it appears at map changes ... so please fix it.
Re: Breakable Hint
Posted: 03 Sep 2018, 13:19
by Raheem
Try:
#include < zombie_escape>
// Defines
#define AIMTASK 500
// Cvars
new cvar_message_type
public plugin_init ( )
{
register_plugin ( "[ZE] Breakable Hint" , "1.2" , "Raheem" )
// Cvars
cvar_message_type = register_cvar ( "ze_break_hint_type" , "1" )
// Tasks
set_task ( 0.5 , "Check_AimTask" , AIMTASK, _, _, "b" )
}
public Check_AimTask( )
{
if ( get_pcvar_num ( cvar_message_type) == 0 )
{
remove_task ( AIMTASK, 0 )
return
}
for ( new id = 1 ; id <= get_member_game ( m_nMaxPlayers ) ; id ++ )
{
if ( ! is_user_alive ( id ) )
continue
new iEntIndex, iBody
get_user_aiming ( id , iEntIndex, iBody)
if ( pev_valid ( iEntIndex) && ! is_user_connected ( iEntIndex) )
{
new szClassName[ 32 ] , iHealth
iHealth = floatround ( get_entvar ( iEntIndex, var_health ) )
get_entvar ( iEntIndex, var_classname , szClassName, charsmax ( szClassName) )
if ( equal ( szClassName, "func_breakable" ) )
{
if ( get_pcvar_num ( cvar_message_type) == 1 )
{
set_hudmessage ( random ( 256 ) , random ( 256 ) , random ( 256 ) , 0.1 , - 0.3 , 2 , 2.0 , 2.0 )
show_hudmessage ( id , "[Hint] You can break this Entity!^n Health: %i" , iHealth)
}
else if ( get_pcvar_num ( cvar_message_type) == 2 )
{
static szMessage[ 64 ]
formatex ( szMessage, charsmax ( szMessage) , "[Hint] You can break this Entity!^n Health: %i" , iHealth)
engclient_print ( id , engprint_center , szMessage)
}
}
}
}
}
Re: Breakable Hint
Posted: 31 Jul 2019, 08:10
by tmv
Raheem wrote: ↑ 5 years ago
Try:
#include < zombie_escape>
// Defines
#define AIMTASK 500
// Cvars
new cvar_message_type
public plugin_init ( )
{
register_plugin ( "[ZE] Breakable Hint" , "1.2" , "Raheem" )
// Cvars
cvar_message_type = register_cvar ( "ze_break_hint_type" , "1" )
// Tasks
set_task ( 0.5 , "Check_AimTask" , AIMTASK, _, _, "b" )
}
public Check_AimTask( )
{
if ( get_pcvar_num ( cvar_message_type) == 0 )
{
remove_task ( AIMTASK, 0 )
return
}
for ( new id = 1 ; id <= get_member_game ( m_nMaxPlayers ) ; id ++ )
{
if ( ! is_user_alive ( id ) )
continue
new iEntIndex, iBody
get_user_aiming ( id , iEntIndex, iBody)
if ( pev_valid ( iEntIndex) && ! is_user_connected ( iEntIndex) )
{
new szClassName[ 32 ] , iHealth
iHealth = floatround ( get_entvar ( iEntIndex, var_health ) )
get_entvar ( iEntIndex, var_classname , szClassName, charsmax ( szClassName) )
if ( equal ( szClassName, "func_breakable" ) )
{
if ( get_pcvar_num ( cvar_message_type) == 1 )
{
set_hudmessage ( random ( 256 ) , random ( 256 ) , random ( 256 ) , 0.1 , - 0.3 , 2 , 2.0 , 2.0 )
show_hudmessage ( id , "[Hint] You can break this Entity!^n Health: %i" , iHealth)
}
else if ( get_pcvar_num ( cvar_message_type) == 2 )
{
static szMessage[ 64 ]
formatex ( szMessage, charsmax ( szMessage) , "[Hint] You can break this Entity!^n Health: %i" , iHealth)
engclient_print ( id , engprint_center , szMessage)
}
}
}
}
}
Not Fixed
Can be seen Breakable Hint print_chat in other servers
Re: Breakable Hint
Posted: 31 Jul 2019, 11:20
by Raheem
Got idea, to send empty message as a reset, TRY:
#include < zombie_escape>
// Defines
#define AIMTASK 500
// Cvars
new cvar_message_type
public plugin_init ( )
{
register_plugin ( "[ZE] Breakable Hint" , "1.2" , "Raheem" )
// Cvars
cvar_message_type = register_cvar ( "ze_break_hint_type" , "1" )
// Tasks
set_task ( 0.5 , "Check_AimTask" , AIMTASK, _, _, "b" )
}
public Check_AimTask( )
{
if ( get_pcvar_num ( cvar_message_type) == 0 )
{
remove_task ( AIMTASK, 0 )
return
}
for ( new id = 1 ; id <= get_member_game ( m_nMaxPlayers ) ; id ++ )
{
if ( ! is_user_alive ( id ) )
continue
new iEntIndex, iBody
get_user_aiming ( id , iEntIndex, iBody)
if ( pev_valid ( iEntIndex) && ! is_user_connected ( iEntIndex) )
{
new szClassName[ 32 ] , iHealth
iHealth = floatround ( get_entvar ( iEntIndex, var_health ) )
get_entvar ( iEntIndex, var_classname , szClassName, charsmax ( szClassName) )
if ( equal ( szClassName, "func_breakable" ) )
{
if ( get_pcvar_num ( cvar_message_type) == 1 )
{
set_hudmessage ( random ( 256 ) , random ( 256 ) , random ( 256 ) , 0.1 , - 0.3 , 2 , 2.0 , 2.0 )
show_hudmessage ( id , "[Hint] You can break this Entity!^n Health: %i" , iHealth)
}
else if ( get_pcvar_num ( cvar_message_type) == 2 )
{
static szMessage[ 64 ]
formatex ( szMessage, charsmax ( szMessage) , "[Hint] You can break this Entity!^n Health: %i" , iHealth)
engclient_print ( id , engprint_center , szMessage)
set_task ( 0.5 , "Reset" , id )
}
}
}
}
}
public Reset( id )
{
engclient_print ( id , engprint_center , "" )
}
Re: Breakable Hint
Posted: 31 Jul 2019, 13:58
by tmv
Unfortunately it didn't work
The moment when this message appears I connect to another server and the message is still there in the new server. Could it be bug of cs 1.6?
Re: Breakable Hint
Posted: 31 Jul 2019, 14:12
by Raheem
tmv wrote: ↑ 4 years ago
Unfortunately it didn't work
The moment when this message appears I connect to another server and the message is still there in the new server. Could it be bug of cs 1.6?
The issue in
engclient_print(id, engprint_center, szMessage)
, i'm using it so i be able to go to new line with
^n
, it seems like this message is saved in game cache, if player disconnected then out of game and enter again it disappears, but for now try this:
#include < zombie_escape>
// Defines
#define AIMTASK 500
// Cvars
new cvar_message_type
public plugin_init ( )
{
register_plugin ( "[ZE] Breakable Hint" , "1.2" , "Raheem" )
// Cvars
cvar_message_type = register_cvar ( "ze_break_hint_type" , "1" )
// Tasks
set_task ( 0.5 , "Check_AimTask" , AIMTASK, _, _, "b" )
}
public Check_AimTask( )
{
if ( get_pcvar_num ( cvar_message_type) == 0 )
{
remove_task ( AIMTASK, 0 )
return
}
for ( new id = 1 ; id <= get_member_game ( m_nMaxPlayers ) ; id ++ )
{
if ( ! is_user_alive ( id ) )
continue
new iEntIndex, iBody
get_user_aiming ( id , iEntIndex, iBody)
if ( pev_valid ( iEntIndex) && ! is_user_connected ( iEntIndex) )
{
new szClassName[ 32 ] , iHealth
iHealth = floatround ( get_entvar ( iEntIndex, var_health ) )
get_entvar ( iEntIndex, var_classname , szClassName, charsmax ( szClassName) )
if ( equal ( szClassName, "func_breakable" ) )
{
if ( get_pcvar_num ( cvar_message_type) == 1 )
{
set_hudmessage ( random ( 256 ) , random ( 256 ) , random ( 256 ) , 0.1 , - 0.3 , 2 , 2.0 , 2.0 )
show_hudmessage ( id , "[Hint] You can break this Entity!^n Health: %i" , iHealth)
}
else if ( get_pcvar_num ( cvar_message_type) == 2 )
{
static szMessage[ 64 ]
formatex ( szMessage, charsmax ( szMessage) , "[Hint] You can break this Entity!^n Health: %i" , iHealth)
engfunc ( EngFunc_ClientPrintf , id , engprint_center , szMessage)
}
}
}
}
}
public client_disconnected( id )
{
engfunc ( EngFunc_ClientPrintf , id , engprint_center , "" )
}
I tried here reset in player disconnect, if not worked then you will need to use
client_print(id, print_center, "")
but in this you can't go to new line, it's only one line.
Re: Breakable Hint
Posted: 22 Feb 2024, 00:51
by z0h1r-LK