Mein Problem: Ich kann jemanden Handschellen ablegen, aber nicht abnehmen
//EDIT
Hab den Fehler gefunden! Für alle die es wissen wollen wie:
ocmd:handschellen(playerid,params[])
{
if(IstSpielerInFraktion(playerid,1))
{
if(IstSpielerImDienst(playerid,1))
{
new pID;
new handcuff;
if(sscanf(params,"u",pID))return SendClientMessage(playerid,farbe_hellblau,"/cuff [playerid]");
{
if(pID == playerid)return SendClientMessage(playerid,farbe_hellblau,"Du kannst dir nicht selbst Handschellen anlegen!");
new Float:cx,Float:cy,Float:cz;
GetPlayerPos(playerid,cx,cy,cz);
if(IsPlayerInRangeOfPoint(pID,2.0,cx,cy,cz))
{
if(GetPlayerSpecialAction(pID) == SPECIAL_ACTION_NONE)
{
SetPlayerSpecialAction(pID, SPECIAL_ACTION_CUFFED);
handcuff = SetPlayerAttachedObject(pID, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
TogglePlayerControllable(pID,0);
}
else
{
SetPlayerSpecialAction(pID, SPECIAL_ACTION_NONE);
handcuff = RemovePlayerAttachedObject(pID, handcuff);
TogglePlayerControllable(pID,1);
}
}
}
}
else
{
SendClientMessage(playerid,farbe_rot,"Du bist nicht im Dienst");
}
}
return 1;
}