AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   show /me and /hp on player death (https://forums.alliedmods.net/showthread.php?t=328130)

HowToRuski 10-28-2020 04:12

show /me and /hp on player death
 
Hello, so i thought of an idea, to make gameplay even more simple, can someone teach me how can i make /hp and /me show on player death? So you dont need to write /hp and /me

CrazY. 10-28-2020 07:43

Re: show /me and /hp on player death
 
Code:
amxclient_cmd(id, "say /hp") amxclient_cmd(id, "say /me")

HowToRuski 10-28-2020 08:50

Re: show /me and /hp on player death
 
Quote:

Originally Posted by CrazY. (Post 2722842)
Code:
amxclient_cmd(id, "say /hp") amxclient_cmd(id, "say /me")

Should i do it like this?

PHP Code:

public client_death()
{
 
//your code here
return PLUGIN_HANDLED



DJEarthQuake 10-28-2020 18:28

Re: show /me and /hp on player death
 
Quote:

Originally Posted by HowToRuski (Post 2722825)
Hello, so i thought of an idea, to make gameplay even more simple, can someone teach me how can i make /hp and /me show on player death? So you dont need to write /hp and /me

The HP on player death is less than 0 or else they would be alive. Script posts remaining HP after each hit.

Code:
register_event("Damage","@event_damage","b","2!0","3=0","4!0") @event_damage(id) {     new killer = get_user_attacker(id);         if( is_user_connected(killer) && is_user_alive(killer) && !is_user_bot(killer) )         {             client_print(killer,print_center,"HP: %i",get_user_health(id));         }     return PLUGIN_CONTINUE; }

HowToRuski 10-29-2020 04:07

Re: show /me and /hp on player death
 
Quote:

Originally Posted by DJEarthQuake (Post 2722909)
The HP on player death is less than 0 or else they would be alive. Script posts remaining HP after each hit.

Code:
register_event("Damage","@event_damage","b","2!0","3=0","4!0") @event_damage(id) {     new killer = get_user_attacker(id);         if( is_user_connected(killer) && is_user_alive(killer) && !is_user_bot(killer) )         {             client_print(killer,print_center,"HP: %i",get_user_health(id));         }     return PLUGIN_CONTINUE; }

Not what i wanted. Have you ever used statsx on amxx? Because you just made me a new whole plugin.

CrazY. 10-29-2020 07:34

Re: show /me and /hp on player death
 
Code:
public plugin_init() {     register_event("DeathMsg", "Event_DeathMsg", "ae") } public Event_DeathMsg() {     new victim = read_data(2)     amxclient_cmd(victim, "say", "/hp")     amxclient_cmd(victim, "say", "/me") }

DJEarthQuake 10-29-2020 08:45

Re: show /me and /hp on player death
 
I missed that at first and changed the post. It came back like it never was edited.

HowToRuski 10-29-2020 08:49

Re: show /me and /hp on player death
 
Quote:

Originally Posted by CrazY. (Post 2722960)
Code:
public plugin_init() {     register_event("DeathMsg", "Event_DeathMsg", "ae") } public Event_DeathMsg() {     new victim = read_data(2)     amxclient_cmd(victim, "say", "/hp")     amxclient_cmd(victim, "say", "/me") }

Is there a timing script somehow? Because when i get killed it automatically shows * You have no killer
maybe should like add 1 sec interval before it shows?

DJEarthQuake 10-29-2020 10:45

Re: show /me and /hp on player death
 
Quote:

Originally Posted by HowToRuski (Post 2722973)
Is there a timing script somehow? Because when i get killed it automatically shows * You have no killer
maybe should like add 1 sec interval before it shows?

You are on top of it. Works properly now.
Code:
#include amxmodx public plugin_init() register_event("DeathMsg", "Event_DeathMsg", "acdf"); public Event_DeathMsg(victim) {     victim = read_data(2);     client_cmd(victim, "say /hp");     set_task(1.0,"sayme",victim); } public sayme(victim) client_cmd(victim, "say /me");

HowToRuski 10-29-2020 12:26

Re: show /me and /hp on player death
 
Quote:

Originally Posted by DJEarthQuake (Post 2722990)
You are on top of it. Works properly now.
Code:
#include amxmodx public plugin_init() register_event("DeathMsg", "Event_DeathMsg", "acdf"); public Event_DeathMsg(victim) {     victim = read_data(2);     client_cmd(victim, "say /hp");     set_task(1.0,"sayme",victim); } public sayme(victim) client_cmd(victim, "say /me");

Thanks, worked great.


All times are GMT -4. The time now is 13:55.

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