搜索
查看: 4880|回复: 10

求助:汉化代码

[复制链接]
发表于 2009-5-7 17:55:19 | 显示全部楼层 |阅读模式 来自 甘肃兰州
本帖最后由 我是新手 于 2009-5-7 18:00 编辑

如题,自己弄了好多遍,总是不能编译,郁闷之极啊!请大家帮忙。代码如下(我就只把红色部分的英文改成中文就不行了)
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>

#define PLUGIN  "Purchase Mod"
#define VERSION "1.3"
#define AUTHOR  "Dizzy"//Production

#define DISPLAY_MSG
#define FL_WATERJUMP        (1<<11)
#define FL_ONGROUND        (1<<9)
#define keyspageone (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) // Keys: 1234567890
#define keyspagetwo (1<<0)|(1<<7)|(1<<8)|(1<<9) // Keys: 1890

new powerpur[33] = 1;
new powerpurgravity[33] = 1;
new powerpurspeed[33] = 1;
new powerpurstealth[33] = 1;
new powerpurlaser[33] = 1;
new powerpurflashglasses[33] = 1;
new powerpurmultijump[33] = 1;
new powerpurbunnyhop[33] = 1;
new powerpurhealth[33] = 1;
new powerpurparachute[33] = 1;

new jumpnum[33];
new bool:dojump[33];

new para_ent[33]
new pDetach, pFallSpeed

new g_msgscreenfade;

public client_connect(id)
{
        powerpur[id] = 1;
        powerpurgravity[id] = 1;
        powerpurspeed[id] = 1;
        powerpurstealth[id] = 1;
        powerpurlaser[id] = 1;
        powerpurflashglasses[id] = 1;
        powerpurmultijump[id] = 1;
        powerpurbunnyhop[id] = 1;
        powerpurhealth[id] = 1;
        powerpurparachute[id] = 1;
}

public client_disconnect(id)
{
        powerpur[id] = 1;
        powerpurgravity[id] = 1;
        powerpurspeed[id] = 1;
        powerpurstealth[id] = 1;
        powerpurlaser[id] = 1;
        powerpurflashglasses[id] = 1;
        powerpurmultijump[id] = 1;
        powerpurbunnyhop[id] = 1;
        powerpurflashglasses[id] = 1;
        powerpurparachute[id] = 1;
}

public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR);
       
        register_menucmd(register_menuid("Purchase Mod Page (1/2)"), keyspageone, "pressedpageone")
        register_menucmd(register_menuid("Purchase Mod Page (2/2)"), keyspagetwo, "pressedpagetwo")

        register_cvar("amx_pmod","1");
        register_cvar("amx_multiabilities","0");

        register_clcmd("say pmodmenu","showpageone");
        register_clcmd("say pmodmenu2","showpagetwo");
       
        register_clcmd("say_team pmodmenu","showpageone");
        register_clcmd("say_team pmodmenu2","showpagetwo");
       
        register_clcmd("pmodmenu","showpageone");
        register_clcmd("pmodmenu2","showpagetwo");
       
        register_concmd("pmodmenu","showpageone");
        register_concmd("pmodmenu2","showpagetwo");

        register_event("ResetHUD","roundchange","b");
        register_event("CurWeapon","speedb","be","1=1");
        register_event("ScreenFade","event_blinded","be","4=255","5=255","6=255","7>199")
        register_event("DeathMsg","death_event","a");

        g_msgscreenfade = get_user_msgid("ScreenFade");
       
        pFallSpeed = register_cvar("amx_pmodfallspeed", "100")
        pDetach = register_cvar("amx_pmoddetach", "1")
}
//////////////////////
//      SOUNDS      //
//////////////////////
public plugin_precache()
{
        precache_sound("purchasemod/buy.wav");
        precache_sound("purchasemod/drain.wav");
        precache_sound("purchasemod/sorry.wav");
        precache_model("models/parachute.mdl");
}
//////////////////////
//      INFORM      //
//////////////////////
#if defined DISPLAY_MSG
public client_putinserver(id)
{
        if (is_user_bot(id))
                return;
       
        set_task(25.0, "inform", id);
}
#endif

#if defined DISPLAY_MSG
public inform(id)
{
        client_print(id, print_chat, "[Purchase Mod]: This server is running Purchase Mod v1.3 -- By: Dizzy");
        client_print(id, print_chat, "[Purchase Mod]: Type pmodmenu to start!");
        return PLUGIN_HANDLED;
}
#endif

public showpageone(id)
{
        show_menu(id, keyspageone, "Purchase Mod Page (1/2)^n ^n^n1. 轻功^n2. 加速^n3. 隐身^n4. 激光红外线^n5. 反闪光眼镜
^n6. 多重跳^n7. 兔子跳^n8. 加血包^n^n9. 下一页^n0. 退出^n", -1, "降落伞 Mod Page (1/2)")
}

public pressedpageone(id, key)
{
        switch(key)
        {
                case 0:
                {
                        if(!get_cvar_num("amx_pmod"))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: Sorry, the plugin is off!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(!is_user_alive(id))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You must be alive to purchase this item!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(get_cvar_num("amx_multiabilities")==0 && powerpur[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a different skill!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(powerpurgravity[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a gravity!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        new money = cs_get_user_money(id);
                        if(3500 > money)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You have insufficient funds!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        cs_set_user_money(id, (money - 3500), 1);
                        client_cmd(id,"spk purchasemod/buy");
                        client_print(id, print_chat, "[Purchase Mod]: You purchased gravity for $3500!");
                        set_user_gravity(id, 0.25);
                        powerpurgravity[id] = 0;
                        powerpur[id] = 0;
                }
                case 1:
                {
                        if(!get_cvar_num("amx_pmod"))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: Sorry, the plugin is off!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(!is_user_alive(id))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You must be alive to purchase this item!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(get_cvar_num("amx_multiabilities")==0 && powerpur[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a different skill!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(powerpurspeed[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased speed!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        new money = cs_get_user_money(id);
                        if(4000 > money)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You have insufficient funds!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        cs_set_user_money(id, (money - 4000), 1);
                        client_cmd(id,"spk purchasemod/buy");
                        client_print(id, print_chat, "[Purchase Mod]: You purchased speed for $4000!");
                        new Float:speed = get_user_maxspeed(id) + 680.0;
                        set_user_maxspeed(id, speed);
                        powerpurspeed[id] = 0;
                        powerpur[id] = 0;
                }
                case 2:
                {
                        if(!get_cvar_num("amx_pmod"))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: Sorry, the plugin is off!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(!is_user_alive(id))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You must be alive to purchase this item!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(get_cvar_num("amx_multiabilities")==0 && powerpur[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a different skill!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(powerpurstealth[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased stealth!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        new money = cs_get_user_money(id);
                        if(5000 > money)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You have insufficient funds!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        cs_set_user_money(id, (money - 5000), 1);
                        client_cmd(id,"spk purchasemod/buy");
                        client_print(id, print_chat, "[Purchase Mod]: You purchased stealth for $5000!");
                        set_user_rendering(id, kRenderFxNone, 50, 50, 50, kRenderTransAdd, 50);
                        set_user_footsteps(id, 1);
                        powerpurstealth[id] = 0;
                        powerpur[id] = 0;
                }
 楼主| 发表于 2009-5-7 17:56:19 | 显示全部楼层 来自 甘肃兰州
case 3:
                {
                        if(!get_cvar_num("amx_pmod"))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: Sorry, the plugin is off!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(!is_user_alive(id))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You must be alive to purchase this item!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(get_cvar_num("amx_multiabilities")==0 && powerpur[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a different skill!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(powerpurlaser[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a laser!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        new money = cs_get_user_money(id);
                        if(2000 > money)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You have insufficient funds!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        cs_set_user_money(id, (money - 2000), 1);
                        client_cmd(id,"spk purchasemod/buy");
                        client_print(id, print_chat, "[Purchase Mod]: You purchased a laser for $2000!");
                        set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 10.0, 0.1, 0.1, 10);
                        show_hudmessage(id, "*");
                        set_task(5.0,"laser_loop",id);
                        powerpurlaser[id] = 0;
                        powerpur[id] = 0;
                }
                case 4:
                {
                        if(!get_cvar_num("amx_pmod"))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: Sorry, the plugin is off!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(!is_user_alive(id))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You must be alive to purchase this item!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(get_cvar_num("amx_multiabilities")==0 && powerpur[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a different skill!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(powerpurflashglasses[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased Anti-Flash Glasses!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        new money = cs_get_user_money(id);
                        if(5000 > money)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You have insufficient funds!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        cs_set_user_money(id, (money - 5000), 1);
                        client_cmd(id,"spk purchasemod/buy");
                        client_print(id, print_chat, "[Purchase Mod]: You purchased Anti-Flash Glasses for $5000!");
                        set_task(0.0,"event_blinded",id)
                        powerpurflashglasses[id] = 0;
                        powerpur[id] = 0;
                }
                case 5:
                {
                        if(!get_cvar_num("amx_pmod"))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: Sorry, the plugin is off!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(!is_user_alive(id))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You must be alive to purchase this item!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(get_cvar_num("amx_multiabilities")==0 && powerpur[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a different skill!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(powerpurmultijump[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased Multi-Jump!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        new money = cs_get_user_money(id);
                        if(3000 > money)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You have insufficient funds!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        cs_set_user_money(id, (money - 3000), 1);
                        client_cmd(id,"spk purchasemod/buy");
                        client_print(id, print_chat, "[Purchase Mod]: You purchased multi-jump for $3000!");
                        powerpurmultijump[id] = 0;
                        powerpur[id] = 0;
                }
                case 6:
                {
                        if(!get_cvar_num("amx_pmod"))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: Sorry, the plugin is off!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(!is_user_alive(id))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You must be alive to purchase this item!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(get_cvar_num("amx_multiabilities")==0 && powerpur[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a different skill!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(powerpurbunnyhop[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased bunny-hop!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        new money = cs_get_user_money(id);
                        if(6000 > money)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You have insufficient funds!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        cs_set_user_money(id, (money - 6000), 1);
                        client_cmd(id,"spk purchasemod/buy");
                        client_print(id, print_chat, "[Purchase Mod]: You purchased bunny-hop for $$6000!");
                        powerpurbunnyhop[id] = 0;
                        powerpur[id] = 0;
                }
                case 7:
                {
                        if(!get_cvar_num("amx_pmod"))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: Sorry, the plugin is off!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(!is_user_alive(id))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You must be alive to purchase this item!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(get_cvar_num("amx_multiabilities")==0 && powerpur[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a different skill!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(powerpurhealth[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased health!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        new money = cs_get_user_money(id);
                        if(5000 > money)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You have insufficient funds!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        cs_set_user_money(id, (money - 5000), 1);
                        client_cmd(id,"spk purchasemod/buy");
                        client_print(id, print_chat, "[Purchase Mod]: You purchased health for $5000!");
                        set_user_health(id, get_user_health(id) + 50);
                        powerpurhealth[id] = 0;
                        powerpur[id] = 0;
                }
                case 8:
                {
                        set_task(0.0,"showpagetwo",id);
                        return PLUGIN_CONTINUE;
                }
                case 9:
                {
                        return PLUGIN_HANDLED;
                }
        }
        return PLUGIN_CONTINUE;
}
回复

使用道具 举报

 楼主| 发表于 2009-5-7 17:57:20 | 显示全部楼层 来自 甘肃兰州
public showpagetwo(id)
{
        show_menu(id, keyspagetwo, "Purchase Mod Page (2/2)^n ^n^n1. Parachute^n^n8. Back^n0. Exit^n", -1, "Purchase Mod Page (2/2)")
}

public pressedpagetwo(id, key)
{
        switch(key)
        {
                case 0:
                {
                        if(!get_cvar_num("amx_pmod"))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: Sorry, the plugin is off!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(!is_user_alive(id))
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You must be alive to purchase this item!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(get_cvar_num("amx_multiabilities")==0 && powerpur[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a different skill!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        if(powerpurparachute[id] == 0)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You already purchased a parachute!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        new money = cs_get_user_money(id);
                        if(4000 > money)
                        {
                                client_print(id, print_chat, "[Purchase Mod]: You have insufficient funds!");
                                client_cmd(id,"spk purchasemod/sorry");
                                return PLUGIN_HANDLED;
                        }
                        cs_set_user_money(id, (money - 4000), 1);
                        client_cmd(id,"spk purchasemod/buy");
                        client_print(id, print_chat, "[Purchase Mod]: You purchased a parachute for $4000!");
                        powerpurparachute[id] = 0;
                        powerpur[id] = 0;
                }
                case 7:
                {
                        set_task(0.0,"showpageone",id);
                        return PLUGIN_CONTINUE;
                }
                case 9:
                {
                        return PLUGIN_HANDLED;
                }
        }
        return PLUGIN_CONTINUE;
}

//////////////////////
//    PRETHINK      //
//////////////////////
public client_PreThink(id)
{
        if(powerpurmultijump[id] == 0)
        {
                new nbut = get_user_button(id);
                new obut = get_user_oldbutton(id);
                if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
                {
                        if(jumpnum[id] < 3)
                        {
                                dojump[id] = true;
                                jumpnum[id]++;
                                return PLUGIN_CONTINUE;
                        }
                }
                if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
                {
                        jumpnum[id] = 0
                }
                return PLUGIN_CONTINUE;
        }
        if(powerpurbunnyhop[id] == 0)
        {
                entity_set_float(id, EV_FL_fuser2, 0.0);

                if (entity_get_int(id, EV_INT_button) & 2)
                {
                        new flags = entity_get_int(id, EV_INT_flags);

                        if (flags & FL_WATERJUMP)
                        {
                                return PLUGIN_CONTINUE;
                        }
                        if (entity_get_int(id, EV_INT_waterlevel) >= 2)
                        {
                                return PLUGIN_CONTINUE;
                        }
                        if(!(flags & FL_ONGROUND))
                        {
                                return PLUGIN_CONTINUE;
                        }

                        new Float:velocity[3];
                        entity_get_vector(id, EV_VEC_velocity, velocity);
                        velocity[2] += 250.0;
                        entity_set_vector(id, EV_VEC_velocity, velocity);

                        entity_set_int(id, EV_INT_gaitsequence, 6);
                }
                return PLUGIN_CONTINUE;
        }
        if(powerpurparachute[id] == 0)
        {
                if (!is_user_alive(id))
                {
                        return PLUGIN_HANDLED;
                }

                new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0
                new Float:frame

                new button = get_user_button(id)
                new oldbutton = get_user_oldbutton(id)
                new flags = get_entity_flags(id)

                if (para_ent[id] > 0 && (flags & FL_ONGROUND))
                {
                        if (get_pcvar_num(pDetach))
                        {
                                if (get_user_gravity(id) == 0.1)
                                {
                                        if(powerpurgravity[id] == 0)
                                        {
                                                set_user_gravity(id, 0.25);
                                        }
                                        if(powerpurgravity[id] == 1)
                                        {
                                                set_user_gravity(id, 1.0);
                                        }
                                }

                                if (entity_get_int(para_ent[id],EV_INT_sequence) != 2)
                                {
                                        entity_set_int(para_ent[id], EV_INT_sequence, 2)
                                        entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
                                        entity_set_float(para_ent[id], EV_FL_frame, 0.0)
                                        entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
                                        entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
                                        entity_set_float(para_ent[id], EV_FL_framerate, 0.0)
                                        return PLUGIN_HANDLED;
                                }

                                frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
                                entity_set_float(para_ent[id],EV_FL_fuser1,frame)
                                entity_set_float(para_ent[id],EV_FL_frame,frame)

                                if (frame > 254.0)
                                {
                                        remove_entity(para_ent[id])
                                        para_ent[id] = 0
                                }
                        }
                        else
                        {
                                if(powerpurgravity[id] == 0)
                                {
                                        set_user_gravity(id, 0.25);
                                        remove_entity(para_ent[id]);
                                        para_ent[id] = 0;
                                }
                                if(powerpurgravity[id] == 1)
                                {
                                        set_user_gravity(id, 1.0);
                                        remove_entity(para_ent[id]);
                                        para_ent[id] = 0;
                                }
                        }

                        return PLUGIN_HANDLED;
                }

                if (button & IN_USE)
                {
                        new Float:velocity[3]
                        entity_get_vector(id, EV_VEC_velocity, velocity)

                        if (velocity[2] < 0.0)
                        {
                                if(para_ent[id] <= 0)
                                {
                                        para_ent[id] = create_entity("info_target")
                                        if(para_ent[id] > 0)
                                        {
                                                entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
                                                entity_set_edict(para_ent[id], EV_ENT_aiment, id)
                                                entity_set_edict(para_ent[id], EV_ENT_owner, id)
                                                entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
                                                entity_set_model(para_ent[id], "models/parachute.mdl")
                                                entity_set_int(para_ent[id], EV_INT_sequence, 0)
                                                entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
                                                entity_set_float(para_ent[id], EV_FL_frame, 0.0)
                                                entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
                                        }
                                }

                                if (para_ent[id] > 0)
                                {
                                        entity_set_int(id, EV_INT_sequence, 3)
                                        entity_set_int(id, EV_INT_gaitsequence, 1)
                                        entity_set_float(id, EV_FL_frame, 1.0)
                                        entity_set_float(id, EV_FL_framerate, 1.0)
                                        set_user_gravity(id, 0.1)

                                        velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
                                        entity_set_vector(id, EV_VEC_velocity, velocity)

                                        if (entity_get_int(para_ent[id],EV_INT_sequence) == 0)
                                        {
                                                frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
                                                entity_set_float(para_ent[id],EV_FL_fuser1,frame)
                                                entity_set_float(para_ent[id],EV_FL_frame,frame)

                                                if (frame > 100.0)
                                                {
                                                        entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
                                                        entity_set_float(para_ent[id], EV_FL_framerate, 0.4)
                                                        entity_set_int(para_ent[id], EV_INT_sequence, 1)
                                                        entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
                                                        entity_set_float(para_ent[id], EV_FL_frame, 0.0)
                                                        entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
                                                }
                                        }
                                }
                        }
                        else if (para_ent[id] > 0)
                        {
                                if(powerpurgravity[id] == 0)
                                {
                                        set_user_gravity(id, 0.25);
                                        remove_entity(para_ent[id]);
                                        para_ent[id] = 0;
                                }
                                if(powerpurgravity[id] == 1)
                                {
                                        set_user_gravity(id, 1.0);
                                        remove_entity(para_ent[id]);
                                        para_ent[id] = 0;
                                }
                        }
                }
                else if ((oldbutton & IN_USE) && para_ent[id] > 0 )
                {
                        if(powerpurgravity[id] == 0)
                        {
                                set_user_gravity(id, 0.25);
                                remove_entity(para_ent[id]);
                                para_ent[id] = 0;
                        }
                        if(powerpurgravity[id] == 1)
                        {
                                set_user_gravity(id, 1.0);
                                remove_entity(para_ent[id]);
                                para_ent[id] = 0;
                        }
                }
        }
        return PLUGIN_HANDLED;
}
回复

使用道具 举报

 楼主| 发表于 2009-5-7 17:57:45 | 显示全部楼层 来自 甘肃兰州
//////////////////////
//    POSTTHINK     //
//////////////////////
public client_PostThink(id)
{
        if(dojump[id] == true && powerpurmultijump[id] == 0)
        {
                new Float:velocity[3];       
                entity_get_vector(id,EV_VEC_velocity,velocity);
                velocity[2] = random_float(265.0,285.0);
                entity_set_vector(id,EV_VEC_velocity,velocity);
                dojump[id] = false;
                return PLUGIN_CONTINUE;
        }
        return PLUGIN_CONTINUE;
}
//////////////////////
//      SPEEDB      //
//////////////////////
public speedb(id)
{
        if(powerpurspeed[id] == 0)
        {
                new Float:speed = get_user_maxspeed(id) + 680.0;
                set_user_maxspeed(id, speed);
        }
        return PLUGIN_HANDLED;
}
//////////////////////
//    LASER LOOP    //
//////////////////////
public laser_loop(id)
{
        if(!is_user_alive(id))
        {
                return PLUGIN_HANDLED;
        }
        if(powerpurlaser[id] == 0)
        {
                set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 10.0, 0.1, 0.1, 10);
                show_hudmessage(id, "*");
                set_task(0.0,"laser_loop",id);
        }
        return PLUGIN_HANDLED;
}
//////////////////////
//   FLASH EVENT    //
//////////////////////
public event_blinded(id)
{
        if(powerpurflashglasses[id] == 0)
        {
                message_begin(MSG_ONE,g_msgscreenfade,{0,0,0},id);
                write_short(~0);
                write_short(10);
                write_short(1<<12);
                write_byte(0);
                write_byte(0);
                write_byte(0);
                write_byte(100);
                message_end();
                set_task(0.0,"event_blinded",id)
        }
        if(powerpurflashglasses[id] == 1)
        {
                return PLUGIN_HANDLED;
        }
        return PLUGIN_HANDLED;
}
//////////////////////
//    DEATHEVENT    //
//////////////////////
public death_event(id)
{
        if(para_ent[id] > 0)
        {
                if(powerpurgravity[id] == 0)
                {
                        set_user_gravity(id, 0.25);
                        remove_entity(para_ent[id]);
                        powerpurparachute[id] = 1;
                        para_ent[id] = 0;
                }
                if(powerpurgravity[id] == 1)
                {
                        set_user_gravity(id, 1.0);
                        remove_entity(para_ent[id]);
                        powerpurparachute[id] = 1;
                        para_ent[id] = 0;
                }
        }
        return PLUGIN_HANDLED;
}
//////////////////////
//   ROUNDCHANGE    //
//////////////////////
public roundchange(id)
{
        new arg[32], name[32];
        read_argv(1, arg,31);
        new player = cmd_target(id,arg,4);
        get_user_name(player,name,31);
        powerpur[id] = 1;
        if(powerpurgravity[id] == 0)
        {
                set_user_gravity(id, 1.0);
                client_cmd(id,"spk purchasemod/drain");
                client_print(id, print_chat, "[Purchase Mod]: Gravity set back to normal!");
                powerpurgravity[id] = 1;
        }
        if(powerpurspeed[id] == 0)
        {
                new Float:speed = get_user_maxspeed(id) - 680.0;
                set_user_maxspeed(id,speed);
                client_cmd(id,"spk purchasemod/drain");
                client_print(id, print_chat, "[Purchase Mod]: Speed set back to normal!");
                powerpurspeed[id] = 1;
        }
        if(powerpurstealth[id] == 0)
        {
                set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
                set_user_footsteps(id,0);
                client_cmd(id,"spk purchasemod/drain");
                client_print(id, print_chat, "[Purchase Mod]: Stealth level set back to normal!");
                powerpurstealth[id] = 1;
        }
        if(powerpurlaser[id] == 0)
        {
                client_print(id, print_chat, "[Purchase Mod]: Laser bulb burnt out!");
                client_cmd(id,"spk purchasemod/drain");
                powerpurlaser[id] = 1;
        }
        if(powerpurflashglasses[id] == 0)
        {
                client_print(id, print_chat, "[Purchase Mod]: Your Flash Glasses broke!");
                client_cmd(id,"spk purchasemod/drain");
                powerpurflashglasses[id] = 1;
        }
        if(powerpurmultijump[id] == 0)
        {
                client_print(id, print_chat, "[Purchase Mod]: Multi-Jump ability ran out!");
                client_cmd(id,"spk purchasemod/drain");
                powerpurmultijump[id] = 1;
        }
        if(powerpurbunnyhop[id] == 0)
        {
                client_print(id, print_chat, "[Purchase Mod]: Bunny Hop ability ran out!");
                client_cmd(id,"spk purchasemod/drain");
                powerpurbunnyhop[id] = 1;
        }
        if(powerpurhealth[id] == 0)
        {
                client_cmd(id,"spk purchasemod/drain");
                powerpurhealth[id] = 1;
        }
        if(powerpurparachute[id] == 0)
        {
                client_print(id, print_chat, "[Purchase Mod]: Parachute ability ran out!");
                client_cmd(id,"spk purchasemod/drain");
                remove_entity(para_ent[id]);
                set_user_gravity(id, 1.0);
                para_ent[id] = 0;
                powerpurparachute[id] = 1;
        }
        return PLUGIN_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
回复

使用道具 举报

发表于 2009-5-10 15:38:37 | 显示全部楼层 来自 四川遂宁
编码问题.
UTF-8  无签名格式
回复

使用道具 举报

 楼主| 发表于 2009-5-11 22:31:48 | 显示全部楼层 来自 甘肃天水
谢了,去试下
回复

使用道具 举报

发表于 2009-5-12 00:06:24 | 显示全部楼层 来自 台湾
看到了這個
你為什麼不把插件傳上來呢?
而要發好幾篇的原始碼出來勒
你直接發插件 把錯誤訊息用出來
這樣不是比較簡單又快呢?
回复

使用道具 举报

 楼主| 发表于 2009-5-12 11:58:16 | 显示全部楼层 来自 甘肃兰州
楼上的,直接发源码大家下载是要收费的,我这样虽然麻烦些,但这样大家测试的时候是不需要付费得哦!
回复

使用道具 举报

发表于 2009-5-12 20:11:29 | 显示全部楼层 来自 台湾
那你可以使用論壇上的 插入代碼阿
這樣可以節省空間
又方便看 只要移動 代碼中的捲動 就可以了
回复

使用道具 举报

 楼主| 发表于 2009-5-12 22:28:55 | 显示全部楼层 来自 甘肃天水
本帖最后由 我是新手 于 2009-5-12 22:30 编辑

哈哈,这个功能我还没发现,多谢指教!(另外,你别用繁体了,看着眼花)
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表