Problem with death and OnPlayerRequestClass
#1

Hi. If I press F4 and die in the vehicle (I use SetPlayerHealth (playerid, 0.0) there is a call of OnPlayerRequestClass occurs, even without the animation of death. I show it on new.pwn.
Код:
#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	AddStaticVehicle(411, 2977.9031,1295.5956,18.2517,259.4196, 1, 1);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 2977.9031,1295.5956,18.2517);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/tp", cmdtext, true, 3) == 0)
	{
		SetPlayerPos(playerid, 2977.9031,1295.5956,18.2517);
		return 1;
	}
	if (strcmp("/kill", cmdtext, true, 5) == 0)
	{
		SetPlayerHealth(playerid, 0.0);
		return 1;
	}
	return 0;
}
Video: https://www.youtube.com/watch?v=2PkV...ature=*********
Reply
#2

so what is the problem? not showing the dying animation?
Reply
#3

Yes, because of this bug after the spawn of the player there is an even stranger bug
Reply
#4

F4 forces you to Character Selection on the next death, as it says on the screen when you press F4...

You die, you'll be requesting a class... Hence why it's request class, as you are selecting your character again.


What is the issue?
Reply
#5

Why does not show the death animation?
Reply
#6

You first requested while pressing 'F4' class selection after death, am i correct?
then you typed command /kill and it opt you a class selection (<) (>) (spawn) after death
and you are wondering why didn't the script play's such an animation?
Reply
#7

Quote:
Originally Posted by FelixAquero
Посмотреть сообщение
Why does not show the death animation?
Because even when it's pressed in normal state, it doesn't show the animation as it puts you in the class selection instantly.

This is something people were abusing at one point where they'd press F4, die, and not be back where they were to be put out of the death state for medics/execution on RP servers.

If you're looking at doing a death animation, with the EMS save situation, or anything like that you could check in OnPlayerRequestClass whether they did this, and simply respawn them, throw them back to where they were and set their health to 0 again.

Something anyway, I'd simply put a message up, count each time they do it and make it a 3 strike rule, and just jail them.
Reply
#8

How to fix this? On the server on which I play does not have this problem
Reply
#9

When spawning via OnPlayerRequestClass, the following occurs: https://*********/QTtDlrDPsio
Reply
#10

Actually, you're missing most of new.pwn... That's highly likely as to why this is the case.

Some of those callbacks that you're simply 'removing' still need to be in the gamemode in many cases.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)