[Ajuda] Duvida sobre limite de objetos usando SetPlayerHoldingObject
#6

Quote:
Originally Posted by CyNiC
View Post
Tб acontecendo de vocк querer usar o mesmo slot pra objetos diferentes, pra resolver vocк pode usar isso(ou o ъltimo exemplo):
pawn Code:
stock GetFreeSlotForPlayer(playerid){
    for(new a=0;a<MAX_PLAYER_ATTACHED_OBJECTS;a++){
        if(!IsPlayerAttachedObjectSlotUsed(playerid,a)){
            return a;
        }
    }
    return 0;
}

pawn Code:
//exemplo de como atachar 2 objetos usando a funзгo:
SetPlayerAttachedObject(playerid, GetFreeSlotForPlayer(playerid), 1245, 1,0.0, 0.0, 0.0, 1, 1,1);
SetPlayerAttachedObject(playerid, GetFreeSlotForPlayer(playerid), 1010, 1,0.0, 0.0, 0.0, 1, 1,1);
//mesmo exemplo sem usar a funзгo:
SetPlayerAttachedObject(playerid, 0, 1245, 1,0.0, 0.0, 0.0, 1, 1,1);
SetPlayerAttachedObject(playerid, 1, 1010, 1,0.0, 0.0, 0.0, 1, 1,1);
The index (slot) to assign the object to (0-9 since 0.3d, 0-4 in previous versions).
https://sampwiki.blast.hk/wiki/SetPlayerAttachedObject
Mais eu nгo to usando o Player Attached to usando o Holding Object nele tambйm tem essa parada de botar um slot diferente pra nгo substituir o outro?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)