Raised This Month: $ Target: $400
 0% 

client_print (HELP)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Id0x.
Junior Member
Join Date: Dec 2020
Old 12-19-2020 , 09:27   client_print (HELP)
Reply With Quote #1

Code:
L 12/17/2020 - 10:11:02: [AMXX] Displaying debug trace (plugin "show_health.amxx", version "1.0")
L 12/17/2020 - 10:11:02: [AMXX] Run time error 10: native error (native "client_print")
L 12/17/2020 - 10:11:02: [AMXX]    [0] phpcQFNsK.sma::event_damage (line 12)

PHP Code:
#include <amxmodx>
#include <cstrike>

public plugin_init() {
    
register_plugin("ZE: Show Victim HP On Damage""1.0""<VeCo>")
    
register_event("Damage","event_damage","b","2!0","3=0","4!0")
}

public 
event_damage(id)
{
    new 
killer get_user_attacker(id)
    if(
cs_get_user_team(id) == CS_TEAM_Tclient_print(killer,print_center,"HP: %i",get_user_health(id))



line 12:

PHP Code:
    if(cs_get_user_team(id) == CS_TEAM_Tclient_print(killer,print_center,"HP: %i",get_user_health(id)) 
Id0x. is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-19-2020 , 10:11   Re: client_print (HELP)
Reply With Quote #2

Code:
//Filter if they are alive at least before client_print.
if( is_user_alive(killer) && !is_user_bot(killer) )
    //CODE
__________________
DJEarthQuake is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-19-2020 , 10:18   Re: client_print (HELP)
Reply With Quote #3

PHP Code:
register_event("Damage","event_damage","b","2>0")

public 
event_damage(id)
{
    new 
killer get_user_attacker(id)
    if(
killer && cs_get_user_team(id) == CS_TEAM_Tclient_print(killer,print_center,"HP: %i",get_user_health(id))

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Id0x.
Junior Member
Join Date: Dec 2020
Old 12-19-2020 , 11:46   Re: client_print (HELP)
Reply With Quote #4

Quote:
Originally Posted by Natsheh View Post
PHP Code:
register_event("Damage","event_damage","b","2>0")

public 
event_damage(id)
{
    new 
killer get_user_attacker(id)
    if(
killer && cs_get_user_team(id) == CS_TEAM_Tclient_print(killer,print_center,"HP: %i",get_user_health(id))

Unresolved?

Code:
L 12/19/2020 - 16:32:58: [AMXX] Displaying debug trace (plugin "show_health.amxx", version "1.0")
L 12/19/2020 - 16:32:58: [AMXX] Run time error 10: native error (native "client_print")
L 12/19/2020 - 16:32:58: [AMXX]    [0] phpgt46Ju.sma::event_damage (line 14)
PHP Code:
#include <amxmodx>
#include <cstrike>

public plugin_init()
{
    
register_plugin("Show Victim HP On Damage""1.0""VeCo")

    
register_event("Damage","event_damage","b","2>0")


public 
event_damage(id)
{
    new 
killer get_user_attacker(id)
    if(
killer && cs_get_user_team(id) == CS_TEAM_Tclient_print(killer,print_center,"HP: %i",get_user_health(id))

Id0x. is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-19-2020 , 12:08   Re: client_print (HELP)
Reply With Quote #5

Have you tried my suggestion yet?
__________________

Last edited by DJEarthQuake; 12-19-2020 at 15:01.
DJEarthQuake is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 12-19-2020 , 12:15   Re: client_print (HELP)
Reply With Quote #6

Quote:
Originally Posted by DJEarthQuake View Post
Code:
//Filter if they are alive at least before client_print.
if( is_user_alive(killer) && !is_user_bot(killer) )
    //CODE
^

At least try it before posting again that it doesn't work.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Old 12-19-2020, 12:15
Id0x.
This message has been deleted by Id0x..
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-19-2020 , 13:27   Re: client_print (HELP)
Reply With Quote #7

Check if the user is connected before sending the message. How is being alive relevant?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 12-20-2020 , 17:47   Re: client_print (HELP)
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
Check if the user is connected before sending the message. How is being alive relevant?
Doesn't really matter imo when is_user_alive also checks if the user is connected.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-20-2020 , 17:51   Re: client_print (HELP)
Reply With Quote #9

I know, but if the user is dead when the enemy is killed he won't see a message. And yes, this can happen - HE grenades.
__________________

Last edited by OciXCrom; 12-20-2020 at 17:51.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-20-2020 , 18:32   Re: client_print (HELP)
Reply With Quote #10

Also this isn't the full error code.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode