战神引擎脚本-烈阳-GM快捷清理玩家背包

[复制链接]
匿名 神王 发表于 2021-7-19 13:53 | 显示全部楼层 |阅读模式
//-------------------------------------
// 此功能由烈阳脚写的
//-------------------------------------

program Mir2;

procedure P100;
begin
end;

procedure ShowForGm;
var
   Mstr:string;
begin
    Mstr := This_Player.Name;  //你们都有淡淡的后台管理,我就懒得写了,这里暂时只查看自己
                                   //把 <[背包物品]/@Take_Bag~'+Mstr+'> 直接加入到他 procedure _man_info(Mstr:string); 程序下即可使用
    This_Npc.NpcDialog(This_Player,
        '第一次使用必须先导入数据,否则服务器CPU会烧| |'+
        '{cmd}<导入数据/@ImportData><查看背包物品/@ShowBag~'+Mstr+'>');
end;

procedure _ShowBag(PassName:string);
var
   k,i:integer;
   iName,StrForShow:string;
begin
    if ReadIniSectionStr('烈阳爸爸的数据库.ini','物品数据','1') = '' then
        begin
            This_NPC.InputDialog(This_Player,'请先导入数据!',1,100);
                exit;
        end;
        
    for k := 1 to 5000 do
        begin
        iName:=ReadIniSectionStr('烈阳爸爸的数据库.ini','物品数据',inttostr(k));
        if iName = '' then
        break;
                if This_Player.FindPlayerByName(PassName).GetBagItemCount(iName) > 0 then
        begin
                    if i < 1 then StrForShow := StrForShow + '{cmd}';
                    i := i + 1;
                    StrForShow := StrForShow + '<' + iName + '/@Take_Item~' + PassName + ',' + iName + '>';
                end;
                if i > 2 then
                begin
                    i := 0;
                        StrForShow := StrForShow + '|';
                end;
        end;
        This_Npc.NpcDialog(This_Player,
        '|玩家<'+PassName+'>背包(点击名字即可没收)|' + StrForShow +
        '|{cmd}<清空背包/@ClearBag~' + PassName + '>');
end;

procedure _ClearBag(PassName:string);
begin
        if This_Player.FindPlayer(PassName) then
        begin
                This_Player.FindPlayerByName(PassName).DelBagItemOfAll;
                This_Player.FindPlayerByName(PassName).PlayerNotice('GM清空了你的背包!!!',2);
                This_NPC.InputDialog(This_Player,'玩家'+PassName+'背包已清空!',1,100);
                _ShowBag(PassName);
        end
        else
        This_NPC.InputDialog(This_Player,'该乡巴佬已不在线!',1,100);
end;

procedure _Take_Item(PasStr:string);
var
   iName,PassName:string;
begin
    PassName := copy(PasStr,0,pos(',',PasStr) - 1);
        iName := copy(PasStr,pos(',',PasStr) + 1,Length(PasStr));
        if This_Player.FindPlayer(PassName) then
        begin
        This_Player.FindPlayerByName(PassName).DelAllThisItem(iName);
            This_Player.FindPlayerByName(PassName).PlayerNotice('GM没收了你背包的['+iName+']',2);
        This_NPC.InputDialog(This_Player,'没收成功!',1,100);
            _ShowBag(PassName);
        end
        else
        This_NPC.InputDialog(This_Player,'该乡巴佬已不在线!',1,100);
end;

procedure _ImportData;
var
   k:integer;
   Code:Boolean;
   ItemName,QrySQL:string;
begin
    k := 1;
        Code := False;
        if ReadIniSectionStr('烈阳爸爸的数据库.ini','物品数据','1') <> '' then
        begin
            This_NPC.InputDialog(This_Player,'请先清理数据存储文件!',1,100);
                exit;
        end;
    QrySQL := ' SELECT iname from mir3.stditems;';
        This_DB.ExecuteQuery(QrySQL);
        while not(This_DB.PsEof()) do
        begin
            ItemName := This_DB.PsFieldByName('iname');
                if ItemName <> nil then
                begin
                WriteIniSectionStr('烈阳爸爸的数据库.ini','物品数据',inttostr(k),ItemName);
                    k := k + 1;
                        Code := True;
                end
                This_DB.PsNext();
        end;
        if Code then
        begin
            This_NPC.InputDialog(This_Player,'数据导入完成!',1,100);
        end
        else
        This_NPC.InputDialog(This_Player,'数据导入失败!',1,100);
end;

Begin
    ShowForGm;
end.
请点击此处下载

需要先购买才能下载

您的用户组是:游客

文件名称:烈阳-GM快捷清理玩家背包.zip
下载次数:0  文件大小:1.87 KB  售价:35 下载币
您需要登录后才可以回帖 登录 | 加入网站

本版积分规则

匿名

40

主题

45

帖子

2785

积分

版主

Rank: 7Rank: 7Rank: 7

积分
2785