点通粉丝 发表于 2009-1-13 14:40:58

有很多..比如什么呢???????

8874323 发表于 2009-1-13 14:44:14

刀杀那个货不对板!!! 刀杀后只是一道闪电,欺骗我感情...

点通粉丝 发表于 2009-1-13 14:47:42

你是版主来的哦..你不会自己改改啊..这么简单..源码都发出来啦

点通粉丝 发表于 2009-1-13 14:51:31

哦我忘啦..那个特效是随机的.一共是五个特效..闪电只是其中一个
版主老大..要点改五使我教你吧..自己改才好完的..知不

点通粉丝 发表于 2009-1-15 03:02:36

]#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Starting Health"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

new g_pcvarHealth

public plugin_init()
{
        register_plugin(PLUGIN,VERSION,AUTHOR)
       
        g_pcvarHealth = register_cvar("amx_starthp", "200")
       
        RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
}

public player_spawn(id)
{       
        if(is_user_alive(id))
        {
                new Float:fHealth = get_pcvar_float(g_pcvarHealth)
                if(fHealth != 100.0)
                {
                        set_pev(id, pev_health, fHealth)
                }
        }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
所有人一出生有200血源码
CVARs :
amx_starthp 200 34# 点通粉丝

点通粉丝 发表于 2009-1-15 03:12:13


*/

#define VERSION        "1.0"

#include <amxmodx>
#include <amxmisc>
#include <chr_engine>

#define FLAG_SHOWDEALT                1
#define FLAG_SHOWDEALTESP        2
#define FLAG_SHOWTAKEN                4
#define FLAG_SHOWTAKENESP        8

#define ESP_HUD_TIMELEN                0.2

#define TASK_VICTIM                100
#define TASK_ATTACKER                1000

new damage_target
new damage_last

new damaged_target
new damaged_last
new hudchannel1, hudchannel2, mode, timelen

public plugin_init()
{
        register_plugin("Damage Dealt Hud w/ ESP",VERSION,"GHW_Chronic")
        hudchannel1 = register_cvar("espdmg_channel","4")
        hudchannel2 = register_cvar("espdmg_channel2","3")
        mode = register_cvar("espdmg_flags","13")
        timelen = register_cvar("espdmg_timelen","2.0")

        register_event("Damage","damage_hook","b","2>0")

        register_forward(FM_PlayerPreThink,"PreThink_Hook")
}

public damage_hook(id)
{
        if(is_user_alive(id))
        {
                new target = get_user_attacker(id)
                if(id!=target && is_user_alive(target))
                {
                        damage_target = target
                        damage_last = read_data(2)
                        damaged_target = id
                        damaged_last = damage_last

                        remove_task(id + TASK_VICTIM)
                        set_task(get_pcvar_float(timelen),"hud_off",id + TASK_VICTIM)
                        remove_task(target + TASK_ATTACKER)
                        set_task(get_pcvar_float(timelen),"hud_off2",target + TASK_ATTACKER)

                        static colors
                        new mode_cvar = get_pcvar_num(mode)
                        new bool:sameteam
                        if(get_user_team(id)==get_user_team(damage_target)) sameteam = true
                        if((mode_cvar & FLAG_SHOWTAKEN) && !(mode_cvar & FLAG_SHOWTAKENESP))
                        {
                                colors = 255
                                colors = 255

                                if(!sameteam)
                                        colors = 0
                                else
                                        colors = 0

                                set_hudmessage(colors,colors,0,0.5,0.5,0,0.0,get_pcvar_float(timelen),0.0,0.0,get_pcvar_num(hudchannel1))
                                show_hudmessage(id,"%d",damage_last)
                        }
                        if((mode_cvar & FLAG_SHOWDEALT) && !(mode_cvar & FLAG_SHOWDEALTESP))
                        {
                                colors = 255
                                colors = 255

                                if(!sameteam)
                                        colors = 0
                                else
                                        colors = 0

                                set_hudmessage(0,colors,colors,0.5,0.4,0,0.0,get_pcvar_float(timelen),0.0,0.0,get_pcvar_num(hudchannel2))
                                show_hudmessage(id,"%d",damaged_last)
                        }
                }
        }
}

public hud_off(id) damage_target = 0
public hud_off2(id) damaged_target = 0

public PreThink_Hook(id)
{
        if(!is_user_alive(id)) return ;

        static Float:origin, Float:hloc, colors
        new channel = 0
        new mode_cvar = get_pcvar_num(mode)

        if((mode_cvar & FLAG_SHOWTAKENESP) && damage_target)
        {
                if(is_user_alive(damage_target))
                {
                        pev(damage_target,pev_origin,origin)
                        if(get_hudmessage_locs(id,origin,hloc))
                        {
                                channel = get_pcvar_num(hudchannel1)
                                if(channel<1 || channel>4)
                                        channel = 4

                                colors = 255
                                colors = 255

                                if(get_user_team(id)!=get_user_team(damage_target))
                                        colors = 0
                                else
                                        colors = 0

                                set_hudmessage(colors,colors,0,hloc,hloc,0,0.0,ESP_HUD_TIMELEN,0.0,0.0,channel)
                                show_hudmessage(id,"%d",damage_last)
                        }
                }
                else
                        damage_target = 0
        }

        if((mode_cvar & FLAG_SHOWDEALTESP) && damaged_target)
        {
                if(is_user_alive(damaged_target))
                {
                        pev(damaged_target,pev_origin,origin)
                        if(get_hudmessage_locs(id,origin,hloc))
                        {
                                if(channel>=1 && channel<=4)
                                {
                                        if(damaged_target==damage_target)
                                        {
                                                hloc -= 0.03
                                        }
                                        channel = get_pcvar_num(hudchannel2)
                                }
                                if(channel<1 || channel>4)
                                        channel = 3

                                colors = 255
                                colors = 255

                                if(get_user_team(id)!=get_user_team(damaged_target))
                                        colors = 0
                                else
                                        colors = 0

                                set_hudmessage(0,colors,colors,hloc,hloc,0,0.0,ESP_HUD_TIMELEN,0.0,0.0,channel)
                                show_hudmessage(id,"%d",damaged_last)
                        }
                }
                else
                        damaged_target = 0
        }
}
35# 点通粉丝

This plugin is much like bullet_damage(f117bomb) with 1 main difference. This plugin has the ability to make the damage number follow the person who shot you, or configurably the person you just shot.

CVARs:
espdmg_flags - Bitflag of the flags below (add the numbers up to get the value to set this to) (Default: 13)
espdmg_timelen - How long the damage number stays on the screen (Default: 2.0)
espdmg_channel - Primary constant hud channel used by plugin (Default: 4)
espdmg_channel2 - Secondary contant hud channel used by plugin (Default: 3)

Flags:
Code:
FLAG_SHOWDEALT                1        Dmg Dealt appears on screen        (Default)
FLAG_SHOWDEALTESP        2        Dmg Dealt follows target (ESP)
FLAG_SHOWTAKEN                4        Dmg Taken appears on screen        (Default)
FLAG_SHOWTAKENESP        8        Dmg Taken follows shooter (ESP)        (Default)
Requires CHR_Engine Stocks. (So download .amxx file instead of using the "Get Plugin" link.)

点通粉丝 发表于 2009-1-15 03:41:50


*/

#define VERSION        "1.2"

#include <amxmodx>
#include <amxmisc>
#include <fun>

public plugin_init()
{
        register_plugin("Disco Mode",VERSION,"GHW_Chronic")
        register_concmd("amx_disco","disco",ADMIN_LEVEL_A," Disco Mode <1/ON 0/OFF> ")
}

public check()
{
        new players, num
        get_players(players,num,"ah")
        for(new i=0;i<num;i++)
        {
                new num1 = random_num(0,255)
                new num2 = random_num(0,255)
                new num3 = random_num(0,255)
                new alpha = random_num(40,65)
                message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},players)
                write_short(~0)
                write_short(~0)
                write_short(1<<12)
                write_byte(num1)
                write_byte(num2)
                write_byte(num3)
                write_byte(alpha)
                message_end()
                set_user_rendering(players,kRenderFxGlowShell,num1,num2,num3,kRenderTransAlpha,255)
        }
}

public disco(id,level,cid)
{
        if(!cmd_access(id,level,cid,2))
        {
                return PLUGIN_HANDLED
        }

        new arg1
        read_argv(1,arg1,31)

        if(equali(arg1,"1") || equali(arg1,"on"))
        {
                console_print(id," Disco Mode Activated")
                client_print(0,print_chat," W00t W00t. Disco Mode On!")
                set_task(0.5,"check",1337,"",0,"b")
        }
        else
        {
                remove_task(1337)

                console_print(id," Disco Mode Off")
                client_print(0,print_chat," Disco Mode Disabled :'(")

                set_task(0.2,"unglow")
        }
        return PLUGIN_HANDLED
}

public unglow()
{
        new players, num
        get_players(players,num,"h")
        for(new i=0;i<num;i++)
        {
                message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},players)
                write_short(~0)
                write_short(~0)
                write_short(1<<12)
                write_byte(0)
                write_byte(0)
                write_byte(0)
                write_byte(0)
                message_end()

                set_user_rendering(players)
        }
}
36# 点通粉丝

五彩屏幕变色源码
命令:
amx_disco 1
1/开 0/关

wangshengzhen 发表于 2009-1-15 17:08:25

好东东,最好在首页加个总目录介绍

点通粉丝 发表于 2009-1-16 05:29:01

38# wangshengzhen

不用下截的 地球冰炸弹-即O5
过测试cs1.5
/*-------------------
INCLUDES AND DEFINES
--------------------*/

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

new hasFrostNade;
new isChilled;
new isFrozen;

new novaDisplay;
new Float:oldSpeed;

new glassGibs;
new trailSpr;
new smokeSpr;
new exploSpr;

#define FROST_RADIUS        240.0
#define FROST_R        0
#define FROST_G        206
#define FROST_B        209

#define TASK_REMOVE_CHILL        200
#define TASK_REMOVE_FREEZE        250

/*----------------
LOADING FUNCTIONS
-----------------*/

// 3, 2, 1: blastoff!
public plugin_init()
{
        register_plugin("FrostNades","0.12b","Avalanche");

        register_cvar("fn_on","1");
        register_cvar("fn_hitself","0");
        register_cvar("fn_los","0");

        register_cvar("fn_maxdamage","50.0");
        register_cvar("fn_mindamage","50.0");

        register_cvar("fn_override","1");
        register_cvar("fn_price","150");

        register_cvar("fn_chill_maxchance","1000");
        register_cvar("fn_chill_minchance","1000");
        register_cvar("fn_chill_duration","4");
        register_cvar("fn_chill_speed","60");

        register_cvar("fn_freeze_maxchance","1000");
        register_cvar("fn_freeze_minchance","1000");
        register_cvar("fn_freeze_duration","5");

        register_clcmd("say /fn","buy_frostnade",-1);
        register_clcmd("say_team /fn","buy_frostnade",-1);
        register_clcmd("say /frostnade","buy_frostnade",-1);
        register_clcmd("say_team /frostnade","buy_frostnade",-1);

        register_event("DeathMsg","event_deathmsg","a");
        register_event("CurWeapon","event_curweapon","b","1=1");
        register_forward(FM_SetModel,"fw_setmodel");
        register_think("grenade","think_grenade");

        register_logevent("event_roundend",2,"0=World triggered","1=Round_End");
}

// get in the cache and be quiet!!
public plugin_precache() {
        precache_model("models/sat_globe.mdl");
        glassGibs = precache_model("models/glassgibs.mdl");

        precache_sound("ambience/wolfhowl01.wav"); // grenade explodes
        precache_sound("warcraft3/impalehit.wav"); // player is frozen
        precache_sound("warcraft3/impalelaunch1.wav"); // frozen wears off
        precache_sound("player/pl_duct2.wav"); // player is chilled

        trailSpr = precache_model("sprites/laserbeam.spr");
        smokeSpr = precache_model("sprites/steam1.spr");
        exploSpr = precache_model("sprites/shockwave.spr");
}

/*------------
HOOK HANDLERS
-------------*/

// player wants to buy a grenade
public buy_frostnade(id)
{
        if(!get_cvar_num("fn_on"))
                return PLUGIN_CONTINUE;

        // can't buy while dead
        if(!is_user_alive(id))
                return PLUGIN_HANDLED;

        // no custom buy needed
        if(get_cvar_num("fn_override"))
                return PLUGIN_HANDLED;

        // not in a buyzone
        if(!cs_get_user_buyzone(id))
                return PLUGIN_HANDLED;

        // not enough money
        new money = cs_get_user_money(id);

        if(money < get_cvar_num("fn_price"))
        {
                client_print(id,print_center,"#Not_Enough_Money");
                return PLUGIN_HANDLED;
        }

        // already have a frost grenade
        if(hasFrostNade)
        {
                client_print(id,print_center,"#Cstrike_Already_Own_Weapon");
                return PLUGIN_HANDLED;
        }

        // already have a smoke grenade
        new weapons, num, i;
        get_user_weapons(id,weapons,num);

        for(i=0;i<num;i++)
        {
                if(weapons == CSW_SMOKEGRENADE)
                {
                        client_print(id,print_center,"You already own a smoke grenade.");
                        return PLUGIN_HANDLED;
                }
        }

        // gimme gimme
        hasFrostNade = 1;
        give_item(id,"weapon_smokegrenade");
        cs_set_user_money(id,money - get_cvar_num("fn_price"));

        // display icon
        message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},id);
        write_byte(1); // status (0=hide, 1=show, 2=flash)
        write_string("dmg_cold"); // sprite name
        write_byte(FROST_R); // red
        write_byte(FROST_G); // green
        write_byte(FROST_B); // blue
        message_end();

        return PLUGIN_HANDLED;
}

// prethinking
public client_PreThink(id)
{
        if(!get_cvar_num("fn_on"))
                return;

        // if they are frozen, make sure they don't move at all
        if(isFrozen)
        {
                // stop motion
                entity_set_vector(id,EV_VEC_velocity,Float:{0.0,0.0,0.0});

                new button = get_user_button(id), oldbuttons = entity_get_int(id,EV_INT_oldbuttons);
                new flags = entity_get_int(id,EV_INT_flags);

                // if are on the ground and about to jump, set the gravity too high to really do so
                if((button & IN_JUMP) && !(oldbuttons & IN_JUMP) && (flags & FL_ONGROUND))
                        entity_set_float(id,EV_FL_gravity,999999.9); // I CAN'T STAND THE PRESSURE

                // otherwise, set the gravity so low that they don't fall
                else
                        entity_set_float(id,EV_FL_gravity,0.000001); // 0.0 doesn't work
        }
}

// someone dies
public event_deathmsg()
{
        if(!get_cvar_num("fn_on"))
                return;

        new id = read_data(2);

        if(hasFrostNade)
        {
                hasFrostNade = 0;
                message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},id);
                write_byte(0); // status (0=hide, 1=show, 2=flash)
                write_string("dmg_cold"); // sprite name
                write_byte(FROST_R); // red
                write_byte(FROST_G); // green
                write_byte(FROST_B); // blue
                message_end();
        }

        if(isChilled)
                remove_chill(TASK_REMOVE_CHILL+id);

        if(isFrozen)
                remove_freeze(TASK_REMOVE_FREEZE+id);
}

// a player changes weapons
public event_curweapon(id)
{
        if(!get_cvar_num("fn_on"))
                return;

        // flash icon if frost grenade is out
        if(hasFrostNade && read_data(2) == CSW_SMOKEGRENADE)
        {
                message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},id);
                write_byte(2); // status (0=hide, 1=show, 2=flash)
                write_string("dmg_cold"); // sprite name
                write_byte(FROST_R); // red
                write_byte(FROST_G); // green
                write_byte(FROST_B); // blue
                message_end();
        }
        else if(hasFrostNade)
        {
                message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},id);
                write_byte(1); // status (0=hide, 1=show, 2=flash)
                write_string("dmg_cold"); // sprite name
                write_byte(FROST_R); // red
                write_byte(FROST_G); // green
                write_byte(FROST_B); // blue
                message_end();
        }

        if(isChilled)
                chill_player(id);

        if(isFrozen)
                freeze_player(id);
}

// when a model is set
public fw_setmodel(ent,model[])
{
        if(get_cvar_num("fn_on") < 1 || !is_valid_ent(ent))
                return FMRES_IGNORED;

        // not a smoke grenade
        if(!equali(model,"models/w_smokegrenade.mdl"))
                return FMRES_IGNORED;

        // not yet thrown
        if(entity_get_float(ent,EV_FL_gravity) == 0.0)
                return FMRES_IGNORED;

        new owner = entity_get_edict(ent,EV_ENT_owner);

        // check to see if this isn't a frost grenade
        if(!get_cvar_num("fn_override") && !hasFrostNade)
                return FMRES_IGNORED;

        // store team in the grenade
        entity_set_int(ent,EV_INT_team,get_user_team(owner));

        // hide icon
        if(hasFrostNade)
        {
                hasFrostNade = 0;
                message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},owner);
                write_byte(0); // status (0=hide, 1=show, 2=flash)
                write_string("dmg_cold"); // sprite name
                write_byte(FROST_R); // red
                write_byte(FROST_G); // green
                write_byte(FROST_B); // blue
                message_end();
        }

        // give it a blue glow and a blue trail
        set_rendering(ent,kRenderFxGlowShell,FROST_R,FROST_G,FROST_B);
        set_beamfollow(ent,10,10,FROST_R,FROST_G,FROST_B,100);

        // hack? flag to remember to track this grenade's think
        entity_set_int(ent,EV_INT_bInDuck,1);

        // track for when it will explode
        set_task(1.6,"grenade_explode",ent);

        return FMRES_IGNORED;
}

// think, grenade. think, damnit!
public think_grenade(ent)
{
        if(get_cvar_num("fn_on") < 1 || !is_valid_ent(ent))
                return PLUGIN_CONTINUE;

        // hack? not a smoke grenade, or at least not a popular one
        if(!entity_get_int(ent,EV_INT_bInDuck))
                return PLUGIN_CONTINUE;

        // stop it from exploding
        return PLUGIN_HANDLED;
}

// the round ends
public event_roundend()
{
        new i;
        for(i=1;i<=32;i++)
        {
                if(isChilled)
                        remove_chill(TASK_REMOVE_CHILL+i);

                if(isFrozen)
                        remove_freeze(TASK_REMOVE_FREEZE+i);
        }
}

/*-------------------
OTHER MAIN FUNCTIONS
--------------------*/

// and boom goes the dynamite
public grenade_explode(ent)
{
        if(get_cvar_num("fn_on") < 1 || !is_valid_ent(ent))
                return;

        // make the smoke
        new origin, Float:originF;
        entity_get_vector(ent,EV_VEC_origin,originF);
        FVecIVec(originF,origin);

        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte(5); // TE_SMOKE
        write_coord(origin); // x
        write_coord(origin); // y
        write_coord(origin); // z
        write_short(smokeSpr); // sprite
        write_byte(random_num(35,45)); // scale
        write_byte(5); // framerate
        message_end();

        // debug
        //show_xyz(origin,floatround(FROST_RADIUS));

        // explosion
        create_blast(origin);
        emit_sound(ent,CHAN_WEAPON,"ambience/wolfhowl01.wav",1.0,ATTN_NORM,0,PITCH_NORM);

        // get grenade's owner
        new owner = entity_get_edict(ent,EV_ENT_owner);

        // get grenades team
        new nadeTeam = entity_get_int(ent,EV_INT_team);

        // collisions
        new player;
        while((player = find_ent_in_sphere(player,originF,FROST_RADIUS)) != 0)
        {
                // not a player, or a dead one
                if(!is_user_alive(player))
                        continue;

点通粉丝 发表于 2009-1-16 05:30:48



                // don't hit teammates if friendlyfire is off, but don't count self as teammate
                if((!get_cvar_num("mp_friendlyfire") && nadeTeam == get_user_team(player)) && owner != player)
                        continue;

                // don't hit self if the cvar is set
                if(owner == player && !get_cvar_num("fn_hitself"))
                        continue;

                // if user was frozen this check
                new wasFrozen;

                // get this player's origin for calculations
                new Float:playerOrigin;
                entity_get_vector(player,EV_VEC_origin,playerOrigin);

                // check for line of sight
                if(get_cvar_num("fn_los"))
                {
                        new Float:endPos;
                        trace_line(ent,originF,playerOrigin,endPos);

                        // no line of sight (end point not at player's origin)
                        if(endPos != playerOrigin && endPos != playerOrigin && endPos != playerOrigin)
                                continue;
                }

                // calculate our odds
                new Float:chillChance = radius_calucation(playerOrigin,originF,FROST_RADIUS,get_cvar_float("fn_chill_maxchance"),get_cvar_float("fn_chill_minchance"));
                new Float:freezeChance = radius_calucation(playerOrigin,originF,FROST_RADIUS,get_cvar_float("fn_freeze_maxchance"),get_cvar_float("fn_freeze_minchance"));

                // deal damage
                if(get_cvar_float("fn_maxdamage") > 0.0)
                {
                        new Float:damage = radius_calucation(playerOrigin,originF,FROST_RADIUS,get_cvar_float("fn_maxdamage"),get_cvar_float("fn_mindamage"));

                        // half damage for friendlyfire
                        if(nadeTeam == get_user_team(player))
                                damage *= 0.5;

                        // see if this will kill player
                        if(floatround(entity_get_float(player,EV_FL_health)) - damage <= 0)
                        {
                                user_silentkill(player);
                                make_deathmsg(owner,player,0,"frostgrenade");

                                // update score
                                if(nadeTeam == get_user_team(player))
                                {
                                        set_user_frags(owner,get_user_frags(owner)-1);

                                        if(get_cvar_num("mp_tkpunish"))
                                                cs_set_user_tked(owner,1,0);
                                }
                                else
                                        set_user_frags(owner,get_user_frags(owner)+1);

                                // update scoreboard
                                message_begin(MSG_BROADCAST,get_user_msgid("ScoreInfo"));
                                write_byte(owner);
                                write_short(get_user_frags(owner));
                                write_short(cs_get_user_deaths(owner));
                                write_short(0);
                                write_short(get_user_team(owner));
                                message_end();

                                message_begin(MSG_BROADCAST,get_user_msgid("ScoreInfo"));
                                write_byte(player);
                                write_short(get_user_frags(player));
                                write_short(cs_get_user_deaths(player));
                                write_short(0);
                                write_short(get_user_team(player));
                                message_end();

                                continue;
                        }

                        fakedamage(player,"frostgrenade",damage,3);
                }

                // check for freeze
                if(random_num(1,100) <= floatround(freezeChance) && !isFrozen)
                {
                        wasFrozen = 1;
                        freeze_player(player);
                        isFrozen = 1;

                        emit_sound(player,CHAN_BODY,"warcraft3/impalehit.wav",1.0,ATTN_NORM,0,PITCH_HIGH);
                        set_task(get_cvar_float("fn_freeze_duration"),"remove_freeze",TASK_REMOVE_FREEZE+player);

                        // if they don't already have a frostnova
                        if(!is_valid_ent(novaDisplay))
                        {
                                // create the entity
                                new nova = create_entity("info_target");

                                // give it a size
                                new Float:maxs, Float:mins;
                                maxs = Float:{ 8.0, 8.0, 4.0 };
                                mins = Float:{ -8.0, -8.0, -4.0 };
                                entity_set_size(nova,mins,maxs);

                                // random orientation
                                new Float:angles;
                                angles = float(random_num(0,359));
                                entity_set_vector(nova,EV_VEC_angles,angles);

                                // put it at their feet
                                new Float:playerMins, Float:novaOrigin;
                                entity_get_vector(player,EV_VEC_mins,playerMins);
                                entity_get_vector(player,EV_VEC_origin,novaOrigin);
                                novaOrigin += playerMins;
                                entity_set_vector(nova,EV_VEC_origin,novaOrigin);

                                // mess with the model
                                entity_set_model(nova,"models/sat_globe.mdl");
                                entity_set_float(nova,EV_FL_animtime,1.0)
                                entity_set_float(nova,EV_FL_framerate,1.0)
                                entity_set_int(nova,EV_INT_sequence,0);
                                set_rendering(nova,kRenderFxNone,FROST_R,FROST_G,FROST_B,kRenderTransColor,100);

                                // remember this
                                novaDisplay = nova;
                        }
                }

                // check for chill
                if(random_num(1,100) <= floatround(chillChance) && !isChilled)
                {
                        chill_player(player);
                        isChilled = 1;

                        // don't play sound if player just got frozen,
                        // reason being it will be overriden and I like the other sound better
                        if(!wasFrozen)
                                emit_sound(player,CHAN_BODY,"player/pl_duct2.wav",1.0,ATTN_NORM,0,PITCH_LOW);

                        set_task(get_cvar_float("fn_chill_duration"),"remove_chill",TASK_REMOVE_CHILL+player);
                }
        }

        // get rid of the old grenade
        remove_entity(ent);
}

// apply the effects of being chilled
public chill_player(id)
{
        // don't mess with their speed if they are frozen
        if(isFrozen)
                set_user_maxspeed(id,1.0); // 0.0 doesn't work
        else
        {
                new speed = floatround(get_user_maxspeed(id) * (get_cvar_float("fn_chill_speed") / 100.0));
                set_user_maxspeed(id,float(speed));
        }

        // add a blue tint to their screen
        message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id);
        write_short(~0); // duration
        write_short(~0); // hold time
        write_short(0x0004); // flags: FFADE_STAYOUT, ignores the duration, stays faded out until new ScreenFade message received
        write_byte(FROST_R); // red
        write_byte(FROST_G); // green
        write_byte(FROST_B); // blue
        write_byte(100); // alpha
        message_end();

        // make them glow and have a trail
        set_user_rendering(id,kRenderFxGlowShell,FROST_R,FROST_G,FROST_B,kRenderNormal,1);

        // bug fix
        if(!isFrozen)
                set_beamfollow(id,30,8,FROST_R,FROST_G,FROST_B,100);
}

// apply the effects of being frozen
public freeze_player(id)
{
        new Float:speed = get_user_maxspeed(id);

        // remember their old speed for when they get unfrozen,
        // but don't accidentally save their frozen speed
        if(speed > 1.0 && speed != oldSpeed)
        {
                // save their unchilled speed
                if(isChilled)
                {
                        new speed = floatround(get_user_maxspeed(id) / (get_cvar_float("fn_chill_speed") / 100.0));
                        oldSpeed = float(speed);
                }
                else
                        oldSpeed = speed;
        }

        // stop them from moving
        set_user_maxspeed(id,1.0); // 0.0 doesn't work
        entity_set_vector(id,EV_VEC_velocity,Float:{0.0,0.0,0.0});
        entity_set_float(id,EV_FL_gravity,0.000001); // 0.0 doesn't work
}

// a player's chill runs out
public remove_chill(taskid)
{
        remove_task(taskid);
        new id = taskid - TASK_REMOVE_CHILL;

        // no longer chilled
        if(!isChilled)
                return;

        isChilled = 0;

        // only apply effects to this player if they are still connected
        if(is_user_connected(id))
        {
                // clear screen fade
                message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id);
                write_short(0); // duration
                write_short(0); // hold time
                write_short(0); // flags
                write_byte(0); // red
                write_byte(0); // green
                write_byte(0); // blue
                write_byte(0); // alpha
                message_end();
39# 点通粉丝
页: 1 2 3 [4] 5 6 7
查看完整版本: 经点通高手重新改过的一些好插件源码