Raised This Month: $ Target: $400
 0% 

Ultimate Predator


Post New Thread Reply   
 
Thread Tools Display Modes
devil001
Member
Join Date: Feb 2008
Old 07-29-2009 , 03:30   Re: Ultimate Predator
Reply With Quote #11

yeah I actually left it out on purpose but I will add it with a description. Once I get home I will add everything
__________________
Host Mist - Helping People Say Hello World
Shared | VPS | Dedicated Hosting
Backup-Spot
Secure,Fast and Reliable Offsite Backups
devil001 is offline
MmikiM
Senior Member
Join Date: Nov 2006
Location: Poland
Old 07-29-2009 , 09:33   Re: Ultimate Predator
Reply With Quote #12

No problem
__________________


Projects:
Zombie Elite - Technical: 100% Looking for models and sounds...
CS:Source Zombie -
Work in progress...
MmikiM is offline
devil001
Member
Join Date: Feb 2008
Old 07-29-2009 , 14:53   Re: Ultimate Predator
Reply With Quote #13

Quote:
Originally Posted by deejay87 View Post
hi
first post don't have the cvar
I added this just for you now be happy...

Quote:
Originally Posted by MmikiM View Post
No problem
I added yours instead of the other since somebody said that the other is buggy
__________________
Host Mist - Helping People Say Hello World
Shared | VPS | Dedicated Hosting
Backup-Spot
Secure,Fast and Reliable Offsite Backups
devil001 is offline
mando127
Veteran Member
Join Date: Dec 2006
Location: virginia
Old 08-02-2009 , 14:09   Re: Ultimate Predator
Reply With Quote #14

i cant get this mod to work on my server as soon as the new round starts with the random pick it svc_bad kicks all out.
__________________
mando127 is offline
Send a message via Skype™ to mando127
devil001
Member
Join Date: Feb 2008
Old 08-02-2009 , 14:35   Re: Ultimate Predator
Reply With Quote #15

what game mode are you using?
__________________
Host Mist - Helping People Say Hello World
Shared | VPS | Dedicated Hosting
Backup-Spot
Secure,Fast and Reliable Offsite Backups
devil001 is offline
devil001
Member
Join Date: Feb 2008
Old 08-02-2009 , 14:51   Re: Ultimate Predator
Reply With Quote #16

Im guessing you are using game_mode 2

the cs_reset_user_model might be called too much in the loop so try this, this adds an delay.

Try the version I attached
Attached Files
File Type: sma Get Plugin or Get Source (ultimate_predator.sma - 410 views - 44.6 KB)
__________________
Host Mist - Helping People Say Hello World
Shared | VPS | Dedicated Hosting
Backup-Spot
Secure,Fast and Reliable Offsite Backups
devil001 is offline
mando127
Veteran Member
Join Date: Dec 2006
Location: virginia
Old 08-02-2009 , 15:37   Re: Ultimate Predator
Reply With Quote #17

Code:
Steve is joining the Counter-Terrorist force
Last 32 messages parsed.
579 0107 FlashBat
579 0109 Train
579 0111 CurWeapon
579 0115 WeapPickup
579 0117 WeapPickup
579 0119 AmmoPickup
579 0122 ScoreAttrib
579 0125 ScreenFade
579 0136 RoundTime
579 0139 svc_event_reliable
579 0142 BombPickup
579 0143 ShowTimer
579 0144 TeamInfo
579 0150 TeamScore
579 0157 TeamScore
579 0171 ScoreInfo
579 0181 ScoreInfo
579 0191 TeamInfo
579 0197 ScoreInfo
579 0207 TeamInfo
579 0213 ScoreInfo
579 0223 svc_updateuserinfo
579 0373 AmmoX
579 0376 CurWeapon
579 0380 CurWeapon
579 0384 svc_time
579 0389 svc_setangle
579 0396 svc_clientdata
579 0466 svc_deltapacketentities
579 0530 svc_pings
579 0538 svc_temp_entity
BAD:  574:svc_bad
Host_Error: CL_ParseServerMessag
that's what it tells me after it kicks us.

this is the code im using i added 2 new player mdls and new gibs and new claws.

the new plugin you just added will do the same and one more thing i run cs 1.6.

Code:
/*
    Plugin: Ultimate Predator
    Current Version: 1.00.11
    
    Author: James Gunner
    E-Mail: [email protected]
    
    Support-Thread: unknown yet
    
            AMX Mod X script.
        
        This program is free software; you can redistribute it and/or modify it
        under the terms of the GNU General Public License as published by the
        Free Software Foundation; either version 2 of the License, or (at
        your option) any later version.

        This program is distributed in the hope that it will be useful, but
        WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
        General Public License for more details.

        You should have received a copy of the GNU General Public License
        along with this program; if not, write to the Free Software Foundation,
        Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

        In addition, as a special exception, the author gives permission to
        link the code of this program with the Half-Life Game Engine ("HL
        Engine") and Modified Game Libraries ("MODs") developed by Valve,
        L.L.C ("Valve"). You must obey the GNU General Public License in all
        respects for all of the code used other than the HL Engine and MODs
        from Valve. If you modify this file, you may extend this exception
        to your version of the file, but you are not obligated to do so. If
        you do not wish to do so, delete this exception statement from your
        version.
    
    .: Description
    
        This plugin will allow one or more players to be predator in different 
        Game Modes.A Predator gets a plasma cannon, special view and more health. 
        The Predator can't use any weapons but has claws which kills a human 
        with one hit. Different view modes makes the Predator stronger
        (normal, 3d person, strategy)            
        
    .: Features
    
        - 4 Game Modes (buy predator, one random predator against all, team predator vs. team human, everyone predator)
        - 3 different view modes for predator (normal, 3d person, strategy)
        - Automatically bind the keys for players
        - On team predator vs. team human, a random team funtion
        
    .: Cvars
    
        pred_Enable            - Enable Ultimate Predator 
        pred_Frags_Buy             - Enable buy predator with Frags? (GameMode 1)
        pred_Money_Buy             - Enable buy predator with Money? (GameMode 1)
        pred_AutoBind            - Enable autmatic binding of player commands
        pred_Game_Mode            - Change the predator gamemode:
                                        1 = buy predator
                                        2 = one random predator vs. all
                                        3 = team pred vs. team human
                                        4 = Everyone pred
                                        
        pred_Random_Team        - Make a radnom team predator (GameMode 3)
        pred_Frags            - How many Frags are players supposed to pay for predator
        pred_Money            - How much money are players supposed to pay for predator
        pred_Plasma_Count        - Plasma Count of the Predator
        pred_Health_Count        - Health Count of the Predator
        pred_Armor_Count        - Armor Count of the Predator
        pred_Plasma_KillAward        - How many frags is the predator getting awarded for a kill with plasma
        pred_Knife_KillAward        - How many frags is the predator getting awarded for a kill with knife
        pred_Kill_MoneyAward        - How much money is the predator getting awarded for a kill
        
    .: Client Commands
    
        ppcfire                - Shoot Plasma 
        pcview                - Change view
        dbinds                - bind keys automatically to plasma:
                                            shoot         = mouse3(mousewheel click)
                                            change view      = p
        say /predatorhelp        - show predator help
        say /predcost            - show how much predator costs
        say /predon            - Shows status of Predator Mod (on/off)
        say /buypred            - buy predator
        
    .: Admin Commands
    
        pred_predator     [target]        - make predator
        pred_addplasma     [target] [plasma]    - give a predator some extra plasma
        pred_unpredator    [target]        - remove predator
    
    
    .: Required Modules
    
        - CStrike
        - Fun
        - Engine
        
    .: Notes
    
        1 - I know that there is a plugin that essentially does the same but as I said this was a request,
        done due to the other one not working for the requesters. I just wanted to share this in the hope it 
        will be useful for others.
        
        2 - This plugin did not go through much testing, unlike I usually prefer to do it with my stuff. 
        This is because I currently do not need it myself. It is, however, working without errors for a few 
        days on my servers. Please report any bugs you may encounter.
    
    .: Changelog
    
        * 1.00.11
        - Initial release
*/
//---------------[INCLUDES]---------------
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <engine>

//---------------[CREDITS]---------------                        //Do not alter
#define PLUGIN "Ultimate Predator"
#define VERSION "1.01.14"
#define AUTHOR "JamesGunner @ ZombiesonWeed.com"

//---------------[PLASMA STUFF]---------------
new gExplosionModel
new gTrailModel

//---------------[BODYPARTS & Blood]---------------
new mdl_gib_flesh, mdl_gib_head, mdl_gib_legbone, mdl_gib_lung, mdl_gib_meat, mdl_gib_spine,
blood_drop, blood_spray;

//---------------[MSG STUFF]---------------
new MsgSayText

//---------------[THE PREDATOR GLOBAL VALUE]---------------
new predator[33], plasma[33], view[33], onoroff[33], g_maxplayers

//---------------[PCVARS]---------------
new pred_Enable_Predator, pred_Enable_AutoBind, pred_Game_Mode, pred_Plasma_Count, pred_Health_Count, 
pred_Plasma_KillAward, pred_Knife_KillAward, pred_Kill_MoneyAward, pred_Frags_Buy, pred_Money_Buy, 
pred_Frags_Price, pred_Money_Price, pred_Random_Team, pred_view_bodyheat, pred_Armor_Count;

//---------------[PLUGIN INIT]---------------
 public plugin_init()
 {

    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_cvar( "pred_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY );
    
    register_event( "HLTV",     "start_round", "a", "1=0", "2=0");
    register_event( "DeathMsg",     "unpredator", "a" )
    register_event( "DeathMsg",     "death_blood", "a" )
    register_event( "CurWeapon",     "toggleclaws", "be", "1=1" )
    register_event( "Damage",     "pred_power", "b", "2!0" )
    register_event( "Damage",     "dmg_blood", "b", "2!0", "3=0", "4!0" )
    
    pred_Enable_Predator         = register_cvar("pred_Enable","1")
    pred_Frags_Buy             = register_cvar("pred_Frags_Buy","1")
    pred_Money_Buy             = register_cvar("pred_Money_Buy","1")
    pred_Enable_AutoBind        = register_cvar("pred_AutoBind","1")
    pred_Game_Mode            = register_cvar("pred_Game_Mode","2")
    pred_Random_Team        = register_cvar("pred_Random_Team","1")
    pred_Frags_Price        = register_cvar("pred_Frags","20")
    pred_Money_Price        = register_cvar("pred_Money","16000")
    pred_Plasma_Count        = register_cvar("pred_Plasma_Count","3")
    pred_Health_Count        = register_cvar("pred_Health_Count","1000")
    pred_Armor_Count        = register_cvar("pred_Armor_Count","500")
    pred_Plasma_KillAward        = register_cvar("pred_Plasma_KillAward","1")
    pred_Knife_KillAward        = register_cvar("pred_Knife_KillAward","2")
    pred_Kill_MoneyAward        = register_cvar("pred_Kill_MoneyAward","300")
    pred_view_bodyheat        = register_cvar("pred_view_bodyheat","0.4")
    
    register_concmd("pred_predator",    "func_adminpredator",ADMIN_LEVEL_A,"[target]")
    register_concmd("pred_addplasma",    "func_addplasma",ADMIN_LEVEL_A,"[target] [plasma]")
    register_concmd("pred_unpredator",    "func_adminunpredator",ADMIN_LEVEL_A,"[target]")
    
    register_clcmd("ppfire","cmdShoot")
    register_clcmd("pcview","func_view")
    register_clcmd("dbinds","pred_bind")
    register_clcmd("say /predatorhelp","pred_help")
    register_clcmd("say /predcost","pred_cost")
    register_clcmd("say /predon","pred_on")
    register_clcmd("say /buypred","pred_buy")
    register_touch("PlasmaBall","*","plasma_hit")
    
    register_dictionary("ultimate_predator.txt")
    register_dictionary("common.txt")
    
    MsgSayText = get_user_msgid("SayText")
    
    g_maxplayers = get_maxplayers()
    set_task(0.85,"lowhp_blood",0,"",0,"b")
    set_task(get_pcvar_float(pred_view_bodyheat), "func_bodyheat", 0, "", 0, "b")
}
//---------------[PRECATCH SOUNDS]---------------

public plugin_precache()
{
    precache_model("models/player/predator1_ubcs/predator1_ubcs.mdl")
    precache_model("models/player/predator2_ubcs/predator2_ubcs.mdl")
    precache_model("models/player/predator2_ubcs/predator2_ubcsT.mdl")
    precache_model("models/predator_claws_ubcs.mdl")
    precache_model("models/rpgrocket.mdl")
    precache_model("models/v_knife.mdl")
    precache_sound("predator/crpredator.wav")
    precache_sound("predator/scpredator.wav")
    precache_sound("predator/depredator.wav")
    precache_sound("predator/plasma_shoot.wav")
    precache_sound("predator/explosion.wav")
    precache_sound("predator/bc_spithit2.wav")
    precache_sound("predator/suitchargeno1.wav")
    precache_sound("predator/smallmedkit2.wav")
    precache_sound("predator/button3.wav")
    precache_model("sprites/plasma.spr")
    
    gTrailModel         = precache_model("sprites/laserbeam.spr")
    gExplosionModel     = precache_model("sprites/plasma_explode.spr")
    blood_drop         = precache_model("sprites/blood.spr")
    blood_spray         = precache_model("sprites/bloodspray.spr")
    mdl_gib_flesh         = precache_model("models/fleshgibs_ubcs.mdl")
    mdl_gib_head         = precache_model("models/gib_skull_ubcs.mdl")
    mdl_gib_legbone     = precache_model("models/gib_legbone_ubcs.mdl")
    mdl_gib_lung         = precache_model("models/gib_lung_ubcs.mdl")
    mdl_gib_meat         = precache_model("models/gib_b_gib_ubcs.mdl")    
    mdl_gib_spine         = precache_model("models/gib_b_bone_ubcs.mdl")
}
//---------------[CREATE PREDATOR]---------------
public make_predator(id, target, admin, model)
{
    if(!get_pcvar_num(pred_Enable_Predator))
        return PLUGIN_HANDLED;
        
    predator[target]    = 1
    plasma[target]        = get_pcvar_num(pred_Plasma_Count)
    
    set_user_health( target, get_pcvar_num(pred_Health_Count))
    cs_set_user_armor( target, get_pcvar_num(pred_Armor_Count), CS_ARMOR_VESTHELM)
    set_user_gravity( target, 0.5)
    set_user_rendering( target, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 20)
    set_user_footsteps( target, 1)
    
    if(!model) 
        cs_set_user_model( target, "predator1_ubcs")
    else
        cs_set_user_model( target, "predator2_ubcs")
    
    client_cmd( target, "spk predator/crpredator")
    set_hudmessage( 0,30, 200, -1.0, 0.75, 0, 3.0, 10.0, 0.15, 0.5,1)
    show_hudmessage( target, "%L", LANG_PLAYER, "PRED_INFECTED")
    cs_set_user_nvg( target, 1)
    
    if(admin)
    {
        new name_target[33]
        new name_admin[33]
        
        get_user_name(target, name_target, 32)
        get_user_name(id, name_admin, 32)
        client_print(0, print_chat, "[PRED] %L", name_admin, name_target, LANG_PLAYER, "PRED_INFECTED_ADMIN")
        console_print( id, "[PRED] %L", LANG_PLAYER, "PRED_SUCCES")
    }
    client_print(target, print_center,"[PRED] %L", plasma[target], LANG_PLAYER, "PRED_SHOTS_LEFT")
    return PLUGIN_HANDLED;
}
public remove_predator(id, target, admin)
{
    if(!get_pcvar_num(pred_Enable_Predator))
        return PLUGIN_HANDLED;
        
    if(predator[target]!=0)
    {
        predator[target]    = 0
        plasma[target]        = 0
        
        if(get_user_health(target) > 100)
            set_user_health(target, 100)

        cs_set_user_armor( target, 0, CS_ARMOR_NONE)
        set_user_gravity( target, 1.0)
        set_user_rendering( target, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
        set_user_footsteps( target, 0)
        set_user_maxspeed( target, 250.0)
        client_cmd( target, "cl_forwardspeed 400")
        client_cmd( target, "cl_backspeed 400")
        client_cmd( target, "cl_sidespeed 400")
        client_cmd( target, "spk predator/depredator")
        cs_reset_user_model( target)
        client_print(target, print_center, "%L", LANG_PLAYER, "PRED_HUMAN")
        message_begin( MSG_ONE, 98, {0,0,0}, target)
        write_short(1<<0)                 // fade lasts this long duration
        write_short(1<<0)                 // fade lasts this long hold time
        write_short(1<<2)                 // fade type HOLD
        write_byte(100)                    // fade red
        write_byte(0)                     // fade green
        write_byte(0)                     // fade blue
        write_byte(0)                     // fade alpha
        message_end()
        
        if(admin)
            console_print(id,"[PRED] %L", LANG_PLAYER, "PRED_SUCCES")
        
        if(view[target])
        {
            func_view(target);
        }
        onoroff[target] = 0
        cs_set_user_nvg( target, 0)
        client_cmd( target, "spk predator/smallmedkit2")
    }
    return PLUGIN_HANDLED;
}
 //---------------[PRADATOR GOT KILLED]---------------
public unpredator()
{
    if(!get_pcvar_num(pred_Enable_Predator))
        return PLUGIN_HANDLED;
        
    new victim = read_data(2);
    
    if(is_user_connected(victim))
    {
        if(predator[victim]!=0)
        {
            remove_predator(0, victim, 0);
        }
    }
    return PLUGIN_HANDLED;
}
 //---------------[ADMIN SET PREDATOR]---------------
 public func_adminpredator(id,level,cid)
 {
     if(!get_pcvar_num(pred_Enable_Predator))
        return PLUGIN_HANDLED;
        
    if (!cmd_access(id,level,cid,4))
    {
        console_print(id, "[PRED] %L", LANG_PLAYER, "NO_ACC_COM")
        return PLUGIN_HANDLED
    }
    new arg[32]
    read_argv(1,arg,31)
    new player = cmd_target(id,arg,2)
    
    if(!predator[player])
    {
        make_predator(id, player, 0, 0)        
    }
    return PLUGIN_HANDLED
 }
 
 //---------------[ADMIN REMOVE PREDATOR]---------------
 public func_adminunpredator(id,level,cid)
 {
     if(!get_pcvar_num(pred_Enable_Predator))
        return PLUGIN_HANDLED;
        
    if (!cmd_access(id,level,cid,2))
    {
        console_print(id, "[PRED] %L", LANG_PLAYER, "NO_ACC_COM")
        return PLUGIN_HANDLED
    }

    new arg[32]
    read_argv(1,arg,31)
    new target    = cmd_target(id,arg,2)
    
    if(predator[target])
    {
        remove_predator(id, target, 1)
    }
    return PLUGIN_HANDLED
 }

 //---------------[START ROUND]---------------
public start_round()
{
    if(!get_pcvar_num(pred_Enable_Predator))
        return;
    
    new pred_GameMode = get_pcvar_num(pred_Game_Mode)
    static iPlayers[32], iNum;
    
    for( new id = 1; id <= g_maxplayers; id++ )
    {
        if( is_user_alive( id ) &&  ( CS_TEAM_T <= cs_get_user_team( id ) <= CS_TEAM_CT ) )
            iPlayers[iNum++] = id;
    }
    
    new id;
    for( new i = 0; i < iNum; i++ )
    {
        id = iPlayers[i];
        
        if( !predator[id] )
        {            
            set_user_health( id, 100 );
            set_user_gravity( id, 1.0 );
            set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255 );
            set_user_footsteps( id, 0 );
            onoroff[id] = 0;
        }
        else if( pred_GameMode == 1 )
        {
            make_predator( 0, id, 0, 0 );
            client_print(0, print_chat, "[PRED] %L", LANG_PLAYER, "PRED_INFO")
        }
    }

    switch( pred_GameMode )
    {
        case 2:
        {
            new randTarget = iPlayers[random(iNum)];
            new szTargetName[33];
            new Float:fTimer = 0.1;
            
            cs_set_user_team( randTarget, CS_TEAM_CT );
            set_task( fTimer, "reset_model", randTarget );
            
            for( new i = 0; i < iNum; i++ )
            {
                id = iPlayers[i];
                
                if( randTarget == id )
                    continue;
                    
                if( cs_get_user_team( id ) != CS_TEAM_T )
                {
                    cs_set_user_team( id, CS_TEAM_T );
                    set_task( fTimer, "reset_model", randTarget );
                    fTimer += 0.1;
                }
            }
            
            get_user_name( randTarget, szTargetName, charsmax(szTargetName) );
            make_predator( 0, randTarget, 0, 0 );
            set_hudmessage( 0, 30, 200, -1.0, 0.75, 0, 3.0, 10.0, 0.15, 0.5, 1 );
            show_hudmessage( 0, "%L", szTargetName, LANG_PLAYER, "PRED_IS_INFECTED");    
        }
        case 3:
        {
            new CsTeams:iTeam = CS_TEAM_CT;
            
            if( get_pcvar_num( pred_Random_Team ) )
                iTeam = CsTeams:random_num( 1, 2 );
                
            for( new i = 0; i < iNum; i++ )
            {
                id = iPlayers[i];
                
                if( cs_get_user_team( id ) != iTeam )
                    continue;
                
                make_predator( 0, id, 0, 0 );
            }
        }
        default:
        {
            for( new i = 0; i < iNum; i++ )
            {
                id = iPlayers[i];
                
                make_predator( 0, id, 0, ( cs_get_user_team( id ) == CS_TEAM_T ) ? 0 : 1 );
            }
        }
    }
 }
public reset_model(id) // let's add a delay before we reset the model
{
    cs_reset_user_model( id );
}
 //---------------[PREDATOR SPEED & KNIFE & PLASMACOUNT]---------------
 public client_PreThink(id)
 {
    new clip,ammo
    if(predator[id])
    {
        entity_set_float(id,EV_FL_fuser2,0.0)
        set_user_maxspeed(id,475.0)
        client_cmd(id,"cl_forwardspeed 475;cl_backspeed 475;cl_sidespeed 475")
        if(get_user_weapon(id,clip,ammo)!=CSW_KNIFE && get_user_weapon(id,clip,ammo)!=CSW_C4)
        {
            client_cmd(id,"weapon_knife")
        }
        if(get_user_health(id)<101)
        {
            set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,225-(get_user_health(id)*2))
        }
    }
 }
 //---------------[PREDATOR POWER]---------------
 public pred_power(id)
 {
    func_screen(id)
    new weapon, bodypart, attacker = get_user_attacker(id,weapon,bodypart)
    
    if(predator[attacker] && attacker!=id)
    {
        if(!is_user_connected(attacker) || !is_user_connected(id) || !(0 < attacker <= g_maxplayers) )
            return PLUGIN_CONTINUE;
            
        new iOrigin[3]
        new wpn[32]
        get_weaponname(attacker,wpn,31)
        new damage
        new victimhealth = get_user_health(id)
        damage = read_data(2)
        
        if(weapon==CSW_KNIFE)
        {
            damage = damage*2
        }
        if (victimhealth - damage<1)
        {
            user_silentkill(id)
            
            if(predator[id])
            {
                get_user_origin(id,iOrigin)
                                // Effects
                fx_blood_green(iOrigin)
                fx_blood_green(iOrigin)
                fx_blood_green(iOrigin)
                fx_bleed_green(iOrigin)
                fx_bleed_green(iOrigin)
                fx_headshot_green(iOrigin)
                fx_blood_large_green(iOrigin,5)
                fx_blood_small_green(iOrigin,15)
                fx_trans(id,0)
                fx_gib_explode(iOrigin)
                                // Hide body
                iOrigin[2] = iOrigin[2]-20
                set_user_origin(id,iOrigin)
            }
            else
            {
                get_user_origin(id,iOrigin)
                                // Effects
                fx_blood_red(iOrigin)
                fx_blood_red(iOrigin)
                fx_blood_red(iOrigin)
                fx_bleed_red(iOrigin)
                fx_bleed_red(iOrigin)
                fx_headshot_red(iOrigin)
                fx_blood_large_red(iOrigin,5)
                fx_blood_small_red(iOrigin,15)
                fx_trans(id,0)
                fx_gib_explode(iOrigin)
                                // Hide body
                iOrigin[2] = iOrigin[2]-20
                set_user_origin(id,iOrigin)
            }
            make_deathmsg(attacker,id,bodypart,wpn)
            
            set_user_frags( attacker, get_user_frags(attacker) + get_pcvar_num(pred_Knife_KillAward) )
            cs_set_user_money( attacker, cs_get_user_money(attacker) + get_pcvar_num(pred_Kill_MoneyAward) )
            
            client_cmd(attacker,"spk predator/bc_spithit2")
            client_cmd(id,"spk predator/bc_spithit2")
            client_cmd(attacker,"spk predator/scpredator")
            client_cmd(id,"spk predator/scpredator")
            } else {
            set_user_health(id, victimhealth-damage)
        }
    }
    return PLUGIN_CONTINUE
 }
 //---------------[PLASMA SHOOT]---------------

 public cmdShoot(id)
 {
     if(!get_pcvar_num(pred_Enable_Predator))
        return PLUGIN_HANDLED;
        
    if(plasma[id]>0 && predator[id])
    {
        plasma[id]=plasma[id]-1
        
        client_print(id, print_center,"%L", plasma[id], LANG_PLAYER, "PRED_SHOTS_LEFT")

        new origin[3], Float:fOrigin[3]                    // player origin... and float origin
        new Float:velocity[3]                         // speed of the entity to move

        get_user_origin(id,origin,1)                    // get user origin - int
        IVecFVec(origin, fOrigin)                    // convert the int into float

        new ePlasmaBall = create_entity("info_target")             // create the plasma ball
        entity_set_string(ePlasmaBall, EV_SZ_classname, "PlasmaBall")     // set name of the entity "PlasmaBall"

        new Float:posAdjust[3]                         // Used for adjusting the starting position
        velocity_by_aim(id, 70, posAdjust)                  // You can replace 50 with whatever , get origin of the AIM
        fOrigin[0] += posAdjust[0]
        fOrigin[1] += posAdjust[1]
        fOrigin[2] += posAdjust[2]
        entity_set_vector(ePlasmaBall, EV_VEC_origin,fOrigin)        // set the shot's direction

        new Float:maxs[3] = {0.2,0.2,0.5}
        new Float:mins[3] = {-0.2,-0.2,-0.5}
        entity_set_size(ePlasmaBall,mins,maxs)                // set size
        entity_set_int(ePlasmaBall,EV_INT_solid, SOLID_BBOX)        // make solid
        entity_set_int(ePlasmaBall,EV_INT_movetype,MOVETYPE_FLYMISSILE)    // set movetype
        entity_set_float(ePlasmaBall,EV_FL_framerate,1.0)        // framerate
        entity_set_int(ePlasmaBall, EV_INT_rendermode, 5)        // randermode
        entity_set_float(ePlasmaBall, EV_FL_renderamt, 255.0)        // visible
        entity_set_float(ePlasmaBall, EV_FL_scale, 1.20)        // dunno
        entity_set_model(ePlasmaBall, "sprites/plasma.spr")        // model
        emit_sound(ePlasmaBall, CHAN_AUTO, "predator/plasma_shoot.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)//sound
        VelocityByAim(id,1150,velocity)                    // speed
        entity_set_vector(ePlasmaBall,EV_VEC_velocity,velocity)        // set the shot's speed
        entity_set_edict(ePlasmaBall, EV_ENT_owner, id)
                                // Create a trail...
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)     // TE_BEAMFOLLOW ( msg #22) create a line of decaying beam segments until entity stops moving
        write_byte(22)                            // msg id
        write_short(ePlasmaBall)                        // short (entity:attachment to follow)
        write_short(gTrailModel)                 // short (sprite index)
        write_byte(25)                            // byte (life in 0.1's)
        write_byte(7)                            // byte (line width in 0.1's)
        write_byte(42)                            // byte (color)
        write_byte(170)                            // byte (color)
        write_byte(255)                            // byte (color)
        write_byte(255)                            // byte (brightness)
        message_end()
        return PLUGIN_HANDLED
        } else {
        set_hudmessage(0,30,200,-1.0,0.75,0,3.0,10.0,0.15,0.5,1)
        show_hudmessage(id,"%L", LANG_PLAYER, "PRED_OUT_OF_AMMO")
        return PLUGIN_HANDLED
    }
    return PLUGIN_HANDLED
 }
 //---------------[PLASMA HIT]---------------
 public plasma_hit(ePlasmaBall,other) {

    if(other == 0) {


        new Float:fOrigin[3]
        new iOrigin[3]
                                // get origin....
        entity_get_vector(ePlasmaBall, EV_VEC_origin, fOrigin)
                                // changes a Float vector to an interger
        FVecIVec(fOrigin, iOrigin)
                                // this sends out a server message ( from const.h )
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte(23)                    // TE_GLOWSPRITE
        write_coord(iOrigin[0])
        write_coord(iOrigin[1])
        write_coord(iOrigin[2])
        write_short(gExplosionModel)            // model
        write_byte(3)                    // life 0.x sec
        write_byte(12)                    // size
        write_byte(210)                    // brightness
        message_end()
                                // our explosion sound...
        emit_sound(ePlasmaBall, CHAN_AUTO, "predator/explosion.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

        remove_entity(ePlasmaBall)             // remove the entity
    }
    else if(is_user_connected(other)) {

        new attacker = entity_get_edict(ePlasmaBall,EV_ENT_owner)
        if(get_user_team(other)!=get_user_team(attacker))
        {
            new bodypart,weapon[32]
            new iOriginp[3]
            user_silentkill(other)
            if(predator[other])
            {
                get_user_origin(other,iOriginp)
                                // Effects
                fx_blood_green(iOriginp)
                fx_blood_green(iOriginp)
                fx_blood_green(iOriginp)
                fx_bleed_green(iOriginp)
                fx_bleed_green(iOriginp)
                fx_headshot_green(iOriginp)
                fx_blood_large_green(iOriginp,10)
                fx_blood_small_green(iOriginp,20)
                fx_trans(other,0)
                fx_gib_explode(iOriginp)
                                // Hide body
                iOriginp[2] = iOriginp[2]-20
                set_user_origin(other,iOriginp)
            }
            else
            {
                get_user_origin(other,iOriginp)
                                // Effects
                fx_blood_red(iOriginp)
                fx_blood_red(iOriginp)
                fx_blood_red(iOriginp)
                fx_bleed_red(iOriginp)
                fx_bleed_red(iOriginp)
                fx_headshot_red(iOriginp)
                fx_blood_large_red(iOriginp,10)
                fx_blood_small_red(iOriginp,20)
                fx_trans(other,0)
                fx_gib_explode(iOriginp)
                                // Hide body
                iOriginp[2] = iOriginp[2]-20
                set_user_origin(other,iOriginp)
            }
            make_deathmsg(attacker,other,bodypart,weapon)
            set_user_frags (attacker,get_user_frags(attacker) + get_pcvar_num(pred_Plasma_KillAward))
            cs_set_user_money(attacker,cs_get_user_money(attacker) + get_pcvar_num(pred_Kill_MoneyAward))

            new Float:fOrigin[3]
            new iOrigin[3]
            // get origin....
            entity_get_vector(ePlasmaBall, EV_VEC_origin, fOrigin)


                                // changes a Float vector to an interger
            FVecIVec(fOrigin, iOrigin)


                                // this sends out a server message ( from const.h )
            message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
            write_byte(23)                // TE_GLOWSPRITE
            write_coord(iOrigin[0])
            write_coord(iOrigin[1])
            write_coord(iOrigin[2])
            write_short(gExplosionModel)        // model
            write_byte(3)                // life 0.x sec
            write_byte(12)                // size
            write_byte(210)                // brightness
            message_end()

                                // our explosion sound...
            emit_sound(ePlasmaBall, CHAN_AUTO, "predator/explosion.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
            client_cmd(other,"spk predator/bc_spithit2")
            client_cmd(attacker,"spk predator/bc_spithit2")

            remove_entity(ePlasmaBall)
            } else {
            new Float:fOrigin[3]
            new iOrigin[3]
                                // get origin....
            entity_get_vector(ePlasmaBall, EV_VEC_origin, fOrigin)


                                // changes a Float vector to an interger
            FVecIVec(fOrigin, iOrigin)
                                // this sends out a server message ( from const.h )
            message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
            write_byte(23)                // TE_GLOWSPRITE
            write_coord(iOrigin[0])
            write_coord(iOrigin[1])
            write_coord(iOrigin[2])
            write_short(gExplosionModel)        // model
            write_byte(3)                // life 0.x sec
            write_byte(12)                // size
            write_byte(210)                // brightness
            message_end()

                                // our explosion sound...
            emit_sound(ePlasmaBall, CHAN_AUTO, "predator/explosion.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
            remove_entity(ePlasmaBall)
        }
            } else {
                new Float:fOrigin[3]
                new iOrigin[3]
                                // get origin....
                entity_get_vector(ePlasmaBall, EV_VEC_origin, fOrigin)
                                // changes a Float vector to an interger
                FVecIVec(fOrigin, iOrigin)
                                // this sends out a server message ( from const.h )
                message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
                write_byte(23)            // TE_GLOWSPRITE
                write_coord(iOrigin[0])
                write_coord(iOrigin[1])
                write_coord(iOrigin[2])
                write_short(gExplosionModel)    // model
                write_byte(3)            // life 0.x sec
                write_byte(12)            // size
                write_byte(210)            // brightness
                message_end()

                                // our explosion sound...
                emit_sound(ePlasmaBall, CHAN_AUTO, "predator/explosion.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

                remove_entity(ePlasmaBall)     // remove the entity
        }
 }

 public func_addplasma(id,level,cid)
 {
    if (!cmd_access(id,level,cid,3))
    {
        console_print(id, "[PRED] %L", LANG_PLAYER, "NO_ACC_COM")
        return PLUGIN_HANDLED
    }
    new arg[32]
    new am[10]
    read_argv(1,arg,31)
    read_argv(2,am,9)
    new amf=str_to_num(am)
    new player = cmd_target(id,arg,2)
    if(predator[player])
    {
        plasma[player]=plasma[player]+amf
        client_print(player, print_center,"[PRED] %L", plasma[player], LANG_PLAYER, "PRED_SHOTS_LEFT")
    }
    return PLUGIN_HANDLED
 }
 //---------------[PUBLIC ON CONNECT FUNCTION]---------------
 public client_disconnect(id)
 {
    predator[id]    = 0
    plasma[id]    = 0
    onoroff[id]    = 0
 }

 //---------------[PREDATOR BLUE SCREEN EVERY NEW ROUND]---------------
 public func_screen(id)
 {
    if(is_user_alive(id))
    {
        if(view[id]==1 && predator[id])
        {
            onoroff[id]=1
            client_cmd(id,"spk predator/suitchargeno1")
            message_begin(MSG_ONE, 98, {0,0,0}, id)
            write_short(1<<0)             // fade lasts this long duration
            write_short(1<<0)             // fade lasts this long hold time
            write_short(1<<2)             // fade type HOLD
            write_byte(0)                // fade red
            write_byte(0)                 // fade green
            write_byte(255)             // fade blue
            write_byte(130)             // fade alpha
            message_end()
        }
        else if(view[id]==2 && predator[id])
        {
            onoroff[id]=2
            client_cmd(id,"spk predator/suitchargeno1")
            message_begin(MSG_ONE, 98, {0,0,0}, id)
            write_short(1<<0)             // fade lasts this long duration
            write_short(1<<0)             // fade lasts this long hold time
            write_short(1<<2)             // fade type HOLD
            write_byte(25)                // fade red
            write_byte(25)                 // fade green
            write_byte(25)                 // fade blue
            write_byte(210)             // fade alpha
            message_end()
        }
    }
 }

 //---------------[PREDATOR CLAWS]---------------

 public toggleclaws(id)
 {
    new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
    new model[32]
    entity_get_string(id,EV_SZ_viewmodel,model,31)
    if(predator[id] && !equali(model,"models/predator_claws_ubcs.mdl") && !equali(model,"models/v_c4.mdl"))
    {
        entity_set_string(id, EV_SZ_viewmodel,"models/predator_claws_ubcs.mdl")
    }
    if(!predator[id] && wpnid == CSW_KNIFE && !equali(model,"models/v_knife.mdl"))
    {
        entity_set_string(id, EV_SZ_viewmodel,"models/v_knife.mdl")
    }
 }
 
 //---------------[PREDATOR VIEW]---------------
 public func_view(id)
 {
     if(!get_pcvar_num(pred_Enable_Predator))
        return PLUGIN_HANDLED;
        
     if(predator[id])
     {
         if(view[id]==0)
         {
             view[id]=1
             onoroff[id]=1
             client_cmd(id,"spk predator/suitchargeno1")
             console_print(id,"%L", LANG_PLAYER, "PRED_VIEW_NORMAL")
             message_begin(MSG_ONE, 98, {0,0,0},id)
             write_short(1<<0)             // fade lasts this long duration
             write_short(1<<0)             // fade lasts this long hold time
              write_short(1<<2)             // fade type HOLD
             write_byte(0)                // fade red
             write_byte(0)                 // fade green
             write_byte(255)             // fade blue
             write_byte(120)             // fade alpha
             message_end()
             return PLUGIN_HANDLED
         }
         else if(view[id]==1)
         {
             view[id]=2
             onoroff[id]=2
             client_cmd(id,"spk predator/suitchargeno1")
             console_print(id,"%L", LANG_PLAYER, "PRED_VIEW_MOD")
             message_begin(MSG_ONE, 98, {0,0,0},id)
             write_short(1<<0)             // fade lasts this long duration
             write_short(1<<0)             // fade lasts this long hold time
              write_short(1<<2)             // fade type HOLD
             write_byte(25)                // fade red
             write_byte(25)             // fade green
             write_byte(25)             // fade blue
             write_byte(210)             // fade alpha
             message_end()
             return PLUGIN_HANDLED
         }
         else if(view[id]==2)
         {
             view[id]=3
             client_cmd(id,"spk predator/smallmedkit2")
             console_print(id,"%L", LANG_PLAYER, "PRED_THIRD_PERSON")
             set_view(id,CAMERA_3RDPERSON)
             onoroff[id]=0
             message_begin(MSG_ONE, 98, {0,0,0},id)
             write_short(1<<0)             // fade lasts this long duration
             write_short(1<<0)             // fade lasts this long hold time
              write_short(1<<2)             // fade type HOLD
             write_byte(0)                // fade red
             write_byte(0)                 // fade green
             write_byte(0)                 // fade blue
             write_byte(0)                 // fade alpha
             message_end()
             return PLUGIN_HANDLED
         }
         else if(view[id]==3)
         {
             view[id]=4
             client_cmd(id,"spk predator/button3")
             console_print(id,"%L", LANG_PLAYER, "PRED_VIEW_STRATEGY")
             set_view(id,CAMERA_TOPDOWN)
             return PLUGIN_HANDLED
         }
         else if(view[id]==4)
         {
             view[id]=0
             client_cmd(id,"spk predator/button3")
             console_print(id,"%L", LANG_PLAYER, "PRED_VIEW_NORMAL2")
             set_view(id,CAMERA_NONE)
             return PLUGIN_HANDLED
         }
         
     }
     else if(!predator[id] && !view[id])
     {
         set_view(id,CAMERA_NONE)
         view[id]=0
         onoroff[id]=0
         set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,255)
         return PLUGIN_HANDLED
     }
     return PLUGIN_HANDLED
 }
//---------------[MAKE MODEL INVISABLE IN EXPLOTION]---------------
static fx_trans(player,amount)
{
    set_user_rendering(player,kRenderFxNone,0,0,0,kRenderTransAlpha,amount)
    return PLUGIN_CONTINUE
}
 //---------------[BLOOD EVERY HIT (HUAMN)]---------------
   public fx_blood_red(origin[3])                 // hit blood human
 {
    message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte(115)                     // TE_BLOODSPRITE in const.h
    write_coord(origin[0]+random_num(-20,20))
    write_coord(origin[1]+random_num(-20,20))
    write_coord(origin[2]+random_num(-20,20))
    write_short(blood_spray)
    write_short(blood_drop)
    write_byte(248)                     // color index
    write_byte(15)                         // size
    message_end()
 }
 
//---------------[BLOOD EVERY HIT (PREDATOR)]---------------
public fx_blood_green(origin[3])                 // hit blood predator
{
    message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte(115)                     // TE_BLOODSPRITE in const.h
    write_coord(origin[0]+random_num(-20,20))
    write_coord(origin[1]+random_num(-20,20))
    write_coord(origin[2]+random_num(-20,20))
    write_short(blood_spray)
    write_short(blood_drop)
    write_byte(192)                     // color index
    write_byte(15)                         // size
    message_end()
}
 
//---------------[DIEING BLEEDING HUMAN]---------------
public fx_bleed_red(origin[3])                     // blood sprays on low hp
{
    message_begin(MSG_BROADCAST,SVC_TEMPENTITY)        // Blood spray
    write_byte(101)
    write_coord(origin[0])
    write_coord(origin[1])
    write_coord(origin[2]+10)
    write_coord(random_num(-100,100))             // x
    write_coord(random_num(-100,100))             // y
    write_coord(random_num(-10,10))             // z
    write_byte(70)                         // color
    write_byte(random_num(50,100))                 // speed
    message_end()
}
//---------------[DIEING BLEEDING PREDATOR]---------------
public fx_bleed_green(origin[3])                 //blood sprays on low hp green
{
    message_begin(MSG_BROADCAST,SVC_TEMPENTITY)        // Blood spray
    write_byte(101)
    write_coord(origin[0])
    write_coord(origin[1])
    write_coord(origin[2]+10)
    write_coord(random_num(-100,100))             // x
    write_coord(random_num(-100,100))             // y
    write_coord(random_num(-10,10))             // z
    write_byte(192)                     // color
    write_byte(random_num(50,100))                 // speed
    message_end()
}
//---------------[HEADSHOT BLOOD HUMAN]---------------
public fx_headshot_red(origin[3])
{
    for (new i = 0; i < 5; i++) {
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)    // Blood spray, 5 times
        write_byte(101)
        write_coord(origin[0])
        write_coord(origin[1])
        write_coord(origin[2]+30)
        write_coord(random_num(-20,20))         // x
        write_coord(random_num(-20,20))         // y
        write_coord(random_num(50,300))         // z
        write_byte(70)                     // color
        write_byte(random_num(100,200))         // speed
        message_end()
    }
}
//---------------[HEADSHOT BLOOD PREDATOR]---------------
public fx_headshot_green(origin[3])
{
    for (new i = 0; i < 8; i++) {
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)    // Blood spray, 8 times
        write_byte(101)
        write_coord(origin[0])
        write_coord(origin[1])
        write_coord(origin[2]+30)
        write_coord(random_num(-20,20))         // x
        write_coord(random_num(-20,20))         // y
        write_coord(random_num(50,300))         // z
        write_byte(192)                 // color
        write_byte(random_num(100,200))         // speed
        message_end()
    }
}
//---------------[BLOOD DECALS SMALL RED]---------------
static fx_blood_small_red(origin[3],num)             //red blood decals [small]
{
    static const blood_small[7] = {190,191,192,193,194,195,197}// Blood decals
    
    for (new j = 0; j < num; j++) {
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
        write_byte(116)                 // TE_WORLDDECAL from const.h
        write_coord(origin[0]+random_num(-100,100))
        write_coord(origin[1]+random_num(-100,100))
        write_coord(origin[2]-36)
        write_byte(blood_small[random_num(0,6)])     // index
        message_end()
    }
}
//---------------[BLOOD DECALS BIG RED]---------------
static fx_blood_large_red(origin[3],num)             // red blood decals [ big]
{
    static const blood_large[2] = {204,205}            // Blood decals

    for (new i = 0; i < num; i++) {
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)    // Large splash
        write_byte(116)                 // TE_WORLDDECAL from const.h
        write_coord(origin[0]+random_num(-50,50))
        write_coord(origin[1]+random_num(-50,50))
        write_coord(origin[2]-36)
        write_byte(blood_large[random_num(0,1)])     // index
        message_end()
    }
}
//---------------[BLOOD DECALS SMALL GREEN]---------------
static fx_blood_small_green(origin[3],num)             // green blood decals [small]
{
    static const blood_small[6] = {3,4,5,6,7,8}        // Blood decals
    
    for (new j = 0; j < num; j++) {
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)    // Small splash
        write_byte(116)                 // TE_WORLDDECAL from const.h
        write_coord(origin[0]+random_num(-65,65))
        write_coord(origin[1]+random_num(-65,65))
        write_coord(origin[2]-36)
        write_byte(blood_small[random_num(0,5)])     // index
        message_end()
    }
}
//---------------[BLOOD DECALS BIG GREEN]---------------
static fx_blood_large_green(origin[3],num)            // green blood decals [ big]
{
    static const blood_large[2] = {26,27}            // Blood decals

    for (new i = 0; i < num; i++) {
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)    // Large splash
        write_byte(116)                 // TE_WORLDDECAL from const.h
        write_coord(origin[0]+random_num(-45,45))
        write_coord(origin[1]+random_num(-45,45))
        write_coord(origin[2]-36)
        write_byte(blood_large[random_num(0,1)])     // index
        message_end()
    }
}
//---------------[GRANADE EXPLOTION BODYPARTS MODELS]---------------
static fx_gib_explode(origin[3])
{
    new flesh[3]
    flesh[0] = mdl_gib_flesh
    flesh[1] = mdl_gib_meat
    flesh[2] = mdl_gib_legbone

    message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte(106)                     // TR_MODEL
    write_coord(origin[0])
    write_coord(origin[1])
    write_coord(origin[2])
    write_coord(random_num(-100,100))
    write_coord(random_num(-100,100))
    write_coord(random_num(100,200))
    write_angle(random_num(0,360))
    write_short(mdl_gib_head)
    write_byte(0)                         // bounce
    write_byte(500)                     // life
    message_end()
    
    message_begin(MSG_BROADCAST,SVC_TEMPENTITY)        // Spine
    write_byte(106)
    write_coord(origin[0])
    write_coord(origin[1])
    write_coord(origin[2])
    write_coord(random_num(-100,100))
    write_coord(random_num(-100,100))
    write_coord(random_num(100,200))
    write_angle(random_num(0,360))
    write_short(mdl_gib_spine)
    write_byte(0)                         // bounce
    write_byte(500)                     // life
    message_end()
    
    for(new i = 0; i < random_num(1,2); i++) {        // Lung
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
        write_byte(106)
        write_coord(origin[0])
        write_coord(origin[1])
        write_coord(origin[2])
        write_coord(random_num(-100,100))
        write_coord(random_num(-100,100))
        write_coord(random_num(100,200))
        write_angle(random_num(0,360))
        write_short(mdl_gib_lung)
        write_byte(0)                     // bounce
        write_byte(500)                 // life
        message_end()
    }
    for(new i = 0; i < 5; i++) {
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY)    // Parts, 5 times
        write_byte(106)
        write_coord(origin[0])
        write_coord(origin[1])
        write_coord(origin[2])
        write_coord(random_num(-100,100))
        write_coord(random_num(-100,100))
        write_coord(random_num(100,200))
        write_angle(random_num(0,360))
        write_short(flesh[random_num(0,2)])
        write_byte(0)                     // bounce
        write_byte(500)                 // life
        message_end()
    }
}
//---------------[PLAYER HIT BLOOD]---------------
public dmg_blood()
{
    new id    = read_data(0)
    if(is_user_alive(id))
    {
        new origin[3]
        get_user_origin(id,origin)
        if(predator[id])
        {
            fx_blood_green(origin)
            fx_blood_small_green(origin,3)
        }
        else
        {
            fx_blood_red(origin)
            fx_blood_small_red(origin,3)
        }    
    }
}
//---------------[PLAYER BLEED ON LOW HP]---------------
public lowhp_blood()
{
    new iPlayer, iPlayers[32], iNumPlayers, iOrigin[3]
    get_players(iPlayers,iNumPlayers,"a")
    for (new i = 0; i < iNumPlayers; i++) 
    {
        iPlayer = iPlayers[i]
        if(get_user_health(iPlayer)< 20)
        {
            if (predator[iPlayer])
            {
                get_user_origin(iPlayer,iOrigin)
                fx_bleed_green(iOrigin)
                fx_blood_small_green(iOrigin,5)
            }
            else
            {
                get_user_origin(iPlayer,iOrigin)
                fx_bleed_red(iOrigin)
                fx_blood_small_red(iOrigin,5)
            }
        }
    }
}
//---------------[DEATH BLOOD EFFECTS (HEADSHOT/GRANADE EXPLOTION)]---------------
public death_blood()
{
    if(!get_pcvar_num(pred_Enable_Predator))
        return;
        
    new iOrigin[3], sWeapon[32];

    new id         = read_data(2)
    new iHeadshot     = read_data(3)
    
    read_data(4,sWeapon,31)
    
    if (iHeadshot)
    {
        if(predator[id])
        {
            get_user_origin(id,iOrigin)
            fx_headshot_green(iOrigin)
            fx_blood_large_green(iOrigin,2)
            fx_blood_small_green(iOrigin,5)
        }
        else
        {
            get_user_origin(id,iOrigin)
            fx_headshot_red(iOrigin)
            fx_blood_large_red(iOrigin,2)
            fx_blood_small_red(iOrigin,5)
        }
    }
    else if (equal(sWeapon,"grenade"))
    {
        if(predator[id])
        {
            get_user_origin(id,iOrigin)
            fx_blood_green(iOrigin)        // Effects
            fx_blood_green(iOrigin)
            fx_blood_green(iOrigin)
            fx_bleed_green(iOrigin)
            fx_bleed_green(iOrigin)
            fx_headshot_green(iOrigin)
            fx_trans(id,0)
            fx_gib_explode(iOrigin)
            fx_blood_large_green(iOrigin,10)
            fx_blood_small_green(iOrigin,25)
            iOrigin[2] = iOrigin[2]-20    // Hide body
            set_user_origin(id,iOrigin)
        }
        else
        {
            get_user_origin(id,iOrigin)
            fx_blood_red(iOrigin)        // Effects
            fx_blood_red(iOrigin)
            fx_blood_red(iOrigin)
            fx_bleed_red(iOrigin)
            fx_bleed_red(iOrigin)
            fx_headshot_red(iOrigin)
            fx_trans(id,0)
            fx_gib_explode(iOrigin)
            fx_blood_large_red(iOrigin,10)
            fx_blood_small_red(iOrigin,25)
            iOrigin[2] = iOrigin[2]-20    // Hide body
            set_user_origin(id,iOrigin)
        }
    } 
    if(predator[id])
    {
        fx_blood_small_green(iOrigin,12)
        fx_blood_large_green(iOrigin,5)
    }
    else
    {
        fx_blood_small_red(iOrigin,12)
        fx_blood_large_red(iOrigin,5)
    }
}

//---------------[AUTO BIND SYSTEM]---------------
public pred_bind(id)
{
    if(!get_pcvar_num(pred_Enable_Predator))
        return;
        
    client_cmd(id, "bind p pcview")
    client_cmd(id, "bind mouse3 ppfire")
    console_print(id, "[PRED] %L", LANG_PLAYER, "PRED_INFO_BIND")
}

//---------------[PLAYER CONNECT]---------------
public client_connect(id)
{    
    onoroff[id]    = 0
    predator[id]    = 0
    plasma[id]    = 0
    set_task(15.0,"check_bind",id)
}

//---------------[CHECK AUTO BIND]---------------
public check_bind(id)
{
    if(!get_pcvar_num(pred_Enable_Predator))
        return;
        
    if(get_pcvar_num(pred_Enable_AutoBind))
        pred_bind(id)
}
//---------------[BODY HEAT AND LIGHTSIGHT SYSTEM]---------------
public func_bodyheat()
{
    new players[32], origin[3];
    new pnum, idheat, id;
    new is_alive         = is_user_alive(id)
    new heat_is_alive     = is_user_alive(idheat)
    
    get_players(players,pnum,"a")
    for (new i = 0; i < pnum; i++)
    {
        id = players[i]
        
        if(predator[id])
        {
            if (onoroff[id]==1 && is_alive)
            {
                for (new j = 0; j < pnum; j++)
                {
                    idheat = players[j]
                    
                    if (idheat != id && !predator[idheat] && heat_is_alive)
                    {
                        get_user_origin(idheat,origin,0)
                        message_begin(MSG_ONE,SVC_TEMPENTITY,origin,id)
                        write_byte(21)
                        write_coord(origin[0])
                        write_coord(origin[1])
                        write_coord(origin[2])
                        write_coord(origin[0])
                        write_coord(origin[1])
                        write_coord(origin[2]+30)
                        write_short(gTrailModel)
                        write_byte(0)
                        write_byte(1)
                        write_byte(6)
                        write_byte(60)
                        write_byte(1)
                        write_byte(250)         // red
                        write_byte(60)             // green
                        write_byte(0)             // blue
                        write_byte(255)         // brightness
                        write_byte(0)
                        message_end()
                    }
                }
            }
            if (onoroff[id]==2 && is_alive)
            {
                for (new j = 0; j < pnum; j++)
                {
                    idheat = players[j]
                    if (idheat != id && predator[idheat] && heat_is_alive)
                    {
                        get_user_origin(idheat,origin,0)
                        message_begin(MSG_ONE,SVC_TEMPENTITY,origin,id)
                        write_byte(21)
                        write_coord(origin[0])
                        write_coord(origin[1])
                        write_coord(origin[2])
                        write_coord(origin[0])
                        write_coord(origin[1])
                        write_coord(origin[2]+30)
                        write_short(gTrailModel)
                        write_byte(0)
                        write_byte(1)
                        write_byte(6)
                        write_byte(60)
                        write_byte(1)
                        write_byte(255)         // red
                        write_byte(255)         // green
                        write_byte(255)         // blue
                        write_byte(255)         // brightness
                        write_byte(0)
                        message_end()
                    }
                }
            }
        }
    }
}
//---------------[PREDATOR HELP]---------------
public pred_help(id)
{
    if(!get_pcvar_num(pred_Enable_Predator))
        return;
    
    new szMotdName[32]
    formatex(szMotdName, 31, "%L", LANG_PLAYER, "PRED_MOTD_HEADER");
    show_motd(id,"/addons/amxmodx/predhelp.txt",szMotdName)
}
//---------------[PREDATOR COST CHECK]---------------
public pred_cost(id)
{
    if(!get_pcvar_num(pred_Enable_Predator))
        return;
        
    new msg[101]
    format(msg,100,"^x01[PRED] %L", get_pcvar_num(pred_Frags_Price), get_pcvar_num(pred_Money_Price), LANG_PLAYER, "PRED_INFO_BEING")
    message_begin(MSG_ONE,MsgSayText,{0,0,0},id)
    write_byte(id)
    write_string(msg)
    message_end()
}
//---------------[PREDATOR ON CHECK]---------------
public pred_on(id)
{
    new msg[101]
    if(get_pcvar_num(pred_Enable_Predator))
        format(msg,100,"^x01 [PRED] %L ^x03 %L", LANG_PLAYER, "PRED_MOD_IS", "PRED_ON")
    else
        format(msg,100,"^x01 [PRED] %L ^x03 %L", LANG_PLAYER, "PRED_MOD_IS", "PRED_OFF")
        
    message_begin(MSG_ONE,MsgSayText,{0,0,0},id)
    write_byte(id)
    write_string(msg)
    message_end()
}
//---------------[BUY PREDATOR]---------------
public pred_buy(id)
{
    if(!get_pcvar_num(pred_Enable_Predator))
        return PLUGIN_HANDLED;
        
    if(get_pcvar_num(pred_Game_Mode)!=1)
    {
        new msg[101]
        format(msg,100,"^x01[PRED] %L", LANG_PLAYER, "PRED_DISABLED")
        message_begin(MSG_ONE,MsgSayText,{0,0,0},id)
        write_byte(id)
        write_string(msg)
        message_end()
        return PLUGIN_HANDLED;
    }
        
    new pred_price_frags    = get_user_frags(id) - get_pcvar_num(pred_Frags_Price) 
    new pred_price_money     = cs_get_user_money(id) - get_pcvar_num(pred_Money_Price)
    
    if(get_pcvar_num(pred_Frags_Buy))
        if(pred_price_frags >= 0)
            set_user_frags(id, pred_price_frags)
            
    if(get_pcvar_num(pred_Money_Buy))
        if(pred_price_money >= 0)
            cs_set_user_money(id, pred_price_money)
            
    make_predator(0, id, 0, 0)
    return PLUGIN_HANDLED;
}
__________________

Last edited by mando127; 08-02-2009 at 15:40.
mando127 is offline
Send a message via Skype™ to mando127
devil001
Member
Join Date: Feb 2008
Old 08-02-2009 , 15:49   Re: Ultimate Predator
Reply With Quote #18

1. are you using the latest version of cs 1.6?
2. are you using the latest version of metamod and amxmodx?
3. have you checked the models you added/replaced?


svc_bad is usually happening by model changes. The delay I added should fix the problem plugin wise. Please try to use the original models included and tell me if this problem persists. I will test this on my private server with a couple of players to see if I can reproduce this.
__________________
Host Mist - Helping People Say Hello World
Shared | VPS | Dedicated Hosting
Backup-Spot
Secure,Fast and Reliable Offsite Backups
devil001 is offline
mando127
Veteran Member
Join Date: Dec 2006
Location: virginia
Old 08-02-2009 , 16:03   Re: Ultimate Predator
Reply With Quote #19

same crap i try it with your stock files it kick right at the round start and yes all my server files are updated.

come see for your self : 66.225.198.21:27015
__________________
mando127 is offline
Send a message via Skype™ to mando127
pablitoocavs
BANNED
Join Date: Jan 2009
Location: Buenos Aires
Old 08-02-2009 , 23:27   Re: Ultimate Predator
Reply With Quote #20

works for cs 1.6 no steam?
pablitoocavs is offline
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 23:53.


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