PDA

View Full Version : Random spawn


26_RUSSS
13/11/2011, 01:29 PM
help do so that in jail planted to different cells.
here is the code jail

public jailtimer()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pJailed] > 0)
{
if(PlayerInfo[i][pJailTime] > 0)
{
PlayerInfo[i][pJailTime]--;
}
if(PlayerInfo[i][pJailTime] <= 0)
{
PlayerInfo[i][pJailTime] = 0;
PlayerInfo[i][pJailed] = 0;
SetPlayerInterior(i, 0);
SetPlayerPos(i, -1613.9003,716.2488,13.4963);
}
}
}
return 1;
}

Kostas'
13/11/2011, 01:34 PM
I didn't test it

public jailtimer()
{
for(new i = 0; i < MAX_PLAYERS; i++) {
if(PlayerInfo[i][pJailed] > 0) {
if(PlayerInfo[i][pJailTime] > 0) {
PlayerInfo[i][pJailTime]--;
}
if(PlayerInfo[i][pJailTime] <= 0) {
PlayerInfo[i][pJailTime] = 0;
PlayerInfo[i][pJailed] = 0;
switch(random(2)) {
case 0:
{
SetPlayerInterior(i, 0);
SetPlayerPos(i, -1613.9003,716.2488,13.4963);
return 1;
}
case 1:
{
SetPlayerInterior(i, 0);
SetPlayerPos(i, X, Y, Z);
return 1;
}
}
}
}
}
return 1;
}