Cant move after /cuff -
MrSnapp - 24.09.2012
Hi all. When someone performs the animation /handsup, they can be cuffed and then move around. But when they are tazed and then cuffed they cannot stand up or move. Could you please help me fix this?
pawn Код:
CMD:cuff(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an SAPD Oficer.");
if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [playerid]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from that player.");
if(!IsPlayerTazed(playerb) && GetPlayerSpecialAction(playerb) != SPECIAL_ACTION_HANDSUP) return SendClientMessage(playerid, COLOR_GREY, "Player is not tazed nor has their hands up.");
// /me Message & Animation
GameTextForPlayer(playerb, "~r~Cuffed", 3500, 3);
format(string, sizeof(string), "* %s pulls a pair of steel cuffs from their belt and puts %s's hands inside them.", RPN(playerid), RPN(playerb));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
ClearAnimations(playerb);
//ApplyAnimation(playerb,"ped","cower",1,1,0,0,0,0,1);
//ApplyAnimation(playerb,"ped","cower",1,1,0,0,0,0,1);
SetPlayerAttachedObject(playerb, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(playerb,SPECIAL_ACTION_CUFFED);
// Tazed Setting
TogglePlayerTazed(playerb, 0);
TogglePlayerCuffed(playerb, 1);
// Cuff Timeout
CuffTimeout[playerb] = 300;
KillTimer(TazeCountDown[playerb]);
CuffCountDown[playerb] = SetTimerEx("CuffTimer", 1000, true, "d", playerb);
return 1;
}
Re: Cant move after /cuff -
ikbenremco - 24.09.2012
TogglePlayerControllable(playerb, 0);
0= cannot move 1= move
Re: Cant move after /cuff -
MrSnapp - 24.09.2012
Quote:
Originally Posted by ikbenremco
TogglePlayerControllable(playerb, 0);
0= cannot move 1= move
|
Thank you!
Re: Cant move after /cuff -
XtremeR - 24.09.2012
try this one:
pawn Код:
CMD:cuff(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an SAPD Oficer.");
if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [playerid]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from that player.");
if(!IsPlayerTazed(playerb) && GetPlayerSpecialAction(playerb) != SPECIAL_ACTION_HANDSUP) return SendClientMessage(playerid, COLOR_GREY, "Player is not tazed nor has their hands up.");
// /me Message & Animation
GameTextForPlayer(playerb, "~r~Cuffed", 3500, 3);
format(string, sizeof(string), "* %s pulls a pair of steel cuffs from their belt and puts %s's hands inside them.", RPN(playerid), RPN(playerb));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
ClearAnimations(playerb);
//ApplyAnimation(playerb,"ped","cower",1,1,0,0,0,0,1);
//ApplyAnimation(playerb,"ped","cower",1,1,0,0,0,0,1);
SetPlayerAttachedObject(playerb, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(playerb,SPECIAL_ACTION_CUFFED);
// Tazed Setting
TogglePlayerTazed(playerb, 0);
TogglePlayerCuffed(playerb, 1);
TogglePlayerControllable(playerid,0);
// Cuff Timeout
CuffTimeout[playerb] = 300;
KillTimer(TazeCountDown[playerb]);
CuffCountDown[playerb] = SetTimerEx("CuffTimer", 1000, true, "d", playerb);
return 1;
}