Raised This Month: $ Target: $400
 0% 

New health every round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Da_sk8rboy
Veteran Member
Join Date: Jul 2006
Old 11-15-2006 , 17:37   New health every round
Reply With Quote #1

I cant think of a way to make a users health go up every round.
[Automatically]
__________________
i stop around here and there.
Da_sk8rboy is offline
LittleDude
Member
Join Date: Dec 2004
Location: Selah, WA
Old 11-15-2006 , 17:49   Re: New health every round
Reply With Quote #2

register the new round event, and on the event of when the new round starts set the users health to what you want

so like:

Code:
 public plugin_init() {           register_plugin("test", "test", "test")           register_logevent("new_round", 2, "1=Round_Start") } public new_round(id) {           // set health here }
__________________
It is stupid to be stupid, and stupid to not be stupid

Last edited by LittleDude; 11-15-2006 at 17:57.
LittleDude is offline
Send a message via AIM to LittleDude
The Specialist
BANNED
Join Date: Nov 2006
Old 11-15-2006 , 18:00   Re: New health every round
Reply With Quote #3

here you go . this will add +10 on there first spawn. +20 on there second. and you can go up from there. basicly it increments the g_iRounds varaible every time the player spawns. (using VEN's theory of spawning ) . and then jsut get and set health. hope this helps
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define MAX_PLAYERS            32 new bool:g_restart_attempt[MAX_PLAYERS + 1] new g_iRounds[33]; public plugin_init() {  register_plugin("increase_health","0.1","The Specilaist");  register_event("ResetHUD", "event_hud_reset", "be")  register_clcmd("fullupdate", "clcmd_fullupdate")  register_event("TextMsg", "event_restart_attempt", "a", "2=#Game_will_restart_in") } public clcmd_fullupdate() {  return PLUGIN_HANDLED } public event_restart_attempt() {  new players[32], num  get_players(players, num, "a")  for (new i; i < num; ++i)  {   g_restart_attempt[players[i]] = true  } } public event_hud_reset(id) {  if (g_restart_attempt[id])  {   g_restart_attempt[id] = false   return  }  event_player_spawn(id) } public event_player_spawn(id) {  ++g_iRounds[id];    new health = get_user_health(id);    switch(g_iRounds[id])  {   case 0: set_user_health(id,(health + 10));   case 1: set_user_health(id,(health +20));  } }
The Specialist is offline
Send a message via AIM to The Specialist
LittleDude
Member
Join Date: Dec 2004
Location: Selah, WA
Old 11-15-2006 , 18:01   Re: New health every round
Reply With Quote #4

you're a god The Specialist lol
__________________
It is stupid to be stupid, and stupid to not be stupid
LittleDude is offline
Send a message via AIM to LittleDude
The Specialist
BANNED
Join Date: Nov 2006
Old 11-15-2006 , 18:04   Re: New health every round
Reply With Quote #5

Quote:
Originally Posted by LittleDude View Post
you're a god The Specialist lol
LOL. nope im just a nice guy who's borred
The Specialist is offline
Send a message via AIM to The Specialist
Da_sk8rboy
Veteran Member
Join Date: Jul 2006
Old 11-15-2006 , 20:49   Re: New health every round
Reply With Quote #6

case 1: set_user_health(id,(health +20));
Why +20 why not + 20 with a space like you did with 10.
__________________
i stop around here and there.
Da_sk8rboy is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-15-2006 , 20:52   Re: New health every round
Reply With Quote #7

or how about just
Code:
set_user_health(id, get_user_health(id) + (10*g_iRounds[id]))
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
The Specialist
BANNED
Join Date: Nov 2006
Old 11-15-2006 , 20:56   Re: New health every round
Reply With Quote #8

Quote:
Originally Posted by Da_sk8rboy View Post
case 1: set_user_health(id,(health +20));
Why +20 why not + 20 with a space like you did with 10.
oops lol. i made it in like 3 mins
The Specialist is offline
Send a message via AIM to The Specialist
Da_sk8rboy
Veteran Member
Join Date: Jul 2006
Old 11-15-2006 , 21:03   Re: New health every round
Reply With Quote #9

Code:
#include <amxmodx> #include <amxmisc> #include <fun>   #define PLUGIN "Life_Mod" #define VERSION "1.02b" #define AUTHOR "Da_sk8rboy" public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_concmd("amx_lifemod", "cmd_lifemod", ADMIN_SLAY, "<target> <hp>") }   public cmd_lifemod(id, level, cid) {      if (!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED        new Arg1[24]      new Arg2[4]        //Get the command arguments from the console      read_argv(1, Arg1, 23)      read_argv(2, Arg2, 3)        //Convert the health from a string to a number      new Health = str_to_num(Arg2)      if(Health < 1)      {           // Print a message saying health has to be greater than 0.           // If they get their health set to less than 1.           // It will kill the player automatically.           return PLUGIN_HANDLED;      }        //Is the first character the @ symbol?      if (Arg1[0] == '@')      {           new Team = 0           if (equali(Arg1[1], "CT"))           {                Team = 2           } else if (equali(Arg1[1], "T")) {                Team = 1           }           new players[32], num           get_players(players, num)           new i           for (i=0; i<num; i++)           {                if (!Team)                {                     set_user_health(players[i], Health)                } else {                     if (get_user_team(players[i]) == Team)                     {                          set_user_health(players[i], Health)                     }                }           }      } else {           new player = cmd_target(id, Arg1, 1)           if (!player)           {                console_print(id, "[LIFE_MOD] Sorry,%s could not be found or targetted!", Arg1)                return PLUGIN_HANDLED           } else {                set_user_health(player, Health)           }      }        return PLUGIN_HANDLED          }

where would i put:
Code:
set_user_health(id, get_user_health(id) + (10*g_iRounds[id]))
__________________
i stop around here and there.
Da_sk8rboy is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-15-2006 , 21:09   Re: New health every round
Reply With Quote #10

well youd have to use my version if you wanted to add that becuase i used a varaible to count rounds . do you want the amount of health to increment each round or jsut liek +10 each round?
The Specialist is offline
Send a message via AIM to The Specialist
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 06:59.


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