HELP ME - 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: HELP ME (
/showthread.php?tid=618033)
HELP ME -
Jmrz96 - 30.09.2016
Good, I would like to a collaboration in an error that I have in my server. Use the gamemode South Central and it has an error at the time that one falls wounded teleports him to another place not to the death
Re: HELP ME -
Tass007 - 30.09.2016
Have you tried adding the 'teleporting' part of the script so that it's only called under onplayerdeath?
Re: HELP ME -
Jmrz96 - 30.09.2016
Really not is much of programming, by that Samsung here
Re: HELP ME -
Tass007 - 30.09.2016
I'm sorry I don't understand. Could you possibly show the code that teleports the player when the get hurt and how it is called?
Re: HELP ME -
Jmrz96 - 30.09.2016
What happens is that when a player falls wounded, not the place where it fell wounded is going to another place. There is where is the error must be in the place where it fell wounded.
Re: HELP ME -
GoldenLion - 30.09.2016
You just need to add two lines which set the player's position and the angle when player spawns in injured state as the position and angle of the player gets saved when the player dies.
Like this:
Код:
SetPlayerPos(playerid, PlayerData[playerid][pPos][0], PlayerData[playerid][pPos][1], PlayerData[playerid][pPos][2]);
SetPlayerFacingAngle(playerid, PlayerData[playerid][pPos][3]);
So you add them here under OnPlayerSpawn to this part:
Код:
if (PlayerData[playerid][pInjured])
{
SetPlayerPos(playerid, PlayerData[playerid][pPos][0], PlayerData[playerid][pPos][1], PlayerData[playerid][pPos][2]);
SetPlayerFacingAngle(playerid, PlayerData[playerid][pPos][3]);
ShowHungerTextdraw(playerid, 0);
TextDrawShowForPlayer(playerid, gServerTextdraws[2]);
SendClientMessage(playerid, COLOR_LIGHTRED, "[WARNING]:{FFFFFF} You are injured and require medical attention (/call 911).");
ApplyAnimation(playerid, "CRACK", "null", 4.0, 0, 0, 0, 1, 0, 1);
ApplyAnimation(playerid, "CRACK", "crckdeth4", 4.0, 0, 0, 0, 1, 0, 1);
}
Re: HELP ME -
Jmrz96 - 01.10.2016
Sorry, but I returned to an old position of 3 or 5 seconds when one falls wounded.
It works sometimes