Help cells.
#1

So i am making a /arrest command and i have jail and 25 cells. I have coordinates of every cell and now i want when i type /arrest it puts them in a RANDOM cell.
I have the command all i need is to put playeer in a RANDOM cell.
Thanks.
Reply
#2

I First think this should be about cells, bits and binary. But it's about jailing, arrest, etc.

..

Make an array of jail cell spawn points, use random() to get a random position.
Reply
#3

Something like this:

PHP код:
new Float:RandomCell[][] = 
{
    {
xyzrotation}, // Cell 1
    
{xyzrotation}, // Cell 2
    
{xyzrotation}, // Cell 3
    
{xyzrotation}, // Cell 4
    
{xyzrotation}, // Cell 5
    
{xyzrotation}, // Cell 6
    
{xyzrotation}, // Cell 7
    
{xyzrotation}, // Cell 8
    
{xyzrotation}, // Cell 9
    
{xyzrotation// Cell 10
    
{xyzrotation}, // Cell 11
    
{xyzrotation}, // Cell 12
    
{xyzrotation}, // Cell 13
    
{xyzrotation}, // Cell 14
    
{xyzrotation}, // Cell 15
    
{xyzrotation}, // Cell 16
    
{xyzrotation}, // Cell 17
    
{xyzrotation}, // Cell 18
    
{xyzrotation}, // Cell 19
    
{xyzrotation// Cell 20
    
{xyzrotation// Cell 21
    
{xyzrotation// Cell 22
    
{xyzrotation// Cell 23
    
{xyzrotation// Cell 24
    
{xyzrotation// Cell 25
}; 
Then put the code which is below in either the stock Arrest or the Arrest system, However you have done it.

PHP код:
    new Random random(sizeof(RandomCell));
    
SetPlayerPos(playeridRandomCell[Random][0], RandomCell[Random][1], RandomCell[Random][2]);
    
SetPlayerFacingAngle(playeridRandomCell[Random][3]);
    return 
1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)