22.07.2014, 21:14
hey i made the detain checkpoint but it seems like when i am id 1 it wont work i tyed adding a ncp to take th id 0 id out but it also dint worked i dont know what is going on here is my checkpoint and my xyz code
so id 0 can jail people when he hits the detain checkpoint
but if id 1 try to enter the checkpoint id 0 wont be jailed ?
so id 0 can jail people when he hits the detain checkpoint
but if id 1 try to enter the checkpoint id 0 wont be jailed ?
PHP код:
Checkpoint[1] = CreateDynamicCP(1541.5448,-1655.8884,13.5590, 2.0, -1, -1, -1, 50);
PHP код:
if(checkpointid == Checkpoint[1])
{
new ID;
new pwl = GetPlayerWantedLevel(ID);
new i;
new string[256];
if(pwl == 4)
{
if(GetPlayerState(ID) == PLAYER_STATE_PASSENGER && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
TogglePlayerDynamicCP(playerid,Checkpoint[1], true);
format(string, sizeof(string), "Police Officer %s has arrested wanted suspect %s", PlayerInfo(playerid), PlayerInfo(ID));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
CNR_PrintString(string);
format(string, sizeof(string), "[POLICE RADIO] Suspect %s has been sent to jail", PlayerInfo(ID));
SendCopMessage(string);
AccountInfo[ID][pJailTime] = 60 ;
AccountInfo[ID][pJailed] = 1 ;
SetPlayerInterior(ID, 10);
new rnd = random(sizeof(PrisonSpawn));
SetPlayerPos(ID, PrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
SendClientMessage(ID, COLOR_GREY, "**LOS SANTOS PRISON**");
SendClientMessage(ID, COLOR_LIGHTBLUE, "[PRISON] You have been sent to prison. You will be released soon.");
TogglePlayerControllable(ID, 1);
SetPlayerWantedLevel(ID, 0);
if(IsPlayerAttachedObjectSlotUsed(ID, i)) RemovePlayerAttachedObject(ID, i);
SetPlayerSpecialAction(ID, SPECIAL_ACTION_NONE);
AccountInfo[ID][pCuffed] = 0 ;
TextDrawHideForPlayer(playerid, CF[playerid]);
GivePlayerMoney(playerid, 6500);
IncreaseScore(playerid, 1);
TogglePlayerDynamicCP(ID, Checkpoint[1], false);
TogglePlayerDynamicCP(playerid, Checkpoint[1], false);
}
return 1;
}
if(pwl == 5)
{
if(GetPlayerState(ID) == PLAYER_STATE_PASSENGER && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
format(string, sizeof(string), "Police Officer %s has arrested wanted suspect %s", PlayerInfo(playerid), PlayerInfo(ID));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
CNR_PrintString(string);
format(string, sizeof(string), "[POLICE RADIO] Suspect %s has been sent to jail", PlayerInfo(ID));
SendCopMessage(string);
AccountInfo[ID][pJailTime] = 80 ;
AccountInfo[ID][pJailed] = 1 ;
SetPlayerInterior(ID, 10);
new rnd = random(sizeof(PrisonSpawn));
SetPlayerPos(ID, PrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
SendClientMessage(ID, COLOR_GREY, "**LOS SANTOS PRISON**");
SendClientMessage(ID, COLOR_LIGHTBLUE, "[PRISON] You have been sent to prison. You will be released soon.");
TogglePlayerControllable(ID, 1);
SetPlayerWantedLevel(ID, 0);
if(IsPlayerAttachedObjectSlotUsed(ID, i)) RemovePlayerAttachedObject(ID, i);
SetPlayerSpecialAction(ID, SPECIAL_ACTION_NONE);
AccountInfo[ID][pCuffed] = 0 ;
GivePlayerMoney(playerid, 7500);
IncreaseScore(playerid, 1);
TextDrawHideForPlayer(playerid, CF[playerid]);
TextDrawHideForPlayer(playerid, PNotifications[playerid]);
TogglePlayerDynamicCP(ID, Checkpoint[1], false);
}
return 1;
}
if(pwl == 6)
{
if(GetPlayerState(ID) == PLAYER_STATE_PASSENGER && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
format(string, sizeof(string), "Police Officer %s has arrested wanted suspect %s", PlayerInfo(playerid), PlayerInfo(ID));
SendClientMessageToAll(COLOR_BLUE, string);
CNR_PrintString(string);
format(string, sizeof(string), "[POLICE RADIO] Suspect %s has been sent to jail", PlayerInfo(ID));
SendCopMessage(string);
AccountInfo[ID][pJailTime] = 100 ;
AccountInfo[ID][pJailed] = 1 ;
SetPlayerInterior(ID, 10);
new rnd = random(sizeof(PrisonSpawn));
SetPlayerPos(ID, PrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
SendClientMessage(ID, COLOR_GREY, "**LOS SANTOS PRISON**");
SendClientMessage(ID, COLOR_LIGHTBLUE, "[PRISON] You have been sent to prison. You will be released soon.");
TogglePlayerControllable(ID, 1);
SetPlayerWantedLevel(ID, 0);
if(IsPlayerAttachedObjectSlotUsed(ID, i)) RemovePlayerAttachedObject(ID, i);
SetPlayerSpecialAction(ID, SPECIAL_ACTION_NONE);
AccountInfo[ID][pCuffed] = 0 ;
GivePlayerMoney(playerid, 10000);
IncreaseScore(playerid, 1);
TogglePlayerDynamicCP(ID, Checkpoint[1], false);
TogglePlayerDynamicCP(playerid, Checkpoint[1], false);
}
return 1;
}
}
return 1;
}