hardnick Posted November 6, 2022 Share Posted November 6, 2022 请问在多人伺服器里,当玩家使用F10无线电菜单选择项目时,如何同时获取该玩家的名称呢? 以下是我的测试(MIST),无论如何都是取得伺服器的ID,这可真伤脑筋 local function GetName() PlayerID = net.get_my_player_id( ) PlayerName = net.get_player_info(PlayerID , 'name') net.send_chat(PlayerName, all) end local Menu_Item = {"Menu1"} local SubMenu_Item_1 = {"Function1"} local Function_Menu1 = missionCommands.addSubMenuForCoalition(coalition.side.RED, Menu_Item[1], nil) missionCommands.addCommandForCoalition(coalition.side.RED, SubMenu_Item_1[1], Function_Menu1, GetName, {path={Menu_Item[1], SubMenu_Item_1[1]}}) 使用net.get_player_list( )可以抓到所有玩家列表,但其实我是需要每一次都显示出是哪一位玩家操作了F10无线电选单,感谢帮忙。 Link to comment Share on other sites More sharing options...
Insonia Posted May 31, 2023 Share Posted May 31, 2023 (edited) ME执行的角色只有服务器自己,ME环境里的net函数是抓不到具体特定玩家的操作的。 net里的get my应该只能是给客户端自己的ME module, hook和export用的 服务器ME环境不要用 world event 里也没有能用的函数和事件 所以你最多可以用addCommandForgroup 精细到每个group,然后记录是那个一个小队做的操作,成员都有谁 Edited May 31, 2023 by Insonia Link to comment Share on other sites More sharing options...
Recommended Posts