跳到主要内容

DeletePlayer3DTextLabel

描述

销毁通过 CreatePlayer3DTextLabel 创建的 3D 文本标签。

参数名说明
playerid要删除其 3D 文本标签的玩家 ID。
PlayerText3D:textid要删除的玩家 3D 文本标签 ID。

返回值

true - 函数执行成功

false - 函数执行失败。这意味着指定的标签不存在。

示例

new PlayerText3D:playerTextId[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
new
name[MAX_PLAYER_NAME],
Float:x, Float:y, Float:z,
string[64];

GetPlayerName(playerid, name, sizeof(name));
GetPlayerPos(playerid, x, y, z);

format(string, sizeof(string), "Hello %s!\nI'm at your position", name);
playerTextId[playerid] = CreatePlayer3DTextLabel(playerid, string, 0x008080FF, x, y, z, 40.0);
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
DeletePlayer3DTextLabel(playerid, playerTextId[playerid]);
return 1;
}

相关函数