Problem with /cuff and /uncuff -
Don_Cage - 21.04.2013
When someone gets cuffed he starts to rotate for some seconds but after you cuffed someone you cant uncuff, it only say that the player isnt tied up!? Why is that so?
pawn Код:
if(strcmp(cmd, "/cuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid) || IsAFreecop(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [Playerid/PartOfName]");
return 1;
}
if(PlayerInfo[playerid][pDBanned] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "* You are Banned From Cop Duty!");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(IsACop(giveplayerid) || IsAFreecop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, "* You can't Cuff Cops !");
return 1;
}
if(PlayerCuffed[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "* Player already Cuffed !");
return 1;
}
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You cannot cuff yourself!");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Law Enforcer Cuffed You, till uncuff.");
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "* You Cuffed %s, till uncuff.", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Law Enforcer Have Cuffed The Man, so he wont go anywhere.");
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
PlayerCuffed[giveplayerid] = 1;
TogglePlayerControllable(giveplayerid, 0);
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
}
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 / FBI / National Guard !");
}
}
return 1;
}
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] > 0)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You were Uncuffed by %s, you can now run away or give up again.", sendername);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "* You Uncuffed %s.", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
TogglePlayerControllable(giveplayerid, 1);
PlayerCuffed[giveplayerid] = 0;
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
RemovePlayerAttachedObject(giveplayerid,0);
GaveUp[giveplayerid] = 0;
SetPlayerColor(giveplayerid, 0xFFFFFFAA);
}
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 / FBI / National Guard !");
}
}//not connected
return 1;
}
Re: Problem with /cuff and /uncuff -
jakejohnsonusa - 21.04.2013
This is Raven's RP. The cuff system sucks in it. Try searching the filterscripts for a good cuff system, edit it a bit to include the Ravens RP things, then just replace it into your GM.
Do add credits to the one you use though.
Re: Problem with /cuff and /uncuff -
Don_Cage - 21.04.2013
Fixed it now! The problem wasnt in the commands it was somewhere else in the script, someone had put a cuffedtime wich made all those lags