
/****************************************************************************************************************** 
*  AMX Mod script. 
* 
*  Star Wars Force Mode Script 0.2 Beta
*  by Ivan <-g-s-ivan@web.de>
* 
*  Client Console Commands: 
* 
*  force_prev - Selects the previous Force Power
*  force_next - Selects the next Force Power
*  force_use - Uses selected Force Power 
*
*  Put the force directory to your Half-Life/~mod~/sounds dir!
*
*  http://gw.daddeln.de/amx/force/force.zip
*  http://gw.daddeln.de/amx/force/
*
******************************************************************************************************************/ 



#include <amxmod> 

// Uncomment this for a debug build!
//#define DEBUG

#define FORCE_HEAL 500

#define FH_ADD 25
#define FORCE_LIGHTNING 50
#define FORCE_CLIGHTNING 1000
#define FORCE_PERSUSASION 400
#define FORCE_GRIP 450
#define FORCE_SPEED 50
#define FORCE_JUMP 50
#define FORCE_PUSH 50

#define FORCE_PROTECTION 750

#define FORCE_SEEING 50

#define FORCE_ADDITION 15

#define FORCE_MAX 2500

#define FORCE_AMOUNT 9

// This is for CS only, but maybe changed for other Mods.

//#define FORCE_SITH "TERRORIST"
//#define FORCE_JEDI "CT"

new forcelevels[33];
new currentforce[33];
new userspeed[33];
new lilc;


///
new smoke, light, white;
sfx_lightning(vec1[3],vec2[3],amplitude=30,speed=200) 
{ 
    //Lightning 
    message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
    write_byte( 0 );
    write_coord(vec1[0]);
    write_coord(vec1[1]);
    write_coord(vec1[2]);
    write_coord(vec2[0]);
    write_coord(vec2[1]);
    write_coord(vec2[2]);
    write_short( light );
    write_byte( 1 ); // framestart 
    write_byte( 5 ); // framerate 
    write_byte( 2 ); // life 
    write_byte( 20 ); // width 
    //write_byte( 30 ); // noise 
    write_byte(amplitude);
    write_byte( 200 ); // r, g, b 
    write_byte( 200 ); // r, g, b 
    write_byte( 200 ); // r, g, b 
    write_byte( 200 ); // brightness 
    write_byte( speed ); // speed 
    message_end();

    //Sparks 

    message_begin( MSG_PVS, SVC_TEMPENTITY,vec2) 
    write_byte( 9 ) 
    write_coord( vec2[0] ) 
    write_coord( vec2[1] ) 
    write_coord( vec2[2] ) 
    message_end() 
    
    //Smoke     

    message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec2) 
    write_byte( 5 ) 
    write_coord(vec2[0]) 
    write_coord(vec2[1]) 
    write_coord(vec2[2]) 
    write_short( smoke ) 
    write_byte( 10 )  
    write_byte( 10 )  
    message_end() 
    
} 
///

has_force(id,need) {
    if((forcelevels[id]-need)>=0) {
        return 1;
    } else {
        return 0;
    }
    return 0;
}

beep(id) {
    //emit_sound(id,CHAN_ITEM, "force/beep.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
    client_cmd(id,"spk ^"force/beep.wav^";"); // <-- better
    return 1;
}

showforce(id) {
//    client_print(id,print_chat,"Nr.: %i",currentforce[id]);
    switch(currentforce[id]) {
        case 1: // Force Healing
        client_print(id,print_center,"*** Force Healing ***");
        case 2: // Force pers
        client_print(id,print_center,"*** Force Persusasion ***");
        case 3:
        client_print(id,print_center,"*** Force Speed ***");
        case 4:
        client_print(id,print_center,"*** Force Jump ***");
        case 5:
        client_print(id,print_center,"*** Force Push ***");
        case 6:
        client_print(id,print_center,"*** Force Lightning ***");
        case 7:
        client_print(id,print_center,"*** Force Chain Lightning ***");
        case 8:
        client_print(id,print_center,"*** Force Seeing ***");
        case 9:
        client_print(id,print_center,"*** Force Protection ***");
    }
    beep(id);
}

force_heal(id) {
    if(has_force(id,FORCE_HEAL)) {
        if((get_user_health(id)) == 100) {
            client_print(id,print_center,"You dont need Force Healing");
            beep(id);
            return PLUGIN_HANDLED
        } else {
            if((get_user_health(id)+FH_ADD)>100) {
                forcelevels[id]-=FORCE_HEAL;
                set_user_health(id,100);

                emit_sound(id,CHAN_ITEM, "force/force_heal.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
                client_print(id,print_center,"Done.");
            } else {
                forcelevels[id]-=FORCE_HEAL;
                set_user_health(id,get_user_health(id)+FH_ADD);
                emit_sound(id,CHAN_ITEM, "force/force_heal.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
                client_print(id,print_center,"Done.");
            }
        }
    }
    return PLUGIN_HANDLED;
}

force_persusasion(id) {
    if(has_force(id,FORCE_PERSUSASION)) {
        forcelevels[id]-=FORCE_PERSUSASION; //kRenderFxGlowShell,kRenderNormal
        set_user_rendering(id,19,8,8,8,1,8);
        emit_sound(id,CHAN_ITEM, "force/force_p.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        client_print(id,print_center,"Persusated for 25 secs.");
        new idx[1];
        idx[0]=id;
        set_task(25.0,"unper",0,idx,1);
    }
    return PLUGIN_HANDLED;
}

public unper(idx[1]) {
    set_user_rendering(idx[0],kRenderFxNone);
    client_print(idx[0],print_center,"Persusasion is over!");
    return PLUGIN_HANDLED;
}

force_speed(id) {
    if(has_force(id,FORCE_SPEED) && userspeed[id]!=1) {
        forcelevels[id]-=FORCE_SPEED; //kRenderFxGlowShell,kRenderNormal
        set_user_maxspeed(id,0);
        userspeed[id]=1;
        emit_sound(id,CHAN_ITEM, "force/force_speed_start.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        emit_sound(id,CHAN_ITEM, "force/force_speed_loop.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        client_print(id,print_center,"Speed enhanced for 25 secs.");
        new idx[1];
        idx[0]=id;
        set_task(25.0,"unspeed",0,idx,1);
    }
    return PLUGIN_HANDLED;
}

public unspeed(idx[1]) {
    userspeed[idx[0]]=0;
    console_cmd(idx[0],"weapon_knife");
    console_cmd(idx[0],"lastinv");
    client_print(idx[0],print_center,"Hi Speed is over!");
    return PLUGIN_HANDLED;
}

force_jump(id) {
    if(has_force(id,FORCE_JUMP)) {
        forcelevels[id]-=FORCE_JUMP; //kRenderFxGlowShell,kRenderNormal
        set_user_gravity(id,0.2);
        console_cmd(id,"+jump");
        console_cmd(id,"-jump");
        emit_sound(id,CHAN_ITEM, "force/force_jump.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        client_print(id,print_center,"Force Jump! (10secs)");
        new idx[1];
        idx[0]=id;
        set_task(10.0,"unjump",0,idx,1);
    }
    return PLUGIN_HANDLED;
}

public unjump(idx[1]) {
    set_user_gravity(idx[0],1.0);
    client_print(idx[0],print_center,"Jumping is over!");
    return PLUGIN_HANDLED;
}

force_push(id) {
    if(has_force(id,FORCE_PUSH)) {
        emit_sound(id,CHAN_ITEM, "force/force_push.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        client_print(id,print_center,"Push");
        new size = 96+96;
        new porg[3];
        new players[32];
        new inum;
        new vec1[3];
        new ownersteam[33];
        new victimteam[33];
        get_user_origin(id,vec1,3);
        new vecx[3];
        new someonepushed;
	someonepushed = 0;
	get_user_origin(id,vecx,0);
	if(get_distance(vec1,vecx)>840) {
            client_print(id,print_center,"No enemies within Range!"); 
            return PLUGIN_HANDLED;
        }
        get_players(players,inum,"a") 
        for(new i = 0 ;i < inum ;++i) {
            get_user_team(players[i], victimteam,32);
            if(players[i]==id || equal(victimteam,ownersteam)) {continue;}
            get_user_origin(players[i],porg);
            if( ! (vec1[0]-porg[0] > size || vec1[0]-porg[0] < - size ||  
                   vec1[1]-porg[1] > size || vec1[1]-porg[1] < - size || 
                   vec1[2]-porg[2] > size || vec1[2]-porg[2] < - size) ) { 
                user_slap(players[i],0);
                client_print(players[i],print_center,"*** You have been pushed! ***");
		someonepushed = 1;
            }
        }
	if(someonepushed>0) forcelevels[id]-=FORCE_PUSH;
    }
    return PLUGIN_HANDLED;
}

force_lightning(id) {
    if(has_force(id,FORCE_LIGHTNING)) {
        new vec1[3];
        new lastvec[3];

        new ownersteam[33];
        new victimteam[33];
        new killer[33];
        new victim[33];
        new param[8];
        new vecx[3];
        get_user_team(id, ownersteam,32);
        get_user_name(id,killer,32)

        get_user_origin(id,vec1,3);
        get_user_origin(id,vecx,0);

        lastvec=vec1;
        param[3]=lastvec[0];
        param[4]=lastvec[1];
        param[5]=lastvec[2];
        param[0]=vecx[0];
        param[1]=vecx[1];
        param[2]=vecx[2];
        param[6]=3000;
        param[7]=30;
        set_task(0.1, "lighter",0,param,8,"a", 5);

        forcelevels[id]-=FORCE_LIGHTNING;
        emit_sound(id,CHAN_ITEM, "force/force_lightning.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        client_print(id,print_center,"Force Lightning");
        new victimid=0,body;
        get_user_aiming(id,victimid,body);
        new damage;
        if(victimid!=0) {
            get_user_name(victimid,victim,32);
            get_user_team(victimid, victimteam,32);
            if(equal(victimteam,ownersteam)) return PLUGIN_HANDLED;
            damage = 15;
            if(body==1) damage = 1000;
            if(get_user_health(victimid)-damage<0) {
                user_kill(victimid,1); 
                set_user_frags(id,get_user_frags(id)+1);
                client_print(victimid,print_center,"*** You have been killed by Force Lightning! ***");
                client_print(0,print_chat,"%s killed %s with Force Lightning!",killer,victim);
            } else {
                set_user_health(victimid,get_user_health(victimid)-damage);
                client_print(victimid,print_center,"*** You have been shocked by Force Lightning! ***");
            }
        }

    }
    return PLUGIN_HANDLED;
}

force_clightning(id) {
    if(has_force(id,FORCE_CLIGHTNING)) {
        new size = 96+96+96; //96;
        new porg[3];
        new players[32];
        new inum;
        new vec1[3];
        new lastvec[3];

        new ownersteam[33];
        new victimteam[33];
        new killer[33];
        new victim[33];
        new param[8];
        new vecx[3];
        new shocked_someone = 0;
        get_user_team(id, ownersteam,32);
        get_user_name(id,killer,32)

        get_user_origin(id,vec1,3);
        get_user_origin(id,vecx,0);

        if(get_distance(vec1,vecx)>840) {
            client_print(id,print_center,"No enemies within Range!"); 
            return PLUGIN_HANDLED;
        }
        emit_sound(id,CHAN_ITEM, "force/force_lightning.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        client_print(id,print_center,"Force Chain Lightning");
        get_players(players,inum,"a") 
        for(new i = 0 ;i < inum ;++i) {
            get_user_team(players[i], victimteam,32);
            if(players[i]==id || equal(victimteam,ownersteam)) {continue;}
            get_user_origin(players[i],porg);
            if( ! (vec1[0]-porg[0] > size || vec1[0]-porg[0] < - size ||  
                   vec1[1]-porg[1] > size || vec1[1]-porg[1] < - size || 
                   vec1[2]-porg[2] > size || vec1[2]-porg[2] < - size) ) { 
                shocked_someone = 1;
                get_user_name(players[i],victim,32);
                param[0]=lastvec[0];
                param[1]=lastvec[1];
                param[2]=lastvec[2];
                param[3]=porg[0];
                param[4]=porg[1];
                param[5]=porg[2];
                param[6]=3000;
                param[7]=200;
                set_task(0.1, "lighter",0,param,8,"a", 5);
                lastvec=porg;
                set_user_health(players[i],get_user_health(players[i])-60)
                if(get_user_health(players[i])-15<0) {
                    user_kill(players[i],1); 
                    set_user_frags(id,get_user_frags(id)+1);
                    client_print(players[i],print_center,"*** You have been killed by Force Chain Lightning! ***");
                    client_print(0,print_chat,"%s killed %s with Force Chain Lightning!",killer,victim);
                } else {
                    set_user_health(players[i],get_user_health(players[i])-15)
                    client_print(players[i],print_center,"*** You have been shocked by Force Chain Lightning! ***");
                }
                emit_sound(players[i],CHAN_ITEM, "force/force_lightning_hit.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        
            }
            
        }
        if(shocked_someone==1) {
            forcelevels[id]-=FORCE_CLIGHTNING;
            lastvec=vec1;
            param[3]=lastvec[0];
            param[4]=lastvec[1];
            param[5]=lastvec[2];
            param[0]=vecx[0];
            param[1]=vecx[1];
            param[2]=vecx[2];
            param[6]=3000;
            param[7]=30;
            set_task(0.1, "lighter",0,param,8,"a", 5);
        }
    }
    return PLUGIN_HANDLED;
}

public lighter(param[8]) {
new vec1[3];
new vec2[3];
new ampl = param[6];
new speed = param[7];
vec1[0]=param[0];
vec1[1]=param[1];
vec1[2]=param[2];
vec2[0]=param[3];
vec2[1]=param[4];
vec2[2]=param[5];
sfx_lightning(vec1,vec2,ampl,speed);
return 1;
}

force_seeing(id) {
    if(has_force(id,FORCE_SEEING)) {
        forcelevels[id]-=FORCE_SEEING; //kRenderFxGlowShell,kRenderNormal
        emit_sound(id,CHAN_ITEM, "force/force_p.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        client_print(id,print_center,"Force Seeing");
        new idx[1];
        idx[0]=id;
        set_task(1.0,"lightforce",0,idx,25,"a",25);
    }
    return PLUGIN_HANDLED;
}

public lightforce(idx[1]) {
        // coord, coord, coord (pos) 
        // byte (radius in 10's) 
        // byte byte byte (color)
        // byte (brightness)
        // byte (life in 10's)
        // byte (decay rate in 10's)
    new vec2[3];
    get_user_origin(idx[0],vec2,1);
    message_begin(MSG_ONE,SVC_TEMPENTITY, {0,0,0}, idx[0]);
    write_byte( 27 );
    write_coord(vec2[0]);
    write_coord(vec2[1]);
    write_coord(vec2[2]);
    write_byte(200); // whole map :D
    write_byte(150); // r
    write_byte(150); // g
    write_byte(255); // b
    write_byte(600); // radius
    write_byte(10); // radius
    write_byte(1); // radius
    message_end();
    new players[32];
    new c;
    new vec1[3];
    get_players(players,c,"a");
    for(new i = 0; i < c; i++) {
    if(players[i]==idx[0]) continue;
    get_user_origin(players[i],vec1,0);
    message_begin(MSG_ONE,SVC_TEMPENTITY,vec1, idx[0])  
    write_byte( 21 );  
    write_coord(vec1[0]);  
    write_coord(vec1[1]);  
    write_coord(vec1[2] + 16);  
    write_coord(vec1[0]);  
    write_coord(vec1[1]);  
    write_coord(vec1[2] + 760);  //1936
    write_short( white );  
    write_byte( 0 ); // startframe 
    write_byte( 1 ); // framerate 
    write_byte( 6 ); // 3 life 2 
    write_byte( 8 ); // width 16 
    write_byte( 1 ); // noise 
    write_byte( 100 ); // r 
    write_byte( 100 ); // g 
    write_byte( 255 ); // b 
    write_byte( 255 ); //brightness 
    write_byte( 0 ); // speed 
    message_end();
    }
    return PLUGIN_HANDLED;
}

force_god(id) {
    if(has_force(id,FORCE_MAX)) {
        forcelevels[id]-=FORCE_MAX; //kRenderFxGlowShell,kRenderNormal
        set_user_rendering(id,19,100,100,100,1,16);
        set_user_godmode(id,1);
        emit_sound(id,CHAN_ITEM, "force/force_p.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        client_print(id,print_center,"You have immunity against weapons.");
        set_hudmessage(0, 0, 255, 0.05, 0.70 + 2 / 35.0, 0, 6.0, 6.0, 0.5, 0.15, 2);
        //new playername[33];
        //get_user_name(id,playername,33);
        //show_hudmessage(0,"%s has become more powerful than you can possibly imagine.",playername);
        new idx[1];
        idx[0]=id;
        set_task(35.0,"ungod",0,idx,1);
        new vec2[3];
        get_user_origin(id,vec2,1);
        vec2[2]-=16;
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte( 14 );
        write_coord(vec2[0]);
        write_coord(vec2[1]);
        write_coord(vec2[2]);
        write_byte( 1500 );
        write_byte( 1000 );
        write_byte( 20 ); 
        message_end();
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte( 14 );
        write_coord(vec2[0]);
        write_coord(vec2[1]);
        write_coord(vec2[2]);
        write_byte( 1500 );
        write_byte( 1000 );
        write_byte( 20 ); 
        message_end();
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte( 14 );
        write_coord(vec2[0]);
        write_coord(vec2[1]);
        write_coord(vec2[2]);
        write_byte( 1500 );
        write_byte( 1000 );
        write_byte( 20 ); 
        message_end();
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte( 14 );
        write_coord(vec2[0]);
        write_coord(vec2[1]);
        write_coord(vec2[2]);
        write_byte( 1500 );
        write_byte( 1000 );
        write_byte( 20 ); 
        message_end();
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte( 14 );
        write_coord(vec2[0]);
        write_coord(vec2[1]);
        write_coord(vec2[2]);
        write_byte( 1500 );
        write_byte( 1000 );
        write_byte( 20 ); 
        message_end();
        message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte( 27 );
        write_coord(vec2[0]);
        write_coord(vec2[1]);
        write_coord(vec2[2]);
        write_byte( 100 ); // radius	
        write_byte( 150 ); // count
        write_byte( 150 ); // count
        write_byte( 255 ); // count
        write_byte( 10000 ); // radius
        write_byte( 20 ); // radius
        write_byte( 20); // radius
        message_end();
    }
    return PLUGIN_HANDLED;
}

public ungod(idx[1]) {
    set_user_rendering(idx[0],kRenderFxNone);
    set_user_godmode(idx[0],0);
    client_print(idx[0],print_center,"Woundable again.");
    return PLUGIN_HANDLED;
}


public client_command(id) {
    if(userspeed[id]==1) {
        set_user_maxspeed(id,0);
    }
    return PLUGIN_CONTINUE;
}


public force_next(id) {
    if(!is_user_alive(id)) return PLUGIN_HANDLED;
    if((currentforce[id])==FORCE_AMOUNT) {
        currentforce[id]=1;
    } else {
        currentforce[id]+=1;
    }
    showforce(id);
    return PLUGIN_HANDLED;
}

public force_prev(id) {
    if(!is_user_alive(id)) return PLUGIN_HANDLED;
    if(currentforce[id]-1==0) {
        currentforce[id]=FORCE_AMOUNT;
    } else {
        currentforce[id]-=1;
    }
    showforce(id);
    return PLUGIN_HANDLED;
}

public force_use(id) {
    if(!is_user_alive(id)) return PLUGIN_HANDLED;
    switch(currentforce[id]) {
        case 1: // Force Healing
        force_heal(id);
        case 2: // F Persus.
        force_persusasion(id);
        case 3: // F Speed.
        force_speed(id);
        case 4: // F Jump.
        force_jump(id);
        case 5: // F Jump.
        force_push(id);
        case 6: // F Jump.
        force_lightning(id);
        case 7: // F Jump.
        force_clightning(id);
        case 8: // F Jump.
        force_seeing(id);
        case 9: // F Jump.
        force_god(id);
    }
    return PLUGIN_HANDLED;
}

public checkforce() {
    new players[32];
    new count;
    get_players(players, count, "a");
    //                                 x   y
    //set_hudmessage(255, 255, 255, 5, 0.1, 0, 1.5, 1.5, 0.1, 0.2,4);
    lilc++;
    if(lilc==150) { //300
        intro();
        lilc=0;
    }
    for(new i=0;i<count; ++i) {
        if(currentforce[players[i]]==0) currentforce[players[i]]=1;
        if(forcelevels[players[i]]+FORCE_ADDITION>=FORCE_MAX) {
            forcelevels[players[i]] = FORCE_MAX;
        } else {
	    forcelevels[players[i]]+=FORCE_ADDITION;
        }
        set_hudmessage(255, 255, 255, -1.0, 0.85, 0, 0.0, 3.0, 0.0, 0.5, 1);
        show_hudmessage(players[i],"Force: %i",forcelevels[players[i]]); 
    }

    return PLUGIN_HANDLED;
}

intro() {
    client_cmd(0,"spk ^"force/sw_intro.wav^";");
    set_hudmessage(0, 0, 255, 0.05, 0.70 + 2 / 35.0, 0, 6.0, 6.0, 0.5, 0.15, 2)
    show_hudmessage(0,"Server running in Star Wars Force Mode! Type !helpforce for more Info!");
    return 1;//PLUGIN_HANDLED;
}

new force_message[]="Force Mode by Ivan -g-s-ivan@web.de!^n\
--------------------------^n\
^n\
This Server is running in Force Mode.^n\
Force Mode gives you abilities to use the force as in the Star Wars Movies. (And as in Jedi Knight (2))^n\
You have to bind the commands ^"force_next^", ^"force_use^" and ^"foce_next^" to keys.^n\
Use bind <key> force_next|force_use|force_prev^n\
If you have no console or dont want to type you can say !bindforce, itll bind^n\
Force commands to Del, End and Page Down keys.^n";

public helpforce(id) {
    show_motd(id,force_message,"Star Wars Force Mode");
    return PLUGIN_HANDLED;
}

public bindforce(id) {
    console_cmd(id,"bind del force_prev; bind end force_use; bind pgdn force_next");
    client_print(id,print_chat,"Force Keys have been bound to Del End and Page Down Keys.");
    return PLUGIN_HANDLED;
}

#if defined DEBUG
public amx_setmyforce(id) {
    new arg1[32];
    read_argv(1,arg1,32); 
    forcelevels[id]=str_to_num(arg1);
    return PLUGIN_HANDLED;
}
#endif

public client_connect(id) {
    client_cmd(id, "echo ^"^";");
    client_cmd(id, "echo ^"=(Star Wars Force Mode)====================(by Ivan -g-s-ivan@web.de)=^";");
    client_cmd(id, "echo ^"= Star Wars Force Mode is installed on this Server, so don't wonder  =^";");
    client_cmd(id, "echo ^"= about lightnings, invul, invisible people and much more :D         =^";");
    client_cmd(id, "echo ^"= Type !bindforce to bind the 3 Force keys to Del, End and PgDown    =^";");
    client_cmd(id, "echo ^"= Or type !helpforce for some info.                                  =^";");
    client_cmd(id, "echo ^"======================================================================^";");
    return PLUGIN_CONTINUE;
}

public plugin_precache() 
{ 
   precache_sound("force/force_grip.wav");
   precache_sound("force/force_heal.wav");
   precache_sound("force/force_jump.wav");
   precache_sound("force/force_lightning.wav");
   precache_sound("force/force_lightning_hit.wav");
   precache_sound("force/force_p.wav");
   precache_sound("force/force_push.wav");
   precache_sound("force/force_speed_loop.wav");
   precache_sound("force/force_speed_start.wav");
   precache_sound("force/sw_intro.wav");
   precache_sound("force/beep.wav");

   smoke = precache_model("sprites/steam1.spr");
   light = precache_model("sprites/lgtning.spr");
   white = precache_model("sprites/white.spr"); 
   return PLUGIN_CONTINUE 
} 

public plugin_init() 
{
    register_plugin("AMX Force","0.2","-g-s-ivan@web.de");
    register_clcmd("force_next","force_next");
    register_clcmd("force_prev","force_prev");
    register_clcmd("force_use","force_use");
    register_clcmd("say !helpforce","helpforce");
    register_clcmd("say !forcehelp","helpforce");
    register_clcmd("say !force","helpforce");
    register_clcmd("say !bindforce","bindforce");
    register_clcmd("say !forcebind","bindforce");
    register_clcmd("say helpforce","helpforce");
    register_clcmd("say forcehelp","helpforce");
    register_clcmd("say force","helpforce");
    register_clcmd("say bindforce","bindforce");
    register_clcmd("say forcebind","bindforce");
    set_task(1.0,"checkforce",0,"",0,"b");
#if defined DEBUG
    register_clcmd("amx_setmyforce","amx_setmyforce",ADMIN_LEVEL_A,"amx_setmyforce < force >") 
#endif
    return PLUGIN_CONTINUE;
}

