help ID Bug
#1

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 ?


PHP код:
Checkpoint[1] = CreateDynamicCP(1541.5448,-1655.8884,13.55902.0, -1, -1, -150); 
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(stringsizeof(string), "Police Officer %s has arrested wanted suspect %s"PlayerInfo(playerid), PlayerInfo(ID));
                        
SendClientMessageToAll(COLOR_LIGHTBLUEstring);
                        
CNR_PrintString(string);
                        
format(stringsizeof(string), "[POLICE RADIO] Suspect %s has been sent to jail"PlayerInfo(ID));
                        
SendCopMessage(string);
                        
AccountInfo[ID][pJailTime] = 60 ;
                        
AccountInfo[ID][pJailed] = ;
                        
SetPlayerInterior(ID10);
                        new 
rnd random(sizeof(PrisonSpawn));
                        
SetPlayerPos(IDPrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
                        
SendClientMessage(IDCOLOR_GREY"**LOS SANTOS PRISON**");
                        
SendClientMessage(IDCOLOR_LIGHTBLUE"[PRISON] You have been sent to prison. You will be released soon.");
                        
TogglePlayerControllable(ID1);
                        
SetPlayerWantedLevel(ID0);
                          if(
IsPlayerAttachedObjectSlotUsed(IDi)) RemovePlayerAttachedObject(IDi);
                        
SetPlayerSpecialAction(IDSPECIAL_ACTION_NONE);
                        
AccountInfo[ID][pCuffed] = ;
                        
TextDrawHideForPlayer(playeridCF[playerid]);
                        
GivePlayerMoney(playerid6500);
                        
IncreaseScore(playerid1);
                        
TogglePlayerDynamicCP(IDCheckpoint[1], false);
                        
TogglePlayerDynamicCP(playeridCheckpoint[1], false);
                }
                return 
1;
            }
            if(
pwl == 5)
            {
                  if(
GetPlayerState(ID) == PLAYER_STATE_PASSENGER && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                        
format(stringsizeof(string), "Police Officer %s has arrested wanted suspect %s"PlayerInfo(playerid), PlayerInfo(ID));
                        
SendClientMessageToAll(COLOR_LIGHTBLUEstring);
                        
CNR_PrintString(string);
                        
format(stringsizeof(string), "[POLICE RADIO] Suspect %s has been sent to jail"PlayerInfo(ID));
                        
SendCopMessage(string);
                        
AccountInfo[ID][pJailTime] = 80 ;
                        
AccountInfo[ID][pJailed] = ;
                        
SetPlayerInterior(ID10);
                        new 
rnd random(sizeof(PrisonSpawn));
                        
SetPlayerPos(IDPrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
                        
SendClientMessage(IDCOLOR_GREY"**LOS SANTOS PRISON**");
                        
SendClientMessage(IDCOLOR_LIGHTBLUE"[PRISON] You have been sent to prison. You will be released soon.");
                        
TogglePlayerControllable(ID1);
                        
SetPlayerWantedLevel(ID0);
                          if(
IsPlayerAttachedObjectSlotUsed(IDi)) RemovePlayerAttachedObject(IDi);
                        
SetPlayerSpecialAction(IDSPECIAL_ACTION_NONE);
                        
AccountInfo[ID][pCuffed] = ;
                        
GivePlayerMoney(playerid7500);
                        
IncreaseScore(playerid1);
                        
TextDrawHideForPlayer(playeridCF[playerid]);
                        
TextDrawHideForPlayer(playeridPNotifications[playerid]);
                        
TogglePlayerDynamicCP(IDCheckpoint[1], false);
                }
                return 
1;
           }
              if(
pwl == 6)
            {
                  if(
GetPlayerState(ID) == PLAYER_STATE_PASSENGER && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                        
format(stringsizeof(string), "Police Officer %s has arrested wanted suspect %s"PlayerInfo(playerid), PlayerInfo(ID));
                        
SendClientMessageToAll(COLOR_BLUEstring);
                        
CNR_PrintString(string);
                        
format(stringsizeof(string), "[POLICE RADIO] Suspect %s has been sent to jail"PlayerInfo(ID));
                        
SendCopMessage(string);
                        
AccountInfo[ID][pJailTime] = 100 ;
                        
AccountInfo[ID][pJailed] = ;
                        
SetPlayerInterior(ID10);
                        new 
rnd random(sizeof(PrisonSpawn));
                        
SetPlayerPos(IDPrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
                        
SendClientMessage(IDCOLOR_GREY"**LOS SANTOS PRISON**");
                        
SendClientMessage(IDCOLOR_LIGHTBLUE"[PRISON] You have been sent to prison. You will be released soon.");
                        
TogglePlayerControllable(ID1);
                        
SetPlayerWantedLevel(ID0);
                          if(
IsPlayerAttachedObjectSlotUsed(IDi)) RemovePlayerAttachedObject(IDi);
                        
SetPlayerSpecialAction(IDSPECIAL_ACTION_NONE);
                        
AccountInfo[ID][pCuffed] = ;
                        
GivePlayerMoney(playerid10000);
                        
IncreaseScore(playerid1);
                        
TogglePlayerDynamicCP(IDCheckpoint[1], false);
                        
TogglePlayerDynamicCP(playeridCheckpoint[1], false);
                }
                return 
1;
            }
        }
    return 
1;
    } 
Reply
#2

what about id 2 ?
Reply
#3

Quote:
Originally Posted by driftpower
Посмотреть сообщение
what about id 2 ?
same thing only i can do it if i am id 0 so it works only for id 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)