22.01.2016, 13:26
Alright, I made a new prison system for my script and added on /enter command that If player is cuffed then he'll get a message that he's not able to enter, I found that /enter command doesn't work IF cuffed or not cuffed.
Codes:
Codes:
pawn Код:
if(strcmp(cmd, "/enter", true) == 0)
{
if(PlayerTied[playerid] != 0 || PlayerCuffed[playerid] != 0 || PlayerJustDied[playerid] != 0) return SendClientMessage(playerid, COLOR_GRAD1, " You are unable to do that at this time.");
// =========[Prison System]==========
if(GetVehicleModel(SANGbus) > 0)
{
new Float:SANGbuspos[3];
GetVehiclePos(SANGbus, SANGbuspos[0], SANGbuspos[1], SANGbuspos[2]);
if(IsPlayerInRangeOfPoint(playerid, 2.0, SANGbuspos[0] - 2, SANGbuspos[1] - 2, SANGbuspos[2]))
{
SetPlayerPos(playerid, 506.7627,1965.5912,999.4003);
}
return 1;
}
//===================================
for(new i = 0;i < sizeof(EntranceRef);i++)
{
if(
IsPlayerInRangeOfPoint(playerid,2,Entrances[i][outside_x],Entrances[i][outside_y],Entrances[i][outside_z]) &&
GetPlayerVirtualWorld(playerid) == Entrances[i][outside_w] &&
GetPlayerInterior(playerid) == Entrances[i][outside_i])
{
if(strlen(Entrances[i][dpassword])) // has a pass
{
ShowPlayerDialog( playerid,
DIALOG_ID_PLAYER_PASS,
DIALOG_STYLE_INPUT,
"Door Password",
"Please enter the door's password to enter.",
"Okay",
"Cancel");
return 1;
}
SetPlayerPos(playerid,Entrances[i][inside_x],Entrances[i][inside_y],Entrances[i][inside_z]);
SetPlayerFacingAngle(playerid,Entrances[i][inside_a]);
SetPlayerInterior(playerid,Entrances[i][inside_i]);
SetPlayerVirtualWorld(playerid,Entrances[i][inside_w]);
SetCameraBehindPlayer(playerid);
if(Entrances[i][freeze])
{
FreezePlayer(playerid, FREEZE, ENTER_FREEZE);
}
return 1;
}
}