Pular para o conteúdo principal

IsPlayerAttachedObjectSlotUsed

Descrição

Verifique se um jogador possui um objeto anexado no índice (slot) especificado.

NomeDescrição
playeridO ID do jogador a ser verificado.
indexO índice (slot) a ser verificado.

Retornos

true - O slot especificado é usado para um objeto anexado.

false - O slot especificado não está em uso para um objeto anexado.

Exemplos

stock CountAttachedObjects(playerid)
{
new count;
for (new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
if (IsPlayerAttachedObjectSlotUsed(playerid, i))
{
count++;
}
}
return count;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/count", true))
{
new string[32];
format(string, sizeof(string), "Attached objects: %d", CountAttachedObjects(playerid));
SendClientMessage(playerid, -1, string);
return 1;
}
return 0;
}

Funções Relacionadas