Respawn Help
#1

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.
Reply
#2

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.
}
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)