[ HELP ] Problem with the Player Death.
#1

Hi,
I have problem with player death. when i type /kill my player get die its ok and then where he died. he spawn there where i typed /kill.
Here and are pictures and codess

when i was type /kill:



And then my player died:


and next he spawned at the same place where he died.


You can also see the timer at down.

Codes:
Код:
	if(strcmp(cmd, "/kill", true) == 0)
	{
		
		return SetPlayerHealth(playerid,0.0);
	}
and on player spawn
Код:
public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, Textdraw2);
   	TextDrawHideForPlayer(playerid, Textdraw4);
	TextDrawHideForPlayer(playerid, Textdraw5);
	TextDrawHideForPlayer(playerid, Textdraw6);
	TextDrawHideForPlayer(playerid, Textdraw7);
	TextDrawHideForPlayer(playerid, Textdraw8);
	TextDrawShowForPlayer(playerid, Timer);
	SetPlayerRaceCheckpoint(playerid, 0,-2264.8501,2312.7566,4.5473,-2271.4414,2351.0659,4.4289,10);
	Stats[playerid] = 1;
	SetPlayerColor(playerid, COLOR_YELLOW);
	SetPlayerTime(playerid,12,0);
	SetPlayerInterior(playerid,0);
	SetCameraBehindPlayer(playerid);
	SendClientMessage(playerid,0xFF0000FF,"{FF0000}» Usage: {FFFFFF}/re to repair your vehicle!");
	SendClientMessageToAll(-1,"{000DFF}» Serv: {0080FF}This Mission has been created by SpikY_ | On 10/6/2015 | Mission Name: The Marathon Race!");
	SetPlayerPos(playerid,-2263.6921,2284.1008,4.8202);
	SetPlayerHealth(playerid,100);
	SetPlayerArmour(playerid,0);
	PutPlayerInVehicle(playerid, car[playerid], 0);
	if(Free == 0)
	{
	TogglePlayerControllable(playerid, 0);
	}
	else if(Free == 1)
 	{
 	TogglePlayerControllable(playerid, 1);
 	}
	return 1;
}
please help me. Thank you
Reply
#2

BUMP.
Anyone please?
Reply
#3

It is because you are setting the player pos to this position...
Quote:
Originally Posted by NGEN123
Посмотреть сообщение
SetPlayerPos(playerid,-2263.6921,2284.1008,4.8202);
Reply
#4

should i remove it?
Reply
#5

ok. i tried to remove it but the problem is still there.
Reply
#6

This: PutPlayerInVehicle(playerid, car[playerid], 0);

Here you are, fixed:

Код:
public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, Textdraw2);
   	TextDrawHideForPlayer(playerid, Textdraw4);
	TextDrawHideForPlayer(playerid, Textdraw5);
	TextDrawHideForPlayer(playerid, Textdraw6);
	TextDrawHideForPlayer(playerid, Textdraw7);
	TextDrawHideForPlayer(playerid, Textdraw8);
	TextDrawShowForPlayer(playerid, Timer);
	SetPlayerRaceCheckpoint(playerid, 0,-2264.8501,2312.7566,4.5473,-2271.4414,2351.0659,4.4289,10);
	Stats[playerid] = 1;
	SetPlayerColor(playerid, COLOR_YELLOW);
	SetPlayerTime(playerid,12,0);
	SetPlayerInterior(playerid,0);
	SetCameraBehindPlayer(playerid);
	SendClientMessage(playerid,0xFF0000FF,"{FF0000}» Usage: {FFFFFF}/re to repair your vehicle!");
	SendClientMessageToAll(-1,"{000DFF}» Serv: {0080FF}This Mission has been created by SpikY_ | On 10/6/2015 | Mission Name: The Marathon Race!");
	SetPlayerHealth(playerid,100);
	SetPlayerArmour(playerid,0);
	if(Free == 0)
	{
	TogglePlayerControllable(playerid, 0);
	}
	else if(Free == 1)
 	{
 	TogglePlayerControllable(playerid, 1);
 	}
	return 1;
}
Reply
#7

You know what. there are many vehicle which are added in a row. its a race type mission.
onplayerspawn. they should be get into vehicle automatically. if i remove " PutPlayerInVehicle(playerid, car[playerid], 0); " then player will spawn at some other place.

Still its not fixed yet.
Anyone else please. :'[
Reply
#8

Now i can't understand you..
You want delete the saving position in OnPlayerSpawn. It's impossible, because in this callback you have PutPlayeInVehicle function, which auto teleporting the player to the vehicle. What you want to do?
Reply
#9

I want to get the player at spawn again. you can see the 3rd picture. i want the player to get on those bmx automatically if they dieds.
and want to delete the vehicle which he left before dieing.
Reply
#10

do you mean this?
pawn Код:
PutPlayerInVehicle(playerid, car[playerid], 0);
DestroyVehicle(playerid, car[playerid]);
they are under OnPlayerSpawn
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)