AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   MedicMod help (https://forums.alliedmods.net/showthread.php?t=56896)

icemant16 06-23-2007 12:53

MedicMod help
 
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 06-24-2007 16:29

Re: MedicMod help
 
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!:up:

icemant16 06-30-2007 13:03

Re: MedicMod help
 
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 07-02-2007 01:49

Re: MedicMod help
 
Ok if you fixed it you can have primary credit
i just want to put this on my server please
someone out there...

_Master_ 07-04-2007 13:47

Re: MedicMod help
 
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...

icemant16 07-15-2007 16:50

Re: MedicMod help
 
Thanks ill look into it.


All times are GMT -4. The time now is 21:29.

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