How to make player goto jail on spawn
#1

How do i make it if playerinfo for player jail is 1 it sends him to jail,
I tried putting it in OnPlayerSpawn,
It sets my position and interior ect,
But my gamemode overides the interior so im just stook in sky,
How do i make it set the interior on the fs AFTER it has on the gamemode,
Reply
#2

Quote:
Originally Posted by Joe Torran C
How do i make it if playerinfo for player jail is 1 it sends him to jail,
I tried putting it in OnPlayerSpawn,
It sets my position and interior ect,
But my gamemode overides the interior so im just stook in sky,
How do i make it set the interior on the fs AFTER it has on the gamemode,
Try this:
pawn Код:
public SetPlayerSpawn(playerid)
{
        if(PlayerInfo[playerid][pJailed] == 1)
        {
          SetPlayerInterior(playerid, 6);
          PlayerInfo[playerid][pInt] = 6;
            SetPlayerPos(playerid,264.6288,77.5742,1001.0391);
            SendClientMessage(playerid, COLOR_LIGHTRED, "Back to prison.");
            return 1;
        }
}
Reply
#3

pawn Код:
if(PlayerInfo[playerid][yourvarforjailhere] == 1) {
SetPlayerPos(playerid,....);
SetPlayerInterior(playerid,...);
return 1;
}
this should work when you put it in OnPlayerSpawn
Reply
#4

As i said ive already done that, But my gamemode sets the interior to 0, Which leaves me frozen in the sky over sa,
Rather than in the jail interior, How do i make it set the interior ect AFTER it has on the gamemode
Reply
#5

Quote:
Originally Posted by Joe Torran C
As i said ive already done that, But my gamemode sets the interior to 0, Which leaves me frozen in the sky over sa,
Rather than in the jail interior, How do i make it set the interior ect AFTER it has on the gamemode
Timer?
Reply
#6

pawn Код:
//On top:
forward BackToJail(playerid);

//Onplayerspawn

if(PlayerInfo[playerid][jailvar] == 1)
{
SetTimer("BackToJail", 500, 0);
}

//Somewhere
public BackToJail(playerid)
{
SetPlayerPos(playerid, ......);
SetPlayerInterior(playerid, ...);
SendClientMessage(.....);
}
Somthing like that
Reply
#7

Ive tried that but it seems to ignore it..
Reply
#8

Maybe make the timer longer?
Reply
#9

Quote:
Originally Posted by Joe Torran C
Ive tried that but it seems to ignore it..
then you're doing it wrong
Both things should work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)