Cuff and handsup issue. -
Harmon - 16.09.2012
Right here is the problem I'll post the script codes below.
When I wanna cuff someone I have to taze them and When they do /handsup i cannot /cuff because it says they are not Restrained. Now when they are cuffed and I attempt to uncuff it says they are not cuffed.. Here are the Cuff, Uncuff, and Handsup commands.
Cuff
Код:
if(strcmp(cmd, "/cuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid) || IsAAgent(playerid) || IsANG(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [Playerid/PartOfName]");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Cannot use this while in a Car !");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " You can't Cuff Other Cops !");
return 1;
}
if(IsANG(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " You can't Cuff Other DoC Officer !");
return 1;
}
if(PlayerTied[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " That player is Tied up !");
return 1;
}
if(PlayerCuffed[giveplayerid] > 1)
{
SendClientMessage(playerid, COLOR_GREY, " That player is already Cuffed !");
return 1;
}
if(IsPlayerInAnyVehicle(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " Suspect is in a car, get him out first !");
return 1;
}
if(PlayerCuffed[giveplayerid] == 1)
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, " You can't Cuff yourself !"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You were Cuffed by Officer %s.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerCuffed[giveplayerid] = 2;
if(PlayerInfo[giveplayerid][pMask] == 1)
{
format(string, sizeof(string), "* You Cuffed A Stranger.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s Hand Cuffs A Stranger, so he wont go anywhere.", PlayerName(playerid));
PlayerCuffed[giveplayerid] = 2;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
format(string, sizeof(string), "* You Cuffed %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s Hand Cuffs %s, so he wont go anywhere.", sendername ,giveplayer);
PlayerCuffed[giveplayerid] = 2;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.027999, 0.051999, -0.030000, -18.699926, 0.000000, 104.199928, 1.489999, 3.036000, 1.957999);
PlayerCuffed[giveplayerid] = 2;
PlayerCuffedTime[giveplayerid] = 300;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player needs to be restrained first !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a member of the LSPD / SASP / FBI !");
}
}
return 1;
}
Now the Uncuff.
Код:
if(strcmp(cmd, "/uncuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid) || IsAAgent(playerid) || IsANG(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 can't Uncuff yourself !"); return 1; }
if(PlayerCuffed[giveplayerid])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You were Uncuffed by %s.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
if(PlayerInfo[giveplayerid][pMask] == 1)
{
format(string, sizeof(string), "* You uncuffed A Stranger.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s has uncuffed A Stranger.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
format(string, sizeof(string), "* You uncuffed %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s has uncuffed %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
SetPlayerCuffed(giveplayerid, 0);
PlayerCuffed[giveplayerid] = 0;
SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
RemovePlayerAttachedObject(19418,giveplayerid);
ClearAnimations(giveplayerid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player isn't Cuffed !");
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 member of the LSPD / SASP / FBI !");
}
}
return 1;
}
And Last is the /handsup command.
Код:
if(strcmp(cmd,"/handsup", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerTied[playerid] != 0 || PlayerCuffed[playerid] != 0 || PlayerFrozen[playerid] != 0 || IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " You can't do that at this time !");
return 1;
}
else
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
}
}
return 1;
}
Re: Cuff and handsup issue. -
zT KiNgKoNg - 16.09.2012
Ill send you a code
Re: Cuff and handsup issue. -
Harmon - 16.09.2012
Could I get someone else to help.. I need the code to be in Strcmd/Strcmp which ever it is.. I'm not that experienced in scripting.