Raised This Month: $ Target: $400
 0% 

MedicMod help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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