SA-MP Forums Archive
Can't "undetain" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can't "undetain" (/showthread.php?tid=609816)



Can't "undetain" - Progamerisrael1 - 16.06.2016

Hey,
I downloaded RP mode from here and when I detain someone, I can't take him out?
Someone have an idea how to fix it?
or there's a command?


Re: Can't "undetain" - GangstaSunny - 17.06.2016

Well...

Please ask in this thread where you downloaded the Gamemode in order to get help.


Re: Can't "undetain" - Progamerisrael1 - 17.06.2016

Quote:
Originally Posted by GangstaSunny
Посмотреть сообщение
Well... :D

Please ask in this thread where you downloaded the Gamemode in order to get help.
Quote:

CMD:detain(playerid, params[])
{
if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5 || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2))
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessageEx(playerid, COLOR_GREY, "You can't do this while you're in a vehicle.");
return 1;
}

new string[128], giveplayerid, seat;
if(sscanf(params, "ud", giveplayerid, seat)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /detain [playerid] [seatid 1-3]");

if(IsPlayerConnected(giveplayerid))
{
if(seat < 1 || seat > 3)
{
SendClientMessageEx(playerid, COLOR_GRAD1, "The seat ID cannot be above 3 or below 1.");
return 1;
}
if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
{
SendClientMessageEx(playerid, COLOR_GREY, "You can't detain other law enforcement officers.");
return 1;
}
if(IsPlayerInAnyVehicle(giveplayerid))
{
SendClientMessageEx(playerid, COLOR_GREY, "That person is in a car - get them out first.");
return 1;
}
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot detain yourself!"); return 1; }
if(PlayerCuffed[giveplayerid] == 2)
{
new carid = gLastCar[playerid];
if(IsSeatAvailable(carid, seat))
{
new Float:pos[6];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerPos(giveplayerid, pos[3], pos[4], pos[5]);
GetVehiclePos( carid, pos[0], pos[1], pos[2]);
if (floatcmp(floatabs(floatsub(pos[0], pos[3])), 10.0) != -1 &&
floatcmp(floatabs(floatsub(pos[1], pos[4])), 10.0) != -1 &&
floatcmp(floatabs(floatsub(pos[2], pos[5])), 10.0) != -1) return false;
format(string, sizeof(string), "* You were detained by %s .", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* You detained %s .", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s throws %s in the vehicle.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Detained", 2500, 3);
ClearAnimations(giveplayerid);
TogglePlayerControllable(giveplayerid, false);
PutPlayerInVehicle(giveplayerid, carid, seat);
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "That seat isn't available!");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "That person isn't cuffed.");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " You're not close enough to the player or your car!");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a Cop / FBI / Coastguard!");
}
return 1;
}

It's the detain CMD.


Re: Can't "undetain" - Sew_Sumi - 17.06.2016

This isn't how this section works.

Chase up the gamemode release thread and check there.



In general though, the way to "undetain" is to arrest them. Otherwise eject.


Re: Can't "undetain" - Luicy. - 17.06.2016

Slap them and it's done.


Re: Can't "undetain" - Sew_Sumi - 17.06.2016

eject and uncuff would be the more logical approach. Slap may unfreeze them but the variables may say otherwise.