跳到主要内容

SpawnPlayer

描述

生成或重新生成玩家。

参数名称说明
playerid要生成的目标玩家 ID

返回值

true - 函数执行成功

false - 函数执行失败(玩家未连接)

示例代码

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/spawn", true) == 0)
{
SpawnPlayer(playerid);
return 1;
}
return 0;
}

注意事项

注意

已知问题:

  • 若玩家处于车辆中执行生成,会导致玩家手持瓶子异常(该问题已在 open.mp 修复)

相关函数

相关回调