: 31)

如何获取排行榜信息

procedure Main(Npc: TNormNpc; Player: TPlayObject; Args: TArgs);

var

I: Integer;

begin

//Gamelib.Toptenz: 排行榜系统

//Gamelib.Toptenz.Levels 等级排行榜

//Gamelib.Toptenz.Richest 财富排行榜     

//Gamelib.Toptenz.Warrior 战士排行榜   

//循环读取战士排行榜

for I := 0 to Gamelib.Toptenz.Warrior.Count – 1 do

begin                 

   //Gamelib.Toptenz.Warrior.MinValue[I] 最低物理攻击,不同职业表示不同属性

   //Gamelib.Toptenz.Warrior.MaxValue[I] 最高物理攻击,不同职业表示不同属性

   Player.SendMessage(Format(‘排名:%d 角色:%s 物理攻击:%d-%d’, [I + 1, Gamelib.Toptenz.Warrior.Names[I], Gamelib.Toptenz.Warrior.MinValue[I], Gamelib.Toptenz.Warrior.MaxValue[I]]));

end;

//循环财富榜

for I := 0 to Gamelib.Toptenz.Richest.Count – 1 do

begin                 

   //Gamelib.Toptenz.Richest.Values[I] 金币数

   Player.SendMessage(Format(‘排名:%d 角色:%s 金币:%d-%d’, [I + 1, Gamelib.Toptenz.Richest.Names[I], Gamelib.Toptenz.Richest.Values[I]]));

end;                                                                                         

//每个排行榜都具有IndexOf函数,用来取指定名称的排名信息,没上榜返回-1,第一名返回0,第二名返回1,以此类推

Player.Messagebox(Format(‘等级榜%d人,我的排行%d,排行第一:%s %d’, [Gamelib.Toptenz.Levels.Count, Gamelib.Toptenz.Levels.IndexOf(Player.Name), Gamelib.Toptenz.Levels.Names[0], Gamelib.Toptenz.Levels.Level[0]]));

声明:本站所有文章,任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们(hljlife@vip.qq.com)进行处理。

本站所有资源来源于网络,本站未参与任何dump或hack活动。若有侵犯您的权益请提供相关证明致邮hljlife@vip.qq.com,我将及时撤下该资源。

All resources come from the network, this site does not participate in any dump or hack activities, if there is any violation of your rights, please provide relevant proof and email hljlife@vip.qq.com, I will promptly delete it.

如果下载资源文件后缀为.PDF,请删除后缀.PDF之后运行。

部分失效链接可通过文末填写有效邮箱到Email输入框留言索取。

免责声明:游戏资源均来自网络收集购买,不保证BUG,不保证病毒,不解答游戏问题(传奇服务端提供付费架设服务),为了安全,请尽量选择虚拟机运行服务端。