if(strcmp(cmd, "/uncuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "DEBUG: /uncuff [Playerid]");
return true;
}
giveplayerid = strvalEx(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You cannot Uncuff yourself!");
return true;
}
if(PlayerCuffed[giveplayerid])
{
if(OnDuty[playerid]==1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You were Uncuffed by %s.", sendername);
SendClientMessage(giveplayerid, COLOR_GREY, string);
format(string, sizeof(string), "* You Uncuffed %s.", giveplayer);
SendClientMessage(playerid, COLOR_GREY, string);
GameTextForPlayer(giveplayerid, "~w~You Have Been Uncuffed", 2750, 3);
TogglePlayerControllable(giveplayerid, 1);
RemovePlayerAttachedObject(giveplayerid,19418);
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
PlayerCuffed[giveplayerid] = false;
PlayerDragged[giveplayerid] = 0;
PlayerDraggedBy[giveplayerid] = 255;
format(string, sizeof(string), "* %s Removes %s Cuffs.", Account[playerid][pName] ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else { SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You must be on duty!"); }
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: That player isn't Cuffed up !");
return true;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: That player is not near you!!");
return true;
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: That player is Offline !");
return true;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You are not a Cop / ACI !");
}
}
return true;
}
if(strcmp(cmd, "/uncuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "DEBUG: /uncuff [Playerid]");
return true;
}
giveplayerid = strvalEx(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You cannot Uncuff yourself!");
return true;
}
if(PlayerCuffed[giveplayerid])
{
if(OnDuty[playerid]==1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You were Uncuffed by %s.", sendername);
SendClientMessage(giveplayerid, COLOR_GREY, string);
format(string, sizeof(string), "* You Uncuffed %s.", giveplayer);
SendClientMessage(playerid, COLOR_GREY, string);
GameTextForPlayer(giveplayerid, "~w~You Have Been Uncuffed", 2750, 3);
TogglePlayerControllable(giveplayerid, 1);
RemovePlayerAttachedObject(giveplayerid,0); //OBJECT SLOT NOT ID
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
PlayerCuffed[giveplayerid] = false;
PlayerDragged[giveplayerid] = 0;
PlayerDraggedBy[giveplayerid] = 255;
format(string, sizeof(string), "* %s Removes %s Cuffs.", Account[playerid][pName] ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else { SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You must be on duty!"); }
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: That player isn't Cuffed up !");
return true;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: That player is not near you!!");
return true;
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: That player is Offline !");
return true;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You are not a Cop / ACI !");
}
}
return true;
}
That's already defined if you'd look closer.
if(IsPlayerConnected(giveplayerid)) |