Put player in jail when he was killed by a policeman - 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: Put player in jail when he was killed by a policeman (
/showthread.php?tid=654987)
Put player in jail when he was killed by a policeman -
GoDylan - 10.06.2018
Hi!
I have been looking for a long time how to spawn a player in prison when he was killed by a policeman, but I can not do it, here is my code:
in OnPlayerDeath :
if(GetPlayerWantedLevel(playerid) >= 1)
{
if(gTeam[killerid] == TEAM_POLICIER)
{
PlayerIsInJail[playerid] = 1;
}
}
in OnPlayerSpawn :
if(PlayerIsInJail[playerid] == 1)
{
SetPlayerPos(playerid, 197.39999389648, 173.39999389648, 1003);
SetPlayerFacingAngle(playerid, 0);
SetPlayerInterior(playerid, 3);
SetCameraBehindPlayer(playerid);
return 1;
}
Thanks in advance to help me, thanks !