Raised This Month: $ Target: $400
 0% 

MedicMod help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
icemant16
Junior Member
Join Date: Jan 2007
Old 06-23-2007 , 12:53   MedicMod help
Reply With Quote #1

Ok i compiled the plugin, no errors!
I put it on my server, still no errors!
I went to revive one of my teammates and it doesn't work!
please help
Here is the code
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>



#define PLUGIN "Medic Mod"
#define VERSION "1.0"
#define AUTHOR "IcemanT16"

new death_spot[32][3];
new alive_spot[32][3];
new bool:healing[32];

public plugin_init() {
    register_plugin("MedicMod", "1.0", "IcemanT16");
    register_clcmd ("+heal","heal");
    register_clcmd ("-heal","stop_heal");
    register_event("DeathMsg", "event_deathmsg", "a");
    register_logevent("roundstart", 2, "0=World triggered", "1=Round_Start");
    
    /////////////////////////////////////////
    new i;
    for(i=0; i<32; i++)
    {
        death_spot[i][0]=0;
        death_spot[i][1]=0;
        death_spot[i][2]=0;
    }
    ////////////////////////////////////////
}
public roundstart(){
    new i;
    for(i=0; i<32; i++)
    {
        death_spot[i][0]=0;
        death_spot[i][1]=0;
        death_spot[i][2]=0;
    }
    
}

public event_deathmsg() {
    new id = read_data(2);
    get_user_origin(id, death_spot[id]);
}
 
public heal(id){
    get_user_origin(id,alive_spot[id]);
    new i;
    for(i=0;i<32;i++)
        if(death_spot[i][0]>alive_spot[id][0]-10&&death_spot[i][0]<alive_spot[id][0]+10
         &&death_spot[i][1]>alive_spot[id][1]-10&&death_spot[i][1]<alive_spot[id][1]+10
         &&death_spot[i][2]>alive_spot[id][2]-10&&death_spot[i][2]<alive_spot[id][2]+10
         &&is_user_connected(i)&&!is_user_alive(i))
        {
            new temp_time = get_user_time(id);
            do_freeze(id);
            new check_time = -0;
            while (temp_time + 5>get_user_time(id))
            {
                if(get_user_time(id)-temp_time!=check_time)
                {
                    new tempnum;
                    tempnum = get_user_time(id)-temp_time;
                    set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 12.0);
                    show_hudmessage(id, "Reviving in %i seconds...",tempnum);
                }
                check_time = get_user_time(id)-temp_time;
                
            }
            do_thaw(id)
            if(is_user_alive(id))// if the player is still alive
            {
                spawn (i);
                set_user_origin(i,death_spot[i]);
                set_user_health(i,5);
                cs_set_user_deaths(i,cs_get_user_deaths(i)-1);
            }
            break;
        }
    for(i=0;i<32;i++)
        if(death_spot[i][0]>alive_spot[id][0]-10&&death_spot[i][0]<alive_spot[id][0]+10
         &&death_spot[i][1]>alive_spot[id][1]-10&&death_spot[i][1]<alive_spot[id][1]+10
         &&death_spot[i][2]>alive_spot[id][2]-10&&death_spot[i][2]<alive_spot[id][2]+10
         &&is_user_connected(i)&&is_user_alive(i)&&get_user_health(i)<100)
         {
            healing[id]=true;
            new temp_time = get_user_time(id);
            new check_time = -0;
            while(healing[id]&&is_user_alive(id))
            {    
                while (temp_time + 1>get_user_time(id))
                {
                    if(get_user_time(id)-temp_time!=check_time)
                    {
                        set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 12.0)
                        show_hudmessage(id, "Healing...")
                    }
                    check_time = get_user_time(id)-temp_time;
                }
                if(get_user_health(i)<96&&is_user_alive(i))
                    set_user_health(i,get_user_health(i)+5);
                else
                {
                    if(get_user_health(i)>100)
                        set_user_health(i,100)
                    
                    healing[id]=false;
                }
            }
        }
}

public stop_heal(id)
{
    healing[id]=false;    
}

public do_freeze(id)
{

    entity_get_vector(id,EV_VEC_origin,alive_spot[id]);
    set_user_rendering(id,kRenderFxGlowShell,0,0,200,kRenderTransAlpha,125); //glow shell blue, transparent
}

public do_thaw(id)
{
    set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,255); //return normal rendering and alpha
}
icemant16 is offline
icemant16
Junior Member
Join Date: Jan 2007
Old 06-24-2007 , 16:29   Re: MedicMod help
Reply With Quote #2

For anyone who is trying to help.
The idea of the plugin is to allow people to revive dead teamates and heal them.

Also
  • 5 sec frozen state for the person who is trying to revive the other.
  • when a person is revived all the have is 5 health and a knife.
  • can only revive one person at a time
  • when healing the health of the person goes up 5 every second
  • can heal any teamate at any time
  • person has to be close to the alive or dead person.
Please someone help!
icemant16 is offline
icemant16
Junior Member
Join Date: Jan 2007
Old 06-30-2007 , 13:03   Re: MedicMod help
Reply With Quote #3

hey now i've waited a week or so, i now just wanted someone to reply. If could someone please tell me somthing i messed up, please i want to put this mod on my server.
thanks,
Tom
icemant16 is offline
icemant16
Junior Member
Join Date: Jan 2007
Old 07-02-2007 , 01:49   Re: MedicMod help
Reply With Quote #4

Ok if you fixed it you can have primary credit
i just want to put this on my server please
someone out there...
icemant16 is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 07-04-2007 , 13:47   Re: MedicMod help
Reply With Quote #5

You seem to have major concept issues. You should review your "heal" code.
Also NEVER user a full for loop to check every single player slot, use get_players() instead. There ARE still other conceptual issues...

There are countless numbers of "revive" and "heal" plugins. You should just look into it...
_Master_ is offline
icemant16
Junior Member
Join Date: Jan 2007
Old 07-15-2007 , 16:50   Re: MedicMod help
Reply With Quote #6

Thanks ill look into it.
icemant16 is offline
Reply


Thread Tools
Display Modes

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 21:29.


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