求插件大神来改一下我的这个源码!

社区服务
高级搜索
猴岛论坛CSGO反恐精英CS个性化修改专区求插件大神来改一下我的这个源码!
发帖 回复
倒序阅读 最近浏览的帖子最近浏览的版块
2个回复

求插件大神来改一下我的这个源码!

楼层直达
qbz95yuchenghao

ZxID:64018003

等级: 上等兵
举报 只看楼主 使用道具 楼主   发表于: 2015-07-01 0
我自己搞到了一个越狱银行的插件,可是发现存不了越狱币,跪求大神帮忙修改一下源码,存不了越狱币,最好大神帮忙修复一个自动保存和存取越狱币,源码在下面:



#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta>
#include <fun>
#include <nvault>
#include <xs>




#define PLUGIN_NAME    "越狱银行"
#define PLUGIN_VERSION    "test"
#define PLUGIN_AUTHOR    "Bxy"


new a[33]
new g_jbpacks[33]
new sss,second


public plugin_init()
{
    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
        register_clcmd("say /bank", "ShowMenu")
    register_clcmd("hcjb","change1")
    register_clcmd("hcjq","change2")
    register_clcmd("cxye","change3")
    register_logevent("show",2,"1=Round_Start")


}
public ShowMenu(id)
{
    
    new menu = menu_create("越狱银行", "mh_MyMenu");
    menu_additem(menu, "存入50越狱币", "", 0); // case 0
    menu_additem(menu, "取出50越狱币", "", 0); // case 1
    menu_additem(menu, "存入所有越狱币", "", 0); // case 0
    menu_additem(menu, "取出所有越狱币", "", 0); // case 1
    menu_additem(menu, "查询银行余额", "", 0); // case 2
    menu_additem(menu, "银行利率说明", "", 0); // case 2
    
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
    menu_setprop(menu, MPROP_BACKNAME, "返回");
    menu_setprop(menu, MPROP_NEXTNAME, "下一页");
    menu_setprop(menu, MPROP_EXITNAME, "退出");
    
    menu_display(id, menu, 0);
    


}


public mh_MyMenu(id, menu, item)
{
if(item == MENU_EXIT)
{
    menu_cancel(id);
    return PLUGIN_HANDLED;
}


new command[6], name[64], access, callback;


menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);


switch(item)
{
    case 0: client_cmd(id,"hcjb");
        case 1: client_cmd(id,"hcjq");
            case 2: {
            if(g_jbpacks[id]!=0)
            {
                a[id]+=g_jbpacks[id]
                g_jbpacks[id]=0
                client_color(id,"/y越狱币存入成功,现在余额(/g%d/y)",a[id])
            }
            else
            {
                client_color(id,"对不起,你的帐号无越狱币,无法存入")
            }
        }
        case 3:{
            if(a[id]!=0)
            {
                g_jbpacks[id]+=a[id]
                a[id]=0
                client_color(id,"/ctr越狱币/y现已经/g全部取出")
            }
            else
            {
                client_color(id,"对不起,你的帐号无余额,无法取出")
            }
        }
        case 4: client_cmd(id,"cxye");
            case 5: {
            if(sss!=0)
            {
                client_color(id,"/y当你的越狱币余额为/g %d/y及以上时,每局/g 百分之十 /y的几率获得十个越狱币",sss)
            }
            if(second!=-1)
            {
                client_color(id,"/y当你的越狱币余额小于或大于/g %d/y时,每在/g %d秒/y获得十个越狱币",sss,second)
            }
        }    
    }
menu_destroy(menu);
return PLUGIN_HANDLED;
}


public show()
{
    new i
    for(i=1;i<=32;i++)
    {
        Saves(i)
    }
}




public change1(id)
{
    if(g_jbpacks[id]>=50)
    {
        g_jbpacks[id]-=50
        a[id]+=50
        client_color(id,"/y你成功地存入了/g50越狱币,/y剩余越狱币(/g%d个/y)",a[id])
    }
    else if(a[id]<50)
    {
        client_color(id,"/y对不起,你的/g越狱币不够50/y,不能存入/g银行")
        
    }
    return PLUGIN_CONTINUE
}




public change3(id)
{
    client_color(id,"/y剩余越狱币余额(/g%d个/y)",a[id])
    
}


public change2(id)
{
    if(a[id]>=50)
    {
        g_jbpacks[id]+=50
        a[id]-=50
        client_color(id,"/y你取出了/g100越狱币,/y剩余越狱币(/g%d个/y)",a[id])
    }
    else if(a[id]<50)
    {
        client_color(id,"/y你的越狱币/g不够50/y,不能取出越狱币(/g%d个/y)",a[id])
    }
    return PLUGIN_CONTINUE
}


public Saves(id)
{
    new b=random_num(1,10)
    if(a[id]<=sss-1&&sss!=0)
    {
        client_color(id,"/y你当前的所存的/g越狱币不够%d/y,不能激活/g活期存款",sss)
    }
    if(a[id]>=sss&&sss!=0)
    {
        if(b==10)
        {
            a[id]=a[id]+b
            client_color(id,"/y恭喜你,抽中/g10越狱币/y剩余越狱币(/g%d个/y)",a[id])
        }
        else if(b!=10)
        {
            client_print(id,print_chat,"真遗憾,这一局你没抽中越狱币")
        }
    }
    return PLUGIN_CONTINUE
}


public Save(id)
{
    new name[33]
    new vaultkey[64]
    new vaultdata[512]
    get_user_name(id, name, 32)
    format(vaultkey, 63, "%s-Mod",name)
    format(vaultdata, 511, "%i#",a[id])
    nvault_set(nvault_open("jinbi"), vaultkey, vaultdata)
    return PLUGIN_CONTINUE
}


public Load(id)
{
    new name[33]
    set_hudmessage(255, 0, 0, -1.0, 0.01)
    show_hudmessage(id, "<Hudmessage>")
    set_hudmessage(255, 0, 0, -1.0, 0.01)
    show_hudmessage(id, "<Hudmessage>")
    new vaultkey[64]
    new vaultdata[512]
    new LV[33]
    get_user_name(id, name, 32)
    format(vaultkey, 63, "%s-Mod", name)
    format(vaultdata, 511, "%i#", a[id])
    nvault_get(nvault_open("jinbi"), vaultkey, vaultdata, 511)
    replace_all(vaultdata, 511, "#", " ")
    parse(vaultdata, LV, 32)
    a[id] = str_to_num(LV)
}


public client_connect(id)
{
    Load(id)
}
public client_disconnect(id)
{
    Save(id)
}










stock client_color(const id, const input[], any:...)
{
    new iCount = 1, iPlayers[32]
    static szMsg[191]
    vformat(szMsg, charsmax(szMsg), input, 3)
    replace_all(szMsg, 190, "/g", "^4") // green txt
    replace_all(szMsg, 190, "/y", "^1") // orange txt
    replace_all(szMsg, 190, "/ctr", "^3") // team txt
    replace_all(szMsg, 190, "/w", "^0") // team txt
    if(id) iPlayers[0] = id
    else get_players(iPlayers, iCount, "ch")
    for (new i = 0; i < iCount; i++)
    {
        if (is_user_connected(iPlayers))
        {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers)
            write_byte(iPlayers)
            write_string(szMsg)
            message_end()
        }
    }
}

qbz95yuchenghao

ZxID:64018003

等级: 上等兵
举报 只看该作者 沙发   发表于: 2015-07-02 0
顶一下,求大神来啊!!!!!!!!!
« 返回列表
发帖 回复