note Help Needed
This wiki is the result of an ongoing community effort — thank you all for helping!
If you want to provide changes to this page then please click here.
OnPlayerRequestSpawn
描述
当玩家通过按下 SHIFT 键或点击“重生”按钮来尝试通过类选择器进行重生时调用。
参数名 | 描述 |
---|---|
playerid | 请求重生的玩家的 ID。 |
返回值
它总是在过滤脚本中首先被调用,因此在那里返回 0 也会阻止其他脚本看到它。
案例
public OnPlayerRequestSpawn(playerid)
{
if (!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, -1, "你不能重生");
return 0;
}
return 1;
}
要点
tip
这个回调也可以由NPC调用。
tip
为了防止玩家重生特定的类,最后查看的类必须保存在 OnPlayerRequestClass 的一个变量中。