Seperate Jail Cells
#1

Ok, so I am coding a Cops and Robbers gamemode, and it's going really well.

I have made a jail command, and I know this can be done but I just don't know how. Basically I want to make it so when you have more than one person in jail, they can't see or interact with people. If I send two people to jail, they both are in the cell and can see each other.

On many servers I have played on, they can have multiple people in jail, and the cell appears to be the same but the jailed players see nobody else, as if they are in their own cell.
Reply
#2

Create a variable for each cell, for example Cell1. Then check if the cell is occupied, and if it is move on to checking Cell2.

https://sampwiki.blast.hk/wiki/Control_Structures
https://sampwiki.blast.hk/wiki/Scripting_Basics#Variables
Reply
#3

That was my original thought, but then I thought about it, and if I have 50 robbers on, I might not have enough cells.

---

I think you misunderstood me. I basically want to make every user go to the same cell, but for the users in the cell, make it appear as if they are the only one there. I know it can be done, I've seen it done in servers before.
Reply
#4

Quote:
Originally Posted by admiralspeedy
Посмотреть сообщение
That was my original thought, but then I thought about it, and if I have 50 robbers on, I might not have enough cells.

---

I think you misunderstood me. I basically want to make every user go to the same cell, but for the users in the cell, make it appear as if they are the only one there. I know it can be done, I've seen it done in servers before.
Use SetPlayerVirtualWorld
Reply
#5

create a random jail spawn with this Float:JailSpawn

pawn Код:
new Float:JailCellSpawns[][3] =
{
    {197.3941,162.4637,1003.0300},
    {194.3641,175.6378,1003.0234},
    {197.8117,174.2043,1003.0234}
};
Reply
#6

pawn Код:
SetPlayerVirtualWorld(playerid, random(999));
wherever you are teleporting the player to jail.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)