OnPlayerDeath - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerDeath (
/showthread.php?tid=89302)
OnPlayerDeath -
Jakku - 01.08.2009
I have some questions about OnPlayerDeath
If I SetPlayerPos under OnPlayerDeath, it just shows a picture from this place and player dies there, then it respawns to some different place. How I can make SetPlayerpos after player is dead and set his pos?
Re: OnPlayerDeath -
Andom - 01.08.2009
OnPlayerSpawn?
Re: OnPlayerDeath -
Geekzor - 01.08.2009
Quote:
Originally Posted by Jakku
I have some questions about OnPlayerDeath
If I SetPlayerPos under OnPlayerDeath, it just shows a picture from this place and player dies there, then it respawns to some different place. How I can make SetPlayerpos after player is dead and set his pos?
|
Joining the question - when player die he spawn at hospital how to do this ?
Re: OnPlayerDeath -
pagie1111 - 01.08.2009
Top of script
Код:
new Died[MAX_PLAYERS];
OnPlayerConnect
OnPlayerDeath
OnPlayerSpawn
Код:
if(Died[playerid] == 1)
{
SetPlayerInterior(playerid,0);//incase died in an interior
SetPlayerPos(playerid,/*Hospital Co-ord*/);
Died[playerid] = 0;
//anything else like medical bill goes here
return 1;
}
Re: OnPlayerDeath -
Jakku - 01.08.2009
Quote:
Originally Posted by pagie1111
Top of script
Код:
new Died[MAX_PLAYERS];
OnPlayerConnect
OnPlayerDeath
OnPlayerSpawn
Код:
if(Died[playerid] == 1)
{
SetPlayerInterior(playerid,0);//incase died in an interior
SetPlayerPos(playerid,/*Hospital Co-ord*/);
Died[playerid] = 0;
//anything else like medical bill goes here
return 1;
}
|
Oh yeah, thanks. I though onplayerspawn only works when player comes and selects the skin
Re: OnPlayerDeath -
PKRanger - 01.08.2009
No offense, but its better to use as less vars/functions as posible..
why dont you check if the players health is 0 ? (0 equals to death..)
Re: OnPlayerDeath -
Jakku - 02.08.2009
Quote:
Originally Posted by Geekzor
Quote:
Originally Posted by Jakku
I have some questions about OnPlayerDeath
If I SetPlayerPos under OnPlayerDeath, it just shows a picture from this place and player dies there, then it respawns to some different place. How I can make SetPlayerpos after player is dead and set his pos?
|
Joining the question - when player die he spawn at hospital how to do this ?
|
Yes
Re: OnPlayerDeath -
Woet - 02.08.2009
Quote:
Originally Posted by PKRanger
No offense, but its better to use as less vars/functions as posible..
why dont you check if the players health is 0 ? (0 equals to death..)
|
Because their health won't be 0 when they spawn, and he's checking whether they died at that point.