Why ClearAnimations and RemovePlayerAttachedObject don't work? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Why ClearAnimations and RemovePlayerAttachedObject don't work? (
/showthread.php?tid=550402)
Why ClearAnimations and RemovePlayerAttachedObject don't work? -
ilepopivanov - 12.12.2014
Here I attached the object
Код:
if(NaPos(playerid, 2.0, -368.7406,-1412.4456,25.7266))
{
if(PlayerInfo[playerid][pRabota] == 10)
{
imagajba[playerid] = 1;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0, 1);
SetPlayerAttachedObject(playerid, 0, 1355, 1, 0.162864, 0.403240, -0.008182, 5.772127, 89.982292, 356.481140, 1.000000, 1.000000, 1.000000); // CJ_FRUITCRATE1 - gajba
SendClientMessage(playerid, -1, "{00FFFF}(DWIG){FF5300}Zedovte gajba.Odete berete jabolka");
}
}
Here I wan't to deattach object and stop animation but don't working
Код:
if(NaPos(playerid, 2.0, -364.3782,-1412.7043,25.7266))
{
if(PlayerInfo[playerid][pRabota] == 10)
{
new zarabotka = jabulki[playerid]*200;
SCMF(playerid, -1, "{00FFFF}(DWIG){FF5300}Prodadovte %d parcinja jabolka za %d$.", jabulki[playerid], zarabotka);
SendClientMessage(playerid, -1, "{00FFFF}(DWIG){FF5300}1 parce jabolka 200$");
imagajba[playerid] = 0;
ClearAnimations(playerid);
RemovePlayerAttachedObject(playerid, 1);
}
}
Re: Why ClearAnimations and RemovePlayerAttachedObject don't work? -
Divergent - 12.12.2014
Код:
SetPlayerAttachedObject(playerid, 0
In this code, the "index" is 0.
Код:
RemovePlayerAttachedObject(playerid, 1);
In this code the "index" is 1, they're not the same that's why it isn't removing it.
Re: Why ClearAnimations and RemovePlayerAttachedObject don't work? -
ilepopivanov - 12.12.2014
Thanks for this but can I stop the animation SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
with SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE); ?