respawn at the place you died [HELP] -
ClavoC - 19.07.2012
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!
Re: respawn at the place you died [HELP] -
Andregood - 19.07.2012
GetPlayerPos.
SetPlayerPos
ApplyAnimation.
Toggleplayercontrollable.
Re: respawn at the place you died [HELP] -
ClavoC - 19.07.2012
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?
Re: respawn at the place you died [HELP] -
Andregood - 19.07.2012
Try doing it yourself, if you fail, give me the code and I'll assist you.
Re: respawn at the place you died [HELP] -
ClavoC - 19.07.2012
That's kindful of you, well, the codes you've placed up here, where do I have to put them? OnPlayerDeath?
Re: respawn at the place you died [HELP] -
EV007 - 19.07.2012
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.
Re: respawn at the place you died [HELP] -
ClavoC - 19.07.2012
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.....
Re: respawn at the place you died [HELP] -
EV007 - 19.07.2012
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;
Re: respawn at the place you died [HELP] -
ClavoC - 19.07.2012
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
Re: respawn at the place you died [HELP] -
EV007 - 19.07.2012
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