IsPlayerAttachedObjectSlotUsed

warning

This function was added in SA-MP 0.3c and will not work in earlier versions!

Description

Check if a player has an object attached in the specified index (slot).

NameDescription
playeridThe ID of the player to check.
indexThe index (slot) to check.

Returns

1: The specified slot is used for an attached object.

0: The specified slot is not in use for an attached object.

Examples

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

Related Functions