Raised This Month: $ Target: $400
 0% 

Ayuda Restaurar vida al matar


  
 
 
Thread Tools Display Modes
Author Message
fiury
Member
Join Date: Aug 2010
Old 03-25-2012 , 08:31   Ayuda Restaurar vida al matar
#1

He buscado en el foro sobre un pluguin que permita aumentar la vida cuando matas a un contrario con un head shot o simplemente por matarlo. Pero no encuentro lo que busco y se que existe.

He encontrado estos dos pluguins pero no entiendo muy bien su descripción. No creo que sea lo que busco.
http://forums.alliedmods.net/showthread.php?t=74334
http://forums.alliedmods.net/showthread.php?p=702749
En este servidor por ejemplo lo tienen: 77.111.206.125:27015 por si sirve de ayuda para encontrarlo.
fiury is offline
niqo
Senior Member
Join Date: Feb 2010
Location: Argentina
Old 03-25-2012 , 08:56   Re: Ayuda Restaurar vida al matar
#2

http://forums.alliedmods.net/showthread.php?p=455096
__________________
niqo is offline
angelitop10
BANNED
Join Date: Dec 2011
Location: Chile
Old 03-25-2012 , 13:12   Re: Ayuda Restaurar vida al matar
#3

Mira usa el Ham_Playerkilled y registralo
PHP Code:
RegisterHam(Ham_Killed"player""fw_PlayerKilled"
Y luego haces el public
PHP Code:
public fw_PlayerKilled(victimattackershouldgib)
{
    if(
get_user_team(attacker) != get_user_team(victim))
        {
         
set_user_health(attacker get_user_health(attacker) + 200
        }


Last edited by angelitop10; 03-25-2012 at 13:26.
angelitop10 is offline
xLeoNNN
Veteran Member
Join Date: Sep 2010
Location: de_dust2
Old 03-25-2012 , 13:23   Re: Ayuda Restaurar vida al matar
#4

angelitop10, con eso haces que siempre que mate su vida sea 100, el quiere AUMENTAR, debería usar:

set_user_health(attacker, get_user_health(attacker) +100)
__________________
xLeoNNN is offline
Send a message via MSN to xLeoNNN
Old 03-25-2012, 13:25
angelitop10
This message has been deleted by angelitop10. Reason: Lei mal
fiury
Member
Join Date: Aug 2010
Old 03-25-2012 , 14:11   Re: Ayuda Restaurar vida al matar
#5

Muchas gracias por vuestra ayuda. Me a servido. Como no se muy bien como compilar el código y demás optare por usar el pluguin de #2

http://forums.alliedmods.net/showthread.php?p=455096

Que parte debería editar para que en ese pluguin no salga el screen azul y el hud. Supongo que con eliminar la ultima parte bastaría ¿es así?

*
* AmxModX
* Vampire plugin
* by Shalfey
*
* CVars
* amx_vampire_hp - hp add for kill
* amx_vampire_hp_hs - hp add for kill in head
* amx_vampire_max_hp - max player hp
*
* Players gets HP for kills.
*/
#include <amxmodx>
#include <fun>

#define PLUGIN_VERSION "1.0c"

new health_add
new health_hs_add
new health_max

new nKiller
new nKiller_hp
new nHp_add
new nHp_max

public plugin_init()
{
register_plugin("Vampire", PLUGIN_VERSION, "Shalfey")

health_add = register_cvar("amx_vampire_hp", "15")
health_hs_add = register_cvar("amx_vampire_hp_hs", "40")
health_max = register_cvar("amx_vampire_max_hp", "100")

register_event("DeathMsg", "hook_death", "a", "1>0")
}

public hook_death()
{
// Killer id
nKiller = read_data(1)

if ( (read_data(3) == 1) && (read_data(5) == 0) )
{
nHp_add = get_pcvar_num (health_hs_add)
}
else
nHp_add = get_pcvar_num (health_add)

nHp_max = get_pcvar_num (health_max)

// Updating Killer HP
nKiller_hp = get_user_health(nKiller)
nKiller_hp += nHp_add

// Maximum HP check
if (nKiller_hp > nHp_max) nKiller_hp = nHp_max

set_user_health(nKiller, nKiller_hp)

// Hud message "Healed +15/+40 hp"
set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
show_hudmessage(nKiller, "Healed +%d hp", nHp_add)

// Screen fading
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(0)
write_byte(200)
write_byte(75)
message_end()


}

Last edited by fiury; 03-25-2012 at 14:18.
fiury is offline
xLeoNNN
Veteran Member
Join Date: Sep 2010
Location: de_dust2
Old 03-25-2012 , 14:40   Re: Ayuda Restaurar vida al matar
#6

si supones que es la última parte, testea y avisa.
__________________
xLeoNNN is offline
Send a message via MSN to xLeoNNN
 



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 22:37.


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