Raised This Month: $ Target: $400
 0% 

VS Health Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kmal2t
BANNED
Join Date: Apr 2006
Old 04-17-2006 , 05:23   VS Health Plugin
Reply With Quote #1

brawr

Last edited by kmal2t; 05-21-2007 at 04:28.
kmal2t is offline
Sandurr
Senior Member
Join Date: Aug 2005
Old 04-17-2006 , 11:40  
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {     register_plugin("License To Kill Modified","1.0","Hawk552/Sandurr")     register_cvar("amx_slayer","0")     register_cvar("amx_vampire","0")     register_event("ResetHUD","ltk", "be")     register_clcmd("amx_slayer_on","slayer_on",ADMIN_CVAR," <hp> - turns on LTK mode with defined HP")     register_clcmd("amx_vampire_on","vampire_on",ADMIN_CVAR," <hp> - turns on LTK mode with defined HP")     register_clcmd("amx_slayer_off","slayer_off",ADMIN_CVAR," - turns LTK mode off")     register_clcmd("amx_vampire_off","vampire_off",ADMIN_CVAR," - turns LTK mode off")     return PLUGIN_CONTINUE } public slayer_on(id,level,cid) {     if (!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED;     new hp[10]     read_argv(1,hp,9)     server_cmd("amx_ltk %s",hp)     for(new i=0;i<=32;i++)     {         if(is_user_connected(i) && is_user_alive(i) && get_team_int(i) == 2)             set_user_health(i,str_to_num(hp))     }     client_print(0,print_chat,"[AMXX] LTK mode has been enabled with %s HP!",hp)     return PLUGIN_HANDLED; } public vampire_on(id,level,cid) {     if(!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED;     new hp[10]     read_argv(1,hp,9)     server_cmd("amx_ltk %s",hp)     for(new i=0;i<=32;i++)     {         if(is_user_connected(i) && is_user_alive(id) && get_team_int(id))             set_user_health(i,str_to_num(hp))     }     client_print(0,print_chat,"[AMXX] LTK mode has been enabled with %s HP!",hp)     return PLUGIN_HANDLED; } public slayer_off(id,level,cid) {     if(!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED;     for(new i=0;i<=32;i++)     {         if(is_user_connected(i) && is_user_alive(i))             set_user_health(i,100)     }     client_print(0,print_chat,"[AMXX] LTK mode has been disabled.")     server_cmd("amx_slayer 0")     return PLUGIN_HANDLED; } public vampire_off(id,level,cid) {     if(!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED;     for(new i=0;i<=32;i++)     {         if(is_user_connected(i) && is_user_alive(i))             set_user_health(i,100)     }     client_print(0,print_chat,"[AMXX] LTK mode has been disabled.")     server_cmd("amx_vampire 0")     return PLUGIN_HANDLED; } public slayer(id) {     if(!get_cvar_num("amx_slayer")==0)         return PLUGIN_HANDLED;     set_user_health(id,get_cvar_num("amx_slayer"))     return PLUGIN_HANDLED; } public vampire(id) {     if(!get_cvar_num("amx_vampire"))             return PLUGIN_HANDLED;     set_user_health(id,get_cvar_num("amx_vampire"))     return PLUGIN_HANDLED; } stock get_team_int(id) {     new TeamString[8]     get_user_team(id,TeamString,7)     if(equali(TeamString,"VAMPIRE"))         return 1;     if(equali(TeamString,"SLAYER"))         return 2;     return 0; }

Don't know if it works or something lol
Sandurr is offline
kmal2t
BANNED
Join Date: Apr 2006
Old 04-17-2006 , 18:18  
Reply With Quote #3

brawr

Last edited by kmal2t; 05-21-2007 at 04:28.
kmal2t is offline
Wolle
Member
Join Date: Jun 2005
Location: Berlin / Germany
Old 04-17-2006 , 21:40  
Reply With Quote #4

Despite the fact that most of the stuff in your code doesn't make any sense
I rewrote the slayer_on function so you now can set alive players' health to the desired amount through amx_slayer_on.
It doesn't achive anything concerning the goal of your plugin but it will help you understand what way you got to walk.

I left my name comment in the lines I added or modified so you know what changed.
Note that only amx_slayer_on will work!
You still have alot to do.

Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {     register_plugin("License To Kill Modified","1.0","Hawk552/Sandurr/Wolle")     register_cvar("amx_slayer","0")     register_cvar("amx_vampire","0")     //register_event("ResetHUD","ltk", "be") // Wolle     register_clcmd("amx_slayer_on","slayer_on",ADMIN_CVAR," <hp> - turns on LTK mode with defined HP")     register_clcmd("amx_vampire_on","vampire_on",ADMIN_CVAR," <hp> - turns on LTK mode with defined HP")     register_clcmd("amx_slayer_off","slayer_off",ADMIN_CVAR," - turns LTK mode off")     register_clcmd("amx_vampire_off","vampire_off",ADMIN_CVAR," - turns LTK mode off")     return PLUGIN_CONTINUE } public slayer_on(id,level,cid) {     if (!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED;             new hp1[10]     read_argv(1,hp1,9)         //server_cmd("amx_slayer %s",hp1) // Wolle     new iPlayerCount;   // Wolle     new Players[32];    // Wolle         get_players( Players, iPlayerCount, "ac" ); // Wolle     for(new i=0;i<iPlayerCount;i++) // Wolle     {         //if(is_user_connected(i) && is_user_alive(i) && get_team_int(id) == 2) // Wolle             set_user_health( Players[i],str_to_num(hp1)) // Wolle     }     client_print(0,print_chat,"[AMXX] LTK mode has been enabled with %s HP!",hp1)     return PLUGIN_HANDLED; } public vampire_on(id,level,cid) {     if(!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED;     new hp2[10]     read_argv(1,hp2,9)     server_cmd("amx_vampire %s",hp2)     for(new i=0;i<=32;i++)     {         if(is_user_connected(i) && is_user_alive(id) && get_team_int(id) == 1)             set_user_health(i,str_to_num(hp2))     }     client_print(0,print_chat,"[AMXX] LTK mode has been enabled with %s HP!",hp2)     return PLUGIN_HANDLED; } public slayer_off(id,level,cid) {     if(!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED;     for(new i=0;i<=32;i++)     {         if(is_user_connected(i) && is_user_alive(i))             set_user_health(i,100)     }     client_print(0,print_chat,"[AMXX] LTK mode has been disabled.")     server_cmd("amx_slayer 0")     return PLUGIN_HANDLED; } public vampire_off(id,level,cid) {     if(!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED;     for(new i=0;i<=32;i++)     {         if(is_user_connected(i) && is_user_alive(i))             set_user_health(i,100)     }     client_print(0,print_chat,"[AMXX] LTK mode has been disabled.")     server_cmd("amx_vampire 0")     return PLUGIN_HANDLED; } public slayer(id) {     if( !get_cvar_num("amx_slayer"))    // Wolle [was -> if(!get_cvar_num("amx_slayer")==0)]         return PLUGIN_HANDLED;     set_user_health(id,get_cvar_num("amx_slayer"))     return PLUGIN_HANDLED; } public vampire(id) {     if(!get_cvar_num("amx_vampire"))               return PLUGIN_HANDLED;     set_user_health(id,get_cvar_num("amx_vampire"))     return PLUGIN_HANDLED; } stock get_team_int(id) {     new TeamString[8]     get_user_team(id,TeamString,7)     if(equali(TeamString,"VAMPIRE"))         return 1;     if(equali(TeamString,"SLAYER"))         return 2;     return 0; }
__________________
Become part of games development!
http://www.games-academy.de
Wolle is offline
Send a message via AIM to Wolle
kmal2t
BANNED
Join Date: Apr 2006
Old 04-18-2006 , 00:14  
Reply With Quote #5

After many attempts I give up. I'll just have to deal with it being the same for both teams. :\
kmal2t is offline
kmal2t
BANNED
Join Date: Apr 2006
Old 12-26-2006 , 02:34   Health Plugin
Reply With Quote #6

brawr

Last edited by kmal2t; 05-21-2007 at 04:28.
kmal2t is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 12-26-2006 , 03:07   Re: VS Health Plugin
Reply With Quote #7

Well I don't think "slayer" or "vampire" are valid teams in Counter-Strike.
stupok is offline
kmal2t
BANNED
Join Date: Apr 2006
Old 12-26-2006 , 04:19   Re: VS Health Plugin
Reply With Quote #8

Everyone here always assumes people just play CS. This is supposed to be for the mod Vampire Slayer.
kmal2t is offline
|POW|Da_ghost
Senior Member
Join Date: Nov 2006
Location: http://snarkcafe.net
Old 12-26-2006 , 07:47   Re: VS Health Plugin
Reply With Quote #9

Correct me If i'm wrong but aren't teams Tracked by numbers?(I may be confusing this With ES(source))
__________________
If you want me to help you with something please contact me on msn or xfire(Daghost1337)
|POW|Da_ghost is offline
Send a message via AIM to |POW|Da_ghost Send a message via MSN to |POW|Da_ghost
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 12-26-2006 , 08:48   Re: VS Health Plugin
Reply With Quote #10

Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_plugin("VS Limb Remover", "1.0", "Skittles")     register_logevent("roundstart", 2, "0=World triggered", "1=Round_Start") } public roundstart(id)     set_task(1.0,"delay",id) public delay(id) {     server_print("executes function")     new players[32], num, strTeam[32], p;     get_players(players, num)         for ( new i ; i < num ; i++ ) {                 p = players[i]                 get_user_team(p, strTeam, 31) // other parameter is a return. was id.                 if ( equal(strTeam, "SLAYER", 5) )             set_user_health(p, 95) // was id.                     else if ( equal(strTeam, "VAMPIRE", 7) )             set_user_health(p, 100) // was id.     } }
Quote:
Originally Posted by |POW|Da_ghost View Post
Correct me If i'm wrong but aren't teams Tracked by numbers?(I may be confusing this With ES(source))
You can do it both ways.

Last edited by [ --<-@ ] Black Rose; 12-26-2006 at 17:58.
[ --<-@ ] Black Rose is offline
Reply



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 05:10.


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