点通粉丝 发表于 2009-1-9 23:51:13

经点通高手重新改过的一些好插件源码

本帖最后由 点通粉丝 于 2009-1-10 07:34 编辑

/*
sv_customsky <0-2>
0 : plugin off.
1 : change sky based on map (edit custom_sky.cfg). (Default)
2 : change sky based on sv_customskyname cvar.
3 : change sky based on random sky
sv_customskyname "test_" - use if sv_customsky is set to 2.
backalley,badlands,blue,city1,cliff,cx,de_storm,desert,Des,doom1,DrkG,dusk,forest,green,grnplsnt,morningdew,office,snow,tornsky,TrainYard,tsccity_,snowlake_
#define PLUGIN         "custom sky"
#define VERSION "1.1"
#define AUTHOR         "cheap_suit"
*/

#include <amxmodx>
#include <amxmisc>

#define PLUGIN         "SKY"
#define VERSION "1.0"
#define AUTHOR         "CS-FG"

#define max_suffix 6
new g_suffix = { "up", "dn", "ft", "bk", "lf", "rt" }
new skyarray={"backalley","badlands","blue","city1","cliff","cx","de_storm","desert","Des","doom1","DrkG","dusk","forest","green","grnplsnt","morningdew","office","snow","tornsky","TrainYard","tsccity_","snowlake_"}
public plugin_precache()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_cvar(PLUGIN, VERSION, FCVAR_SPONLY|FCVAR_SERVER)
       
        register_cvar("sv_customsky", "3")
        register_cvar("sv_customskyname", "test_")
       
        switch(get_cvar_num("sv_customsky"))
        {
                case 1:
                {
                        static configsdir
                        get_configsdir(configsdir, 31)
                       
                        static file
                        formatex(file, 63, "%s/custom_sky.cfg", configsdir)
                       
                        static mapname
                        get_mapname(mapname, 31)
                       
                        if(!file_exists(file))
                        {
                                write_file(file, "; Custom map sky config")
                                write_file(file, "; Format: <mapname><skyname>")
                        }
       
                        new line = 0, length = 0
                        static text, maptext, tgatext
                        while(read_file(file, line++, text, 127, length))
                        {
                                if((text == ';') || !length)
                                        continue
                                               
                                parse(text, maptext, 31, tgatext, 31)
                                if(equal(maptext, mapname))
                                {
                                        precache_sky(tgatext)
                                        break
                                }
                        }
                }
                case 2:
                {
                        static cvar_skyname
                        get_cvar_string("sv_customskyname", cvar_skyname, 31)
                       
                        if(strlen(cvar_skyname) > 0)
                                precache_sky(cvar_skyname)
                }
                case 3:
                {
                        static random_skyname
                        //get_cvar_string("sv_customskyname", random_skyname, 31)
                        new randomnum=random_num(0,21)
                        random_skyname=skyarray
                        if(strlen(random_skyname) > 0)
                                precache_sky(random_skyname)
                }

        }
}

public precache_sky(const skyname[])
{
        new bool:found = true
        static tgafile
       
        for(new i = 0; i < max_suffix; ++i)
        {
                formatex(tgafile, 34, "gfx/env/%s%s.tga", skyname, g_suffix)
                if(file_exists(tgafile))
                        precache_generic(tgafile)
                else
                {
                        log_amx("Cannot locate file '%s'", tgafile)
                        found = false
                        break
                }
        }
       
        if(found)
                set_cvar_string("sv_skyname", skyname)
}
CS1.5随机天空插件源码
在新的一年里.我也发一个好东东比.还在和我一样还完CS1.5的朋友一起用吧
在此感谢飞哥

点通粉丝 发表于 2009-1-9 23:55:54

本帖最后由 点通粉丝 于 2009-1-15 03:18 编辑

#include <amxmodx>
#include <amxmisc>
#define PLUGIN "skyblack"
#define VERSION "1.0"
#define AUTHOR "yathsing"
#define SKYNAME "space"

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
server_cmd("sv_skyname %s", SKYNAME)
}原版黑夜天空源码
以后发插件.大冢都用这样的格式发.多好啊.好源码也不会流失


以下网址的作者简直是天才.他写的插件是我的之爱
http://forums.alliedmods.net/search.php?searchid=3320413

lanmao 发表于 2009-1-10 00:55:05

:lol白痴。。 你都不说下这是什么插件?

点通粉丝 发表于 2009-1-10 04:14:42

本帖最后由 点通粉丝 于 2009-1-13 12:20 编辑

**** Hidden Message ***** 3# lanmao

**** Hidden Message *****

烟花spr请自行制作
手雷烟花爆炸效果源码

点通粉丝 发表于 2009-1-10 04:22:00

本帖最后由 点通粉丝 于 2009-1-13 12:25 编辑

#include <amxmodx>

#define PLUGIN "Deathtype Effects"
#define VERSION "1.0"
#define AUTHOR "anakin_cstrike"

#define TEMP_MSG        16
#define TEMP_MSG2        1936

new toggle_plugin,toggle_hs,toggle_kn,toggle_he,g_Smoke,g_Lightning,g_Explode;
public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR);
        register_event("DeathMsg","hook_death","a");
        toggle_plugin = register_cvar("death_effects","1");
        toggle_hs = register_cvar("hs_effect","1");
        toggle_kn = register_cvar("kn_effect","1");
        toggle_he = register_cvar("he_effect","1");
}
public plugin_precache()
{
        precache_sound("ambience/thunder_clap.wav");
        precache_sound("weapons/headshot2.wav");
        precache_sound("weapons/explode3.wav");
        g_Smoke = precache_model("sprites/steam1.spr");
        g_Lightning = precache_model("sprites/lgtning.spr");
        g_Explode = precache_model("sprites/white.spr");
        return PLUGIN_CONTINUE
}
public hook_death()
{
        if(get_pcvar_num(toggle_plugin) != 1) return PLUGIN_CONTINUE;
        if(!read_data(1)) return PLUGIN_CONTINUE;
        new wpn,vOrigin,coord;
        new victim = read_data(2);
        new hs = read_data(3);
        read_data(4,wpn,2);
        get_user_origin(victim,vOrigin);
        vOrigin -= 26
        coord = vOrigin + 150;
        coord = vOrigin + 150;
        coord = vOrigin + 800;
       
        if(hs && wpn != 'k' && wpn != 'r' && get_pcvar_num(toggle_hs) == 1)
        {
                create_explode(vOrigin);
                emit_sound(victim,CHAN_ITEM, "weapons/explode3.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        }
        if(wpn == 'k' && !hs && get_pcvar_num(toggle_kn) == 1)
        {
                create_thunder(coord,vOrigin);
                emit_sound(victim,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        }
        if(wpn == 'r' && !hs && get_pcvar_num(toggle_he) == 1)
        {
                create_blood(vOrigin);
                emit_sound(victim,CHAN_ITEM, "weapons/headshot2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        }
        return PLUGIN_CONTINUE;
}

create_explode(vec1)
{
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec1);
        write_byte(TE_BEAMCYLINDER);
        write_coord(vec1);
        write_coord(vec1);
        write_coord(vec1 + TEMP_MSG);
        write_coord(vec1);
        write_coord(vec1);
        write_coord(vec1 + TEMP_MSG2);
        write_short(g_Explode);
        write_byte(0);
        write_byte(0);
        write_byte(2);
        write_byte(16);
        write_byte(0);
        write_byte(188);
        write_byte(220);
        write_byte(255);
        write_byte(255);
        write_byte(0);
        message_end();

        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte(TE_EXPLOSION2);
        write_coord(vec1);
        write_coord(vec1);
        write_coord(vec1);
        write_byte(185);
        write_byte(10);
        message_end();
       
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec1);
        write_byte(TE_SMOKE);
        write_coord(vec1);
        write_coord(vec1);
        write_coord(vec1);
        write_short(g_Smoke);
        write_byte(2);
        write_byte(10);
        message_end();
}
create_thunder(vec1,vec2)
{
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte(0);
        write_coord(vec1);
        write_coord(vec1);
        write_coord(vec1);
        write_coord(vec2);
        write_coord(vec2);
        write_coord(vec2);
        write_short(g_Lightning);
        write_byte(1);
        write_byte(5);
        write_byte(2);
        write_byte(20);
        write_byte(30);
        write_byte(200);
        write_byte(200);
        write_byte(200);
        write_byte(200);
        write_byte(200);
        message_end();

        message_begin( MSG_PVS, SVC_TEMPENTITY,vec2);
        write_byte(TE_SPARKS);
        write_coord(vec2);
        write_coord(vec2);
        write_coord(vec2);
        message_end();
       
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec2);
        write_byte(TE_SMOKE);
        write_coord(vec2);
        write_coord(vec2);
        write_coord(vec2);
        write_short(g_Smoke);
        write_byte(10);
        write_byte(10)
        message_end();
}
create_blood(vec1)
{
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte(TE_LAVASPLASH);
        write_coord(vec1);
        write_coord(vec1);
        write_coord(vec1);
        message_end();
}



用刀杀人有特别效果
Cvars :
death_effects 1 / 0 -启用/禁用(默认1 )

点通粉丝 发表于 2009-1-10 04:45:49

#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Weapon Trail"
#define VERSION "2.0"
#define AUTHOR "anakin_cstrike"

#define MAX_PLAYERS 32
#define OFFSET_ENT_TO_INDEX 43

enum droptype
{
        droptype_manual,
        droptype_ondeath
}
new
toggle,light,vel,g_max_clients,g_max_entities;

new const g_drop[] = "drop";
new const g_wbox_class[] = "weaponbox";
new const g_wbox_model[] = "models/w_weaponbox.mdl";
new const g_wbox_model_prefix[] = "models/w_";
new const g_start_client_index = 1;
new g_command;
new g_trail,r,g,b;
public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR);
        register_forward(FM_SetModel, "fw_setmodel");
        register_forward(FM_Touch,"fw_touch");
        toggle = register_cvar("weapontrail","1");
        light = register_cvar("weapontrail_light","1");
        vel = register_cvar("weapontrail_vel","1");
        g_max_clients = global_get(glb_maxClients);
        g_max_entities = global_get(glb_maxEntities);
}
public plugin_precache()
g_trail = precache_model("sprites/smoke.spr");
public client_command(id)
        read_argv(0, g_command, sizeof g_drop);
public fw_setmodel(ent, const model[])
{
        if(get_pcvar_num(toggle) != 1)
                return FMRES_IGNORED;
        if(!pev_valid(ent) || !equal(model, g_wbox_model_prefix, sizeof g_wbox_model_prefix - 1) || equal(model, g_wbox_model))
                return FMRES_IGNORED;       
        new id = pev(ent, pev_owner)
        if(!(g_start_client_index <= id <= g_max_clients))
                return FMRES_IGNORED;
        static class,i;
        pev(ent,pev_classname,class, sizeof class - 1)
        if(!equal(class,g_wbox_class))
                return FMRES_IGNORED;
        for(i = g_max_clients + 1;i < g_max_entities;++i)
        {
                if(!pev_valid(i) || ent != pev(i, pev_owner))
                        continue;
               
                new wid = get_pdata_int(i,OFFSET_ENT_TO_INDEX);
                if(wid != CSW_C4)
                {
                        new droptype:drop_type;
                        if(!is_user_alive(id))
                                drop_type = droptype_ondeath;
                        else if(equal(g_command, g_drop))
                                drop_type = droptype_manual;
                        else
                                return FMRES_IGNORED;
                        switch(drop_type)
                        {
                                case droptype_ondeath: {
                                        if(get_user_team(id) == 1){r=255;g=0;b=0;}
                                        else if(get_user_team(id) == 2){r=0;g=0;b=255;}
                                }
                                case droptype_manual: {
                                        r = random(255);
                                        g = random(255);
                                        b = random(255);
                                }
                        }
                        if(get_pcvar_num(vel) == 1)
                        {
                                new Float:vel;
                                vel = float(random(300));
                                vel = float(random(300));
                                vel = float(random(300));
                                set_pev(ent,pev_velocity,vel);
                        }
                        message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
                        write_byte(TE_BEAMFOLLOW);
                        write_short(ent);
                        write_short(g_trail);
                        write_byte(5);
                        write_byte(5);
                        write_byte(r);
                        write_byte(g);
                        write_byte(b);
                        write_byte(195);
                        message_end();
                }
        }
        return FMRES_IGNORED;
}
public fw_touch(touched, toucher)
{
        if(get_pcvar_num(toggle) != 1)
                return FMRES_IGNORED;
        if(get_pcvar_num(light) != 1)
                return FMRES_IGNORED;
       
        static class;
        pev(toucher, pev_classname, class, sizeof class - 1);
       
        if(containi(class, "weapon") != -1 && !touched)
        {
                new Float:origin;
                pev(toucher, pev_origin, origin);
                       
                message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
                write_byte(TE_DLIGHT);
                write_coord(floatround(origin));
                write_coord(floatround(origin));
                write_coord(floatround(origin));
                write_byte(20);
                write_byte(r);
                write_byte(g);
                write_byte(b);
                write_byte(5);
                write_byte(20);
                message_end();
        }
        return FMRES_IGNORED;
}
5# 点通粉丝

掉枪彩色弹道
cvars :

weapontrail 1 / 0 -启用/禁用插件(默认1 )

weapontrail_light 1 / 0 -启用/禁用d iynamic轻(默认1 )

weapontrail_vel 1 / 0 -启用/禁用的变化速度(预设值是1 )

点通粉丝 发表于 2009-1-10 04:47:52

本帖最后由 点通粉丝 于 2009-1-13 11:54 编辑

6# 点通粉丝

你可以bind 左佢 例如:bind F +cheer
之後你禁F 就會在你的頭上顯示笑號

点通粉丝 发表于 2009-1-10 04:52:18

跳墙插件
要身体帖墙才可以跳


cvars
walljump_str 600“ 300.0 ” -有多大的力量推动你向上。
walljump_num “ 30 ” -在墙上可跳几多下,
walljump_team0

#include <amxmodx>
#include <engine>

new bool:caughtJump
new bool:doJump
new Float:jumpVeloc
new newButton
new numJumps
new wallteam

//====================================================================================================
static const TITLE[] = "Wall Jump"
static const VERSION[] = "0.6"
static const AUTHOR[] = "OneEyed"
//====================================================================================================

public plugin_init()
{
        register_plugin(TITLE,VERSION,AUTHOR)
       
        register_cvar("walljump_str","300.0")
        register_cvar("walljump_num","3")
        register_cvar("walljump_team", "0")
       
        register_touch("player", "worldspawn", "Touch_World")
        register_touch("player", "func_wall", "Touch_World")
        register_touch("player", "func_breakable", "Touch_World")
}

public client_disconnect(id) {
        caughtJump = false
        doJump = false
        for(new x=0;x<3;x++)
                jumpVeloc = 0.0
        newButton = 0
        numJumps = 0
}

public client_PreThink(id)
{
        wallteam = get_cvar_num("walljump_team")
        new team = get_user_team(id)
        if(is_user_alive(id) && (!wallteam || wallteam == team))
        {
                newButton = get_user_button(id)
                new oldButton = get_user_oldbutton(id)
                new flags = get_entity_flags(id)
               
                //reset if we are on ground
                if(caughtJump && (flags & FL_ONGROUND))
                {
                        numJumps = 0
                        caughtJump = false
                }
               
                //begin when we jump
                if((newButton & IN_JUMP) && (flags & FL_ONGROUND) && !caughtJump && !(oldButton & IN_JUMP) && !numJumps)
                {
                        caughtJump = true
                        entity_get_vector(id,EV_VEC_velocity,jumpVeloc)
                        jumpVeloc = get_cvar_float("walljump_str")
                }
        }
}

public client_PostThink(id)
{
        if(is_user_alive(id))
        {
                //do velocity if we walljumped
                if(doJump)
                {
                        entity_set_vector(id,EV_VEC_velocity,jumpVeloc)
                       
                        doJump = false
                       
                        if(numJumps >= get_cvar_num("walljump_num")) //reset if we ran out of jumps
                        {
                                numJumps = 0
                                caughtJump = false
                        }
                }
        }
}

public Touch_World(id, world)
{
        if(is_user_alive(id))
        {
                //if we touch wall and have jump pressed, setup for jump
                if(caughtJump && (newButton & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND))
                {
                       
                        //reverse velocity
                        for(new x=0;x<2;x++)
                                jumpVeloc *= -1.0
                               
                        numJumps++
                        doJump = true
                }       
        }
} 7# 点通粉丝

8874323 发表于 2009-1-10 07:11:08

娱乐用的吧
   刀杀效果我感兴趣、截张图上来,源码有个表情修改下

点通粉丝 发表于 2009-1-10 07:23:45

本帖最后由 点通粉丝 于 2009-1-13 11:50 编辑

#include <amxmodx>
#include <engine>

#define TE_EXPLOSION 3
#define TE_SMOKE 5
#define TE_IMPLOSION 14
#define TE_BEAMCYLINDER 21

new g_cvar_death_explode
new g_cvar_radius
new g_cvar_damage
new g_sModelIndexFireball
//new g_sModelIndexSmoke
new m_iSpriteTexture
new g_maxplayers

public plugin_init()
{
register_plugin("Death Explode Damage","1.0","X-man")
register_event("DeathMsg","death","a")
g_cvar_death_explode = register_cvar("death_explode", "1")
g_cvar_radius = register_cvar("explosion_radius", "0")
g_cvar_damage = register_cvar("explosion_damage", "0")
g_maxplayers = get_maxplayers()
}

public plugin_precache()
{
m_iSpriteTexture = precache_model( "sprites/shockwave.spr")
g_sModelIndexFireball = precache_model("sprites/bluejet1.spr")
//g_sModelIndexSmoke = precache_model("sprites/bluejet1.spr")
precache_sound("warcraft3/MiniSpiritPissed1a.wav")
}

public death()
{
if(!get_pcvar_num(g_cvar_death_explode))
return PLUGIN_CONTINUE

new id = read_data(2)
new origin
get_user_origin(id, origin)
explode(origin,10,9)
emit_sound(id,CHAN_STATIC, "warcraft3/MiniSpiritPissed1a.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

set_task(0.5, "blastcircles", id)
return PLUGIN_CONTINUE
}

public explode(vec1,scale,offset)
{
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 3 )
write_coord(vec1)
write_coord(vec1)
write_coord(vec1+offset)
write_short( g_sModelIndexFireball )
write_byte( scale ) // byte (scale in 0.1's) 188
write_byte( 8 ) // byte (framerate)
write_byte( 0 ) // byte flags
message_end()
}

public blastcircles(id)
{
new origin
get_user_origin(id, origin)
new blast_cir = get_pcvar_num(g_cvar_radius)

// blast circles
message_begin(MSG_PAS, SVC_TEMPENTITY, origin)
write_byte(TE_BEAMCYLINDER)
write_coord(origin)
write_coord(origin)
write_coord(origin - 16)
write_coord(origin)
write_coord(origin)
write_coord(origin - 16 + blast_cir)
write_short(m_iSpriteTexture)
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(0) // life
write_byte(0) // width
write_byte(0) // noise
write_byte(188)
write_byte(120)
write_byte(155)
write_byte(255) //brightness
write_byte(0) // speed
message_end()

message_begin(MSG_PAS, SVC_TEMPENTITY, origin)
write_byte(TE_BEAMCYLINDER)
write_coord(origin)
write_coord(origin)
write_coord(origin - 16)
write_coord(origin)
write_coord(origin)
write_coord(origin - 16 + blast_cir / 2)
write_short(m_iSpriteTexture)
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(0) // life
write_byte(0) // width
write_byte(0) // noise
write_byte(188)
write_byte(120)
write_byte(155)
write_byte(155) //brightness
write_byte(0) // speed
message_end()

// lots of smoke
//message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
//write_byte(TE_SMOKE)
//write_coord(origin + random_num(-100, 100))
//write_coord(origin + random_num(-100, 100))
//write_coord(origin + random_num(-50, 50))
//write_short(g_sModelIndexSmoke)
//write_byte(60) // scale * 10
//write_byte(10) // framerate
//message_end()

set_task(0.5, "bum", id)
}

public bum(id)
{
new team = get_user_team(id)
new radius = get_pcvar_num(g_cvar_radius)
new damage = get_pcvar_num(g_cvar_damage)
new dist
new origin, origin1
get_user_origin(id,origin)

for(new i = 1; i <= g_maxplayers; i++)
{
if(is_user_alive(i) && get_user_team(i) != team)
{
   get_user_origin(i, origin1)
   dist = get_distance(origin, origin1)
   if(dist < radius)
   {
    fakedamage(i, "Explosion", float(damage - damage * dist / radius), 0)
   }
}
}
}


CS1.5-1.6通用死后头上出现绿色烟雾
本人只对娱乐插件感兴趣..甘都比你估中..哈哈..不错..不错
页: [1] 2 3 4 5 6 7
查看完整版本: 经点通高手重新改过的一些好插件源码