SA-MP Forums Archive
0.3e cuff bug +rep - 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: 0.3e cuff bug +rep (/showthread.php?tid=364021)



0.3e cuff bug +rep - BurgerWoman - 29.07.2012

Hey all.
Im using the 0.3e cuff: https://sampforum.blast.hk/showthread.php?tid=349759
but when im cuff someone the cuff object is on the police but the player that got cuffed cant move.
picture:



Re: 0.3e cuff bug +rep - Littlehelper - 29.07.2012

It means you are TogglePlayerControllable'ing the playerid and Cuffing the copid.
Show us the code you have to cuff someone.


Re: 0.3e cuff bug +rep - KingyKings - 29.07.2012

Haha.

Make sure in the script that it puts the object on the ID (playername) not the player who types the command

If it actually cuffs the right person but put the cuffs on the cop, take the script that puts the object on the cop and change it to make it go on the other person. If this is making sence :P

Hope this helped


Re: 0.3e cuff bug +rep - BurgerWoman - 29.07.2012

Quote:

CMD:cuff(playerid, params[])
{
if(IsACop(playerid) || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5 || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2))
{
if(GetPVarInt(playerid, "Injured") == 1)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
return 1;
}

new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /cuff [playerid]");

if(IsPlayerConnected(giveplayerid))
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot cuff yourself!"); return 1; }
if(PlayerCuffed[giveplayerid] == 1 || GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP)
{
format(string, sizeof(string), "* You have been handcuffed by %s.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* You handcuffed %s, till uncuff.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s handcuffs %s, tightening the cuffs securely.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
TogglePlayerControllable(giveplayerid, 0);
ClearAnimations(giveplayerid);
ApplyAnimation(giveplayerid,"ped","cower",1,1,0,0, 0,0,1);
PlayerCuffed[giveplayerid] = 2;
SetPVarInt(giveplayerid, "PlayerCuffed", 2);
SetPVarInt(giveplayerid, "IsFrozen", 1);
SetPlayerCuffed(playerid, 1);
//Frozen[giveplayerid] = 1;
PlayerCuffedTime[giveplayerid] = 300;
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "That player isn't restrained!");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "You're not a law enforcement officer.");
}
return 1;
}

and im using cuff.inc and cuff filter script all from this tutrial https://sampforum.blast.hk/showthread.php?tid=349759


Re: 0.3e cuff bug +rep - Littlehelper - 29.07.2012

pawn Код:
SetPlayerCuffed(playerid,1);
To
pawn Код:
SetPlayerCuffed(giveplayerid,1);



Re: 0.3e cuff bug +rep - BurgerWoman - 29.07.2012

Nvm i fixed it thanks you, you got your rp.