22/01/2021, 04:33 PM
(Última modificación: 22/01/2021, 04:35 PM por MalitoMaloso. Edited 1 time in total.)
hola busco un plugin de regeneracion de vida tengo este no si si alguien puede modificarlo
maximo de vida 100
a cada 20 segundos le da 10 de vida hasta llegar a los 100 , la idea que cada 20 segundos te vaya dando 10 de vida hata llegar a los 100 , si player le dispara a un player y le quita 40 de vida la idea que el plugins le suba la vida a cada 20 segundos
la idea que solo sea para admin ADMIN_LEVEL_G
saludos
maximo de vida 100
a cada 20 segundos le da 10 de vida hasta llegar a los 100 , la idea que cada 20 segundos te vaya dando 10 de vida hata llegar a los 100 , si player le dispara a un player y le quita 40 de vida la idea que el plugins le suba la vida a cada 20 segundos
la idea que solo sea para admin ADMIN_LEVEL_G
saludos
Código PHP:
/* Copyright © 2009, ConnorMcLeod
Vampire is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Vampire; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <screenfade_util>
#define PLUGIN "Vampire"
#define AUTHOR "ConnorMcLeod"
#define VERSION "1.2.0"
#define cs_get_user_team(%1) get_pdata_int(%1,114)
const m_LastHitGroup = 75
new g_iMaxPlayers
new g_pCvarHpBonus, g_pCvarHpBonusHs, g_pCvarMaxHealth, g_pCvarColor, g_pCvarColorHs, g_pCvarFadeTime
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pCvarHpBonus = register_cvar("amx_vampire_hp", "10")
g_pCvarHpBonusHs = register_cvar("amx_vampire_hp_hs", "35")
g_pCvarMaxHealth = register_cvar("amx_vampire_max_hp", "150")
g_pCvarFadeTime = register_cvar("amx_vampire_fadetime", "4")
g_pCvarColor = register_cvar("amx_vampire_color", "000100255")
g_pCvarColorHs = register_cvar("amx_vampire_color_hs", "000255100")
RegisterHam(Ham_Killed, "player", "Player_Killed", 1)
g_iMaxPlayers = get_maxplayers()
}
public Player_Killed(iVictim, iKiller)
{
if( iVictim == iKiller
|| !( 1 <= iKiller <= g_iMaxPlayers)
|| !is_user_alive(iKiller)
|| cs_get_user_team(iVictim) == cs_get_user_team(iKiller) )
{
return
}
new Float:flHealth, Float:flMaxHealth = get_pcvar_float(g_pCvarMaxHealth)
pev(iKiller, pev_health, flHealth)
new bHeadShot = (get_pdata_int(iVictim, m_LastHitGroup) == HIT_HEAD)
if( flHealth < flMaxHealth )
{
new Float:flNewHealth
new Float:flBonus = get_pcvar_float(bHeadShot ? g_pCvarHpBonusHs : g_pCvarHpBonus)
flNewHealth = floatmin(flHealth + flBonus, flMaxHealth)
set_pev(iKiller, pev_health, flNewHealth)
set_hudmessage(0, 255, 100, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
show_hudmessage(iKiller, "Recibiste +%.0f hp", flNewHealth - flHealth)
}
new iColor[3], Float:flTime = get_pcvar_float(g_pCvarFadeTime)
iColor = get_color(bHeadShot ? g_pCvarColorHs : g_pCvarColor)
UTIL_ScreenFade(iKiller, iColor, flTime, flTime, 75)
}
get_color(pcvar)
{
new iColor[3], szColor[10]
get_pcvar_string(pcvar, szColor, charsmax(szColor))
new c = str_to_num(szColor)
iColor[Red] = c / 1000000
c %= 1000000
iColor[Green] = c / 1000
iColor[Blue] = c % 1000
return iColor
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }
*/