SA-MP Forums Archive
Seperate Jail Cells - 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: Seperate Jail Cells (/showthread.php?tid=362882)



Seperate Jail Cells - admiralspeedy - 25.07.2012

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.


Re: Seperate Jail Cells - linuxthefish - 25.07.2012

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


Re: Seperate Jail Cells - admiralspeedy - 25.07.2012

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.


Re: Seperate Jail Cells - SnG.Scot_MisCuDI - 26.07.2012

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


Re: Seperate Jail Cells - Devilxz97 - 26.07.2012

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}
};



Re: Seperate Jail Cells - ReneG - 26.07.2012

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