-
Scripting Help
(
https://forums.alliedmods.net/forumdisplay.php?f=11)
Hp restore bug :(
Again bug....
Code:
case 0:
{
if (iTeam == CS_TEAM_T)
{
if(is_user_alive(id))
{
new hp = get_user_health(id);
if(hp < 3500)
{
set_task(1.0,"gydytojas", id)
}
}
}
Code:
public gydytojas(id) {
new hp = get_user_health(id);
if(hp < 3500)
{
set_user_health(id, hp + 5);
set_task(1.0,"gydytojas", id);
}
else
{
client_print(id, print_chat, "Daugiau HP nebegausi :)", hp)
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
when round ends and begins new its still restoring hp.....
|
| Exolent[jNr] |
10-14-2009 14:49 |
Re: Hp restore bug :(
Code:
new g_iMaxPlayers;
public plugin_init( ) {
register_logevent( "EventRoundEnd", 2, "1=Round_End" );
g_iMaxPlayers = get_maxplayers( );
}
public EventRoundEnd( ) {
for( new i = 1; i <= g_iMaxPlayers; i++ ) {
remove_task( i );
}
}
|
| All times are GMT -4. The time now is 22:41. |
|
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.