Approved Breakable Hint
- th3_king
- VIP
- Posts: 35
- Joined: 2 Years Ago
- Location: Egypt
- Has thanked: 10 times
- Been thanked: 2 times
- Age: 17
- Contact:
Re: Breakable Hint
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: 1972
- Joined: 2 Years Ago
- Location: Egypt
- Has thanked: 32 times
- Been thanked: 108 times
- Age: 22
- Contact:
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)
- }
- }
- }
- }
- }
You don't know? Learn and you will know.
Not FixedRaheem wrote: ↑1 Year AgoTry:
#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) } } } } }
Can be seen Breakable Hint print_chat in other servers
- Raheem
- Mod Developer
- Posts: 1972
- Joined: 2 Years Ago
- Location: Egypt
- Has thanked: 32 times
- Been thanked: 108 times
- Age: 22
- Contact:
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, "")
- }
You don't know? Learn and you will know.
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 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: 1972
- Joined: 2 Years Ago
- Location: Egypt
- Has thanked: 32 times
- Been thanked: 108 times
- Age: 22
- Contact:
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.You don't know? Learn and you will know.
Who is online
Users browsing this forum: No registered users and 1 guest