Problem[/uncuff]
#1

if the cop uncuffs me then i remain cuffed what can i do?

PHP код:
if(strcmp(cmd"/cuff"true) == || strcmp(cmd"/cu"true) == 0)
                {
                if(
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
                {
                if(
IsACop(playerid))
                {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp)) {
                
SendClientMessage(playeridCOLOR_WHITE"USAGE: /cuff [Playerid/PartOfName]");
                return 
1;
                }
                
giveplayerid ReturnUser(tmp);
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(
IsACop(giveplayerid))
                        {
                            
SendClientMessage(playeridCOLOR_GREY"* You can't Cuff Cops !");
                            return 
1;
                        }
                        if(
PlayerCuffed[giveplayerid] > 0)
                        {
                            
SendClientMessage(playeridCOLOR_GREY"* Player already Cuffed !");
                            return 
1;
                        }
                        if (
ProxDetectorS(8.0playeridgiveplayerid))
                        {
                            if(
giveplayerid == playerid) return SendClientMessage(playeridCOLOR_GREY"You cannot cuff yourself!");
                            
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                            
format(stringsizeof(string), "* You were Cuffed by %s, till uncuff."sendername);
                            
SendClientMessage(giveplayeridCOLOR_WHITEstring);
                            
SetPlayerSpecialAction(giveplayeridSPECIAL_ACTION_CUFFED);
                            
SetPlayerAttachedObject(giveplayerid0194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                            
format(stringsizeof(string), "* You Cuffed %s, till uncuff."giveplayer);
                            
SendClientMessage(playeridCOLOR_WHITEstring);
                            
format(stringsizeof(string), "* %s Hand Cuffs %s, so he wont go anywhere."sendername ,giveplayer);
                            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            
GameTextForPlayer(giveplayerid"~r~Cuffed"25003);
                            
TogglePlayerControllable(giveplayerid0);
                            
PlayerCuffed[giveplayerid] = 1;
                            
PlayerCuffedTime[giveplayerid] = 180;
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GREY"* That player is not near you !");
                            return 
1;
                        }
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"* That player is Offline !");
                    return 
1;
                }
                }
                else
                {
                
SendClientMessage(playeridCOLOR_GREY"* Nu esti COP / SRI / ARMATA ROMANA !");
                }
                }
                return 
1;
                } 
PHP код:
 if(strcmp(cmd"/uncuff"true) == 0)
                {
                if(
IsPlayerConnected(playerid))
                {
                if(
IsACop(playerid))
                {
                    
tmp strtok(cmdtextidx);
                    if(!
strlen(tmp)) {
                        
SendClientMessage(playeridCOLOR_WHITE"USAGE: /uncuff [Playerid/PartOfName]");
                        return 
1;
                    }
                    
giveplayerid ReturnUser(tmp);
                    if(
IsPlayerConnected(giveplayerid))
                    {
                        if(
giveplayerid != INVALID_PLAYER_ID)
                        {
                            if (
ProxDetectorS(8.0playeridgiveplayerid))
                            {
                                if(
giveplayerid == playerid) { SendClientMessage(playeridCOLOR_GREY"You cannot Uncuff yourself!"); return 1; }
                                if(
PlayerCuffed[giveplayerid])
                                {
                                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(stringsizeof(string), "* You were Uncuffed by %s."sendername);
                                    
SendClientMessage(giveplayeridCOLOR_LIGHTBLUEstring);
                                    
format(stringsizeof(string), "* You Uncuffed %s."giveplayer);
                                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                                    
GameTextForPlayer(giveplayerid"~g~Uncuffed"25003);
                                    
TogglePlayerControllable(giveplayerid1);
                                    
PlayerCuffed[giveplayerid] = 0;
                                }
                                else
                                {
                                    
SendClientMessage(playeridCOLOR_GREY"   That player isn't Tied up !");
                                    return 
1;
                                }
                            }
                            else
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   That player is not near you !");
                                return 
1;
                            }
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GREY"   That player is Offline !");
                        return 
1;
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"   You are not a Cop / Serviciu Roman de Investigatii / Armata Romana !");
                }
                }
//not connected
                
return 1;
                } 
Reply
#2

pawn Код:
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));
                                    GetPlayerName(playerid, sendername, sizeof(sendername));
                                    format(string, sizeof(string), "* You were Uncuffed by %s.", sendername);
                                    SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                                    format(string, sizeof(string), "* You Uncuffed %s.", giveplayer);
                                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                                    GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
                                    TogglePlayerControllable(giveplayerid, 1);
                                    PlayerCuffed[giveplayerid] = 0;
                                    SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE); // You forgot this.
                                }
                                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 / Serviciu Roman de Investigatii / Armata Romana !");
                }
                }//not connected
                return 1;
                }
Reply
#3

but if i /uncuff the cuffs are on the hands but hes uncuffed..
Reply
#4

Did you use VincentDunn's example? Because like he said you missed
Код:
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
If not use
Код:
ClearAnimations(playerid);
Reply
#5

it does clearanim but after i get the cuffs on right hand..not on both hands..he does clear anim..
Reply
#6

what do i do?
Reply
#7

Are you talking about the handcuff object?
Reply
#8

yeah fixed..sorry for headaches..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)