Posts: 270
Threads: 41
Joined: Sep 2013
Hello All! I am attaching this object to player
pawn Код:
SetPlayerAttachedObject( playerid, 0, 1550, 1, 0.021874, -0.291005, -0.065996, 2.304857, 116.303932, 147.327270, 0.995781, 0.997286, 1.000000 ); // CJ_MONEY_BAG
And using this code to remove it.
pawn Код:
for(new t=0; t<MAX_PLAYER_ATTACHED_OBJECTS; t++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, t)) RemovePlayerAttachedObject(playerid, t);
}
The problem is this that it removes every attached object but i need to remove only the CJ_MONEY_BAG, How can i do this?
Posts: 270
Threads: 41
Joined: Sep 2013
Posts: 270
Threads: 41
Joined: Sep 2013
Posts: 1,690
Threads: 18
Joined: Jul 2012
Reputation:
0
Uhm, Try using another line?
What makes them to remove CJ_Bag?
Posts: 270
Threads: 41
Joined: Sep 2013
Its on onPlayerDeath, Onplayer leave checkpoint and one self created callback, which get called every second and it is something like this
pawn Код:
if(getCheckpointType(playerid) == CP_SupaSaveMain)
{
if(RobbingSupaSave[playerid] >= 1)
{
RobbingSupaSave[playerid] =0;
for(new t=0; t<MAX_PLAYER_ATTACHED_OBJECTS; t++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, t)) RemovePlayerAttachedObject(playerid, t);
}
return 1;
}
return 1;
}
Posts: 270
Threads: 41
Joined: Sep 2013
Quote:
SetPlayerAttachedObject(playerid, 0, 1550, 1, 0.021874, -0.291005, -0.065996, 2.304857, 116.303932, 147.327270, 0.995781, 0.997286, 1.000000); // CJ_MONEY_BAG
// This is the attached object id ▲ (0) also this: ---------------------▼
/* So, remove it with this code: */ RemovePlayerAttachedbject(playerid, 0);
You can't assign the slot to a variable, you can just specify the number of it (0 to 9 since 0.3d).
|
So will it remove all attached object with id 0?
Posts: 270
Threads: 41
Joined: Sep 2013
Thank you very much