Uncuff problem.
#1

The problem is.. When i do /uncuff then that cuffed player still is cuffed (animation) i set ClearAnmations in /uncuff but still have that shit when i type /uncuff player is still cuffed

Here is /uncuff script, if someone know the fault then please say it to me.

Код:
if(strcmp(cmd, "/uncuff", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(IsACop(playerid))
			{
			    tmp = strtok(cmdtext, idx);
				if(!strlen(tmp)) {
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /uncuff [Playerid/PartOfName]");
					return 1;
				}
				giveplayerid = ReturnUser(tmp);
				if(IsPlayerConnected(giveplayerid))
				{
					if(giveplayerid != INVALID_PLAYER_ID)
					{
					    if (ProxDetectorS(8.0, playerid, giveplayerid))
						{
						    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Uncuff yourself!"); return 1; }
							if(PlayerCuffed[giveplayerid])
							{
							    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							    format(string, sizeof(string), "* You were Uncuffed by %s, you can now run away or give up again.", sendername);
								SendClientMessage(giveplayerid, COLOR_WHITE, string);
								format(string, sizeof(string), "* You Uncuffed %s.", giveplayer);
								SendClientMessage(playerid, COLOR_WHITE, string);
								GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
								TogglePlayerControllable(giveplayerid, 1);
								ClearAnimations(playerid);
								PlayerCuffed[giveplayerid] = 0;
								SetPlayerColor(giveplayerid, 0xFF990000);
								KillTimer(cufftimer[giveplayerid]);
							}
							else
							{
							    SendClientMessage(playerid, COLOR_GREY, "* That player isn't Tied up !");
							    return 1;
							}
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GREY, "* That player is not near you !");
						    return 1;
						}
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "* That player is Offline !");
				    return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "* You are not a Cop / FBI / National Guard !");
			}
		}//not connected
		return 1;
	}
dont look at callbacks, they all is in right place.
Reply
#2

Put this in /uncuff command SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
Reply
#3

The problem is you're using "playerid" for clearing the animation. Whoever uses the command, it clears their animations. From the looks of it, the player being uncuffed is "giveplayerid", so change
Код:
ClearAnimations(playerid);
to
Код:
ClearAnimations(giveplayerid);
Reply
#4

Many thx McCurdy and Lutz, now uncuff works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)