stopanim
#1

Hallo, please help me.
Код:
CMD:cuff(playerid, params[])
{
	new
		otherId
	;
	if(sscanf(params, "u", otherId)) return SendClientMessage(playerid, COLOR_WHITE, "USE: /cuff[playerid]");
	TogglePlayerControllable(otherId, 1);
	ClearAnimations(otherId);
	SetPlayerAttachedObject(otherId, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
	SetPlayerSpecialAction(otherId,SPECIAL_ACTION_CUFFED);
	return true;
}
But player use /stopanim then clearanimation. How i fix this, when player is cuffed then he cant use /stopanim

Код:
CMD:stopanim(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "In car can not use /lanim!");
	ClearAnimations(playerid);
	SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
	return true;
}
Reply
#2

use this to see if there special action = SPECIAL_ACTION_CUFFED

https://sampwiki.blast.hk/wiki/GetPlayerSpecialAction


pawn Код:
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED) return SendClientMessage(playerid, COLOR_RED, "Your Cuffed and can not use /lanim!");
Reply
#3

If you have something like this in your script PlayerCuffed[MAX_PLAYERS] ,you can put in /stopanim cmd this:
if(PlayerCuffed(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " You cannot use this cmd while cuffed '');
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)