Raheem
Mod Developer
Posts: 2214 Joined: 7 years ago
Contact:
Quote
1
login to like this post
#1
Post
by Raheem » 6 years ago
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 :
He who fails to plan is planning to fail
Raheem
Mod Developer
Posts: 2214 Joined: 7 years ago
Contact:
Quote
0
login to like this post
#2
Post
by Raheem » 6 years ago
New version available: 1.1
He who fails to plan is planning to fail
ArminC
Senior Member
Posts: 137 Joined: 6 years ago
Location: Bucharest
Contact:
Quote
0
login to like this post
#3
Post
by ArminC » 6 years ago
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!")
}
}
}
}
}
czirimbolo
Veteran Member
Posts: 598 Joined: 7 years ago
Contact:
Quote
0
login to like this post
#4
Post
by czirimbolo » 5 years ago
I would like to see HP of Entity when I aim to it. Is it possible to make it Raheem?
Raheem
Mod Developer
Posts: 2214 Joined: 7 years ago
Contact:
Quote
0
login to like this post
#5
Post
by Raheem » 5 years ago
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:
Last edited by
Raheem 5 years ago , edited 1 time in total.
Reason: Removed engine include, Fixed new line message, Added screenshots
He who fails to plan is planning to fail
czirimbolo
Veteran Member
Posts: 598 Joined: 7 years ago
Contact:
Quote
0
login to like this post
#6
Post
by czirimbolo » 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
// ----------------------------------------
Night Fury
Mod Developer
Posts: 677 Joined: 7 years ago
Contact:
Quote
0
login to like this post
#7
Post
by Night Fury » 5 years ago
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
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Raheem
Mod Developer
Posts: 2214 Joined: 7 years ago
Contact:
Quote
0
login to like this post
#9
Post
by Raheem » 5 years ago
Please try now, updated the post.
He who fails to plan is planning to fail
czirimbolo
Veteran Member
Posts: 598 Joined: 7 years ago
Contact:
Quote
0
login to like this post
#10
Post
by czirimbolo » 5 years ago
ze_break_hint_type 2 in cfg. and its working like on screens. THanks
th3_king
VIP
Posts: 35 Joined: 6 years ago
Location: Egypt
Contact:
Quote
0
login to like this post
#11
Post
by th3_king » 5 years ago
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.
Raheem
Mod Developer
Posts: 2214 Joined: 7 years ago
Contact:
Quote
0
login to like this post
#12
Post
by Raheem » 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)
}
}
}
}
}
He who fails to plan is planning to fail
tmv
Member
Posts: 36 Joined: 4 years ago
Contact:
Quote
0
login to like this post
#13
Post
by tmv » 4 years ago
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
Raheem
Mod Developer
Posts: 2214 Joined: 7 years ago
Contact:
Quote
0
login to like this post
#14
Post
by Raheem » 4 years ago
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 , "" )
}
He who fails to plan is planning to fail
tmv
Member
Posts: 36 Joined: 4 years ago
Contact:
Quote
0
login to like this post
#15
Post
by tmv » 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?
Raheem
Mod Developer
Posts: 2214 Joined: 7 years ago
Contact:
Quote
0
login to like this post
#16
Post
by Raheem » 4 years ago
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.
He who fails to plan is planning to fail
z0h1r-LK
Mod Developer
Posts: 486 Joined: 5 years ago
Location: The Red City ❤
Contact:
Quote
0
login to like this post
#17
Post
by z0h1r-LK » 2 months ago
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute
Register
Sign in
Users browsing this forum: No registered users and 3 guests