AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   something wrong with Hp regeneration... (https://forums.alliedmods.net/showthread.php?t=106464)

edga85 10-15-2009 13:18

something wrong with Hp regeneration...
 
Getting some errors in compile....
PHP Code:

#include <amxmodx>  
#include <amxmisc>  
#include <cstrike>  
#include <fun>  
#include < zombieplague >  
new g_pKillAmmo  
new g_iMaxPlayers;  
public 
plugin_init( ) {  
register_plugin"Plugin""1.0""noauthor" );  
register_logevent("Round_Start"2"1=Round_Start")  
register_logevent"EventRoundEnd"2"1=Round_End" )  
register_menucmd(register_menuid("menu_rod"), 1023"Pressedrod")  
g_iMaxPlayers get_maxplayers( );  
g_pKillAmmo register_cvar"zpvip_kill_ammo""2" );  
register_event"DeathMsg""death_msg""a" );  
}  
public 
Round_Start()  
{  
new 
players[32], pnumplayer  
get_players
(playerspnum"a")  
for (new 
0pnumi++)  
{  
player players[i]  
if (
get_user_flags(player) & ADMIN_LEVEL_H)  
{  
ShowmenuID(player)  
}  
}  
return 
PLUGIN_HANDLED  
}  
public 
ShowmenuID(id)  
{  
new 
Body[512]  
new 
CsTeams:iTeam cs_get_user_team(id)  
if (
iTeam == CS_TEAM_T)  
{  
add(Body511"\rVIP Menu: \R\dTe rro r ist^n^n")  
add(Body511"\r1. \w5HP/s^n")  
add(Body511"\r2. \w255HP^n")  
add(Body511"\r0. \wExit^n")  
}  
else if (
iTeam == CS_TEAM_CT)  
{  
add(Body511"\rVIP Menu: \R\dCoun te r-Te rro r ist^n^n")  
add(Body511"\r1. \w3HP/s^n")  
add(Body511"\r2. \w200HP^n")  
add(Body511"\r0. \wExit^n")  
}  
new 
g_Keys = (1<<1<<1<<9)  
show_menu(idg_KeysBody, -1"menu_rod")  
return 
PLUGIN_CONTINUE  
}  
public 
Pressedrod(idkey)  
{  
new 
CsTeams:iTeam cs_get_user_team(id)  
switch(
key)  
{  
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)  
}  
}  
}  
else if (
iTeam == CS_TEAM_CT)  
{  
if(
is_user_alive(id))  
{  
new 
hp get_user_health(id);  
if(
hp 250)  
{  
set_task(1.0,"gydytojas2"id)  
}  
}  
}  
case 
1:  
{  
if (
iTeam == CS_TEAM_T)  
{  
set_user_health(id255)  
client_print(idprint_center".:: You have been healed +255 hp ::.")  
}  
else if (
iTeam == CS_TEAM_CT)  
{  
set_user_health(id200)  
client_print(idprint_center".:: You have been healed +200 hp ::.")  
}  
}  
default: return 
PLUGIN_HANDLED  
}  
return 
PLUGIN_CONTINUE  
}  
public 
death_msg( ) {  
new 
iAttacker read_data);  
if( 
get_user_flagsiAttacker ) & ADMIN_LEVEL_H )  
zp_set_user_ammo_packsiAttackerzp_get_user_ammo_packsiAttacker ) + get_pcvar_numg_pKillAmmo ) );  
}  
public 
gydytojas(id) {  
if( !
is_user_aliveid ) )  
{  
return 
PLUGIN_CONTINUE;  
}  
new 
hp get_user_health(id);  
if(
hp 3500)  
{  
set_user_health(idhp 5);  
set_task(1.0,"gydytojas"id);  
}  
else  
{  
client_print(idprint_chat"Daugiau HP nebegausi :)")  
return 
PLUGIN_HANDLED;  
}  
return 
PLUGIN_CONTINUE;  
}  
public 
gydytojas2(id) {  
if( !
is_user_aliveid ) )  
{  
return 
PLUGIN_CONTINUE;  
}  
new 
hp get_user_health(id);  
if(
hp 250)  
{  
set_user_health(idhp 3);  
set_task(1.0,"gydytojas2"id);  
}  
else  
{  
client_print(idprint_chat"Daugiau HP nebegausi :)")  
return 
PLUGIN_HANDLED;  
}  
return 
PLUGIN_CONTINUE;  
}  
public 
EventRoundEnd( )  
{  
for( new 
1<= g_iMaxPlayersi++ )  
{  
remove_task);  
}  



FaktuM 10-16-2009 13:44

Re: something wrong with Hp regeneration...
 
Try to intend code (CTRL + I) and edit your post. I don't have ZP.inc so can't check the error.

edga85 10-16-2009 13:47

Re: something wrong with Hp regeneration...
 
Already resolved....


All times are GMT -4. The time now is 22:38.

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