IsPlayerAttachedObjectSlotUsed +rep!
#1

hi,

how could i loop trough all object slots/indexes and check how many objects a player has attached?

pawn Код:
IsPlayerAttachedObjectSlotUsed();
please help
Reply
#2

pawn Код:
stock AttachedObjects(playerid)
{
    new Objects;
    for(new d; d < MAX_PLAYER_ATTACHED_OBJECTS; d++)
        if(IsPlayerAttachedObjectSlotUsed(playerid, d);
            Objects++;
    return Objects;
}
Reply
#3

so i could use this like?
pawn Код:
if(Objects>1)return //...ERROR: only 1 object possible
Reply
#4

if(AttachedObjects(playerid) > 1)
Reply
#5

Ye - Calling the AttachedObjects stock from above would return the number attached to that player.
So if you wanted to use it externally:

pawn Код:
new Variable;
Variable = AttachedObjects(playerid);
if(Variable>1)
{
    //Do things if there is more than one object attached
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)