I want a cuffdrag cmd that allows you to move whilst cuffed
#1

This is the cuff CMD in my script
PHP код:
CMD:cuff(playeridparams[])
{
    if(
IsACop(playerid))
    {
        if(
GetPVarInt(playerid"Injured") == || PlayerCuffedplayerid ] >= || PlayerInfoplayerid ][ pJailTime ] > || PlayerInfo[playerid][pHospital] > 0)
        {
            
SendClientMessageEx(playeridCOLOR_GREY"You can't do this right now.");
            return 
1;
        }
        if(
PlayerInfo[playerid][pHasCuff] < 1)
        {
            
SendClientMessageEx(playeridCOLOR_WHITE"You do not have any pair of cuffs on you!");
            return 
1;
        }
        new 
string[128], giveplayeridFloat:healthFloat:armor;
        if(
sscanf(params"u"giveplayerid)) return SendClientMessageEx(playeridCOLOR_GREY"USAGE: /cuff [player]");
        if(
IsPlayerConnected(giveplayerid))
        {
            if (
ProxDetectorS(8.0playeridgiveplayerid))
            {
                if(
giveplayerid == playerid) { SendClientMessageEx(playeridCOLOR_GREY"You cannot cuff yourself!"); return 1; }
                if(
PlayerCuffed[giveplayerid] == || GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP)
                {
                    
format(stringsizeof(string), "* You have been handcuffed by %s."GetPlayerNameEx(playerid));
                    
SendClientMessageEx(giveplayeridCOLOR_LIGHTBLUEstring);
                    
format(stringsizeof(string), "* You handcuffed %s, till uncuff."GetPlayerNameEx(giveplayerid));
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring);
                    
format(stringsizeof(string), "* %s handcuffs %s, tightening the cuffs securely."GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
GameTextForPlayer(giveplayerid"~r~Cuffed"25003);
                    
TogglePlayerControllable(giveplayerid0);
                    
ClearAnimations(giveplayerid);
                    
GetPlayerHealth(giveplayeridhealth);
                    
GetPlayerArmour(giveplayeridarmor);
                    
SetPVarFloat(giveplayerid"cuffhealth",health);
                    
SetPVarFloat(giveplayerid"cuffarmor",armor);
                    
SetPlayerSpecialAction(giveplayeridSPECIAL_ACTION_CUFFED);
                    
ApplyAnimation(giveplayerid,"ped","cower",1,1,0,0,0,0,1);
                    
PlayerCuffed[giveplayerid] = 2;
                    
SetPVarInt(giveplayerid"PlayerCuffed"2);
                    
SetPVarInt(giveplayerid"IsFrozen"1);
                    
//Frozen[giveplayerid] = 1;
                    
PlayerCuffedTime[giveplayerid] = 300;
                }
                else if(
GetPVarType(giveplayerid"IsTackled"))
                {
                    
format(stringsizeof(string), "* %s removes a set of cuffs from his belt and attempts to cuff %s."GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
SetTimerEx("CuffTackled"40000"ii"playeridgiveplayerid);
                }
                else
                {
                    
SendClientMessageEx(playeridCOLOR_GREY"That person isn't restrained!");
                    return 
1;
                }
            }
            else
            {
                
SendClientMessageEx(playeridCOLOR_GREY"That person isn't near you.");
                return 
1;
            }
        }
        else
        {
            
SendClientMessageEx(playeridCOLOR_GREY"Invalid player specified.");
            return 
1;
        }
    }
    else
    {
        
SendClientMessageEx(playeridCOLOR_GREY"You're not a law enforcement officer.");
    }
    return 
1;

What do I need to change here in order to allow a player to move while cuffed?
Reply
#2

Remove "TogglePlayerControlable"
Reply
#3

Quote:
Originally Posted by GangstaSunny.
Посмотреть сообщение
Remove "TogglePlayerControlable"
This and the Player Variable saying "IsFrozen".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)