Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使命令要求玩家通过 RCON 登录才能执行它?出于安全原因,我希望这样做。
如果玩家通过 RCON 登录,该方法IsPlayerAdmin(playerid)将返回 1,如果玩家没有登录,则返回 0。要将其用于命令,请进入命令正文并在您希望保护的命令部分周围添加一个 if 语句。例如:
IsPlayerAdmin(playerid)
if(IsPlayerAdmin(playerid)) { //do stuff here } else { //do nothing, explain security settings to user }