/uncuff Problem
#1



how to fix that ?

PHP код:
CMD:cuff(playeridparams[])
{
    if(
IsACop(playerid) || (PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pDivision] == 5) || PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pDivision] == || (PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pRank] >= 5))
    {
        if(
GetPVarInt(playerid"Injured") == 1)
        {
            
SendClientMessage(playeridCOLOR_GREY"You can't do this right now.");
            return 
1;
        }
        new 
string[128], giveplayerid;
        if(
sscanf(params"u"giveplayerid))
            return 
SendClientMessage(playeridCOLOR_WHITE"USAGE: /cuff [playerid/partofname]");
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
ProxDetectorS(8.0playeridgiveplayerid))
            {
                if(
giveplayerid == playerid) { SendClientMessage(playeridCOLOR_GREY"You can't cuff yourself!"); return 1; }
                if(
PlayerCuffed[giveplayerid] == || GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP)
                {
                    
format(stringsizeof(string), "* You have been handcuffed by %s."GetPlayerNameEx(playerid));
                    
SendClientMessage(giveplayeridCOLOR_LIGHTBLUEstring);
                    
format(stringsizeof(string), "* You handcuffed %s, till uncuff."GetPlayerNameEx(giveplayerid));
                    
SendClientMessage(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);
                    
SetPlayerAttachedObject(giveplayerid0194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                    
SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_CUFFED);
                    
TogglePlayerControllable(giveplayerid0);
                    
ClearAnimations(giveplayerid);
                    
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
                {
                    
SendClientMessage(playeridCOLOR_GREY"That player isn't restrained!");
                    return 
1;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"That player isn't near you.");
                return 
1;
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"Invalid player specified.");
            return 
1;
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_GREY"You're not a law enforcement officer.");
    }
    return 
1;

PHP код:
CMD:uncuff(playeridparams[])
{
    if(
IsACop(playerid) || (PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pDivision] == 5) || PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pDivision] == || (PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pRank] >= 5))
    {
        new 
string[128], giveplayerid;
        if(
sscanf(params"u"giveplayerid)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /uncuff [playerid/partofname]");
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
ProxDetectorS(8.0playeridgiveplayerid))
            {
                if(
PlayerInfo[giveplayerid][pJailed] >= 1)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"You can't uncuff a jailed player.");
                    return 
1;
                }
                if(
giveplayerid == playerid) { SendClientMessage(playeridCOLOR_GREY"You can't uncuff yourself."); return 1; }
                if(
PlayerCuffed[giveplayerid]>1)
                {
                    
DeletePVar(giveplayerid"IsFrozen");
                    
format(stringsizeof(string), "* You have been uncuffed by %s."GetPlayerNameEx(playerid));
                    
SendClientMessage(giveplayeridCOLOR_LIGHTBLUEstring);
                    
format(stringsizeof(string), "* You uncuffed %s."GetPlayerNameEx(giveplayerid));
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    
format(stringsizeof(string), "* %s has uncuffed %s."GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    
GameTextForPlayer(giveplayerid"~g~Uncuffed"25003);
                    
TogglePlayerControllable(giveplayerid1);
                    
ClearAnimations(giveplayerid);
                    
PlayerCuffed[giveplayerid] = 0;
                    
PlayerCuffedTime[giveplayerid] = 0;
                    
DeletePVar(giveplayerid"PlayerCuffed");
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"That player isn't cuffed.");
                    return 
1;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"That player isn't near you.");
                return 
1;
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"Invalid player specified.");
            return 
1;
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_GREY"You're not a law enforcement officer.");
    }
    return 
1;

Reply
#2

You just dont have to use the PVar,can you show me the use for the 2 pvars in /uncuff?
Reply
#3

how to detach the handcuff object ?
Reply
#4

This will do the trick . Put it under the /uncuff command
Код:
ClearAnimations(giveplayerid);
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
Reply
#5

under
pawn Код:
ClearAnimations(giveplayerid);
add:
pawn Код:
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
This will let him do not do any animation
Reply
#6

Quote:

under
pawn Code:
ClearAnimations(giveplayerid);
add:
pawn Code:
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
This will let him do not do any animation

Thats exactly what I said...
Reply
#7

first of all i didnt even look at your post i just posted mine and found your,i just checked the OnPlayerDeath thingy and didnt find anything wrong so i knew that it's in the admin duty command
Reply
#8

A Special Action can't be disabled with ClearAnimation as far as I know so use SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION _NONE);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)