SA-MP Forums Archive
How to make player goto jail on spawn - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make player goto jail on spawn (/showthread.php?tid=133210)



How to make player goto jail on spawn - Torran - 11.03.2010

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,


Re: How to make player goto jail on spawn - whitedragon - 11.03.2010

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



Re: How to make player goto jail on spawn - Flo_White - 11.03.2010

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


Re: How to make player goto jail on spawn - Torran - 11.03.2010

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


Re: How to make player goto jail on spawn - bajskorv123 - 11.03.2010

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?


Re: How to make player goto jail on spawn - Rzzr - 11.03.2010

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


Re: How to make player goto jail on spawn - Torran - 11.03.2010

Ive tried that but it seems to ignore it..


Re: How to make player goto jail on spawn - Rzzr - 11.03.2010

Maybe make the timer longer?


Re: How to make player goto jail on spawn - Flo_White - 12.03.2010

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