respawn at the place you died [HELP]
#1

So,

I'm a new scripter, not a professional but I surely know the basics already of a few things!
I'm currently using the LA:RP script 0.3e as we speak.

The thing what I'm trying to do is:

Whenever a player gets killed, he RESPAWNS at the location he got killed, frozen, and with a nice /fall animation.

He has the possibility to do /deathaccept and he would respawn at the ASGH.

Could someone tell me how to inplent this into my LA:RP script? Please if you do, explain me where and what to put into my script with the "//" function... Explaining where to define or place something!
Reply
#2

GetPlayerPos.
SetPlayerPos
ApplyAnimation.
Toggleplayercontrollable.
Reply
#3

Well I wouldn't understand it like that, could you please code it for me, like explaining me what where and how, with full details?
Reply
#4

Try doing it yourself, if you fail, give me the code and I'll assist you.
Reply
#5

That's kindful of you, well, the codes you've placed up here, where do I have to put them? OnPlayerDeath?
Reply
#6

Ontop of your gamemodeinit write this:

Код:
new Float:PosX[MAX_PLAYERS];
new Float:PosY[MAX_PLAYERS];
new Float:PosZ[MAX_PLAYERS];
new csaved[MAX_PLAYERS];
Onplayerdeath callback type this:
Код:
GetPlayerPos(playerid,PosX[playerid],PosY[playerid],PosZ[playerid]);
csaved[playerid] = 1;
Onplayerspawn:
Код:
if(csaved[playerid] == 1)
{
csaved[playerid] == 0;
SetPlayerPos(playerid,PosX[playerid],PosY[playerid],PosZ[playerid]);
}
EDIT: I might be doing this wrong, let me know after you test it.
Reply
#7

Eh, I inplented into my LARP script and I recieved this warning:


"gamemodes\larp.pwn(4669) : warning 215: expression has no effect"

Therefor, I'm not spawning at the place I died, at all.....
Reply
#8

Where does the error point to?

Try this:

onplayerdeath:

Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
PosX[playerid]=x;
PosY[playerid]=y;
PosZ[playerid]=z;
Reply
#9

The error points to:

csaved[playerid] == 0;

Do I have to remove the old functions under OnPlayerDeath which you posted be fore? or just inplend these new ones, I inplented these new ones you just posted with your reply and still doesn't work, I keep respawning at my spawn point, or faction spawn
Reply
#10

replace the csaved[playerid] == 0; with:

csaved[playerid] = 0;

you have to replace the code with my new one, but you can try both ways. I believe second way is much better
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)