SA-MP Forums Archive
Respawn Help - 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: Respawn Help (/showthread.php?tid=365581)



Respawn Help - W0rm - 03.08.2012

Hello everyone. I've got a little problem. When i kill a wanted person, he always respawn with 0 HP. so it's like respawning in jail forever. this are the codes:
Код:
if(WantedLevel[playerid] > 0)
	{
	    if(IsACop(killerid))
	    {
	        if(WantedLevel[playerid] == 1)
	        {
		        ResetPlayerWeapons(playerid);
				PlayerInfo[playerid][pJailed] = 1;
                PlayerInfo[playerid][pJailTime] = 600;
				if(PlayerInfo[playerid][pDonateRank] >= 1)
					    {
					        SetPlayerInterior(playerid, 6 );
    				        SetPlayerPos(playerid, 219.44728088379,69.380714416504,1005.0390625);
					        return 1;
					    }
					    else
						 {
					    SetPlayerInterior(playerid, 10 );
    				    new rand = random(sizeof(gTurma));
    				    SetPlayerVirtualWorld(playerid, 0);
						SetPlayerPos(playerid, gTurma[rand][0], gTurma[rand][1], gTurma[rand][2]);
						 }
				SendClientMessage(playerid,COLOR_RED," blablabla!");
				SendClientMessage(killerid,COLOR_LIGHTBLUE," blablabla");
And if you please make a reward for the guy/cop that kills a wanted person.

Thanks in advance. Hope someone will help me.


Re: Respawn Help - Sascha - 03.08.2012

you shouldn't teleport the player at the "OnPlayerDeath" callback... better use just set the PlayerInfo[playerid][pJailed] variable to one and then OnPlayerSpawn:
pawn Код:
if(PlayerInfo[playerid][pJailed] == 1)
{
//teleport code, etc.
}



Re: Respawn Help - W0rm - 03.08.2012

can you please explain like for a noob. i just didnt get it :/ what to remove and where to put OnPlayerSpawn?