death and hospital - 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: death and hospital (
/showthread.php?tid=177829)
death and hospital -
Face9000 - 19.09.2010
Hi all,i need to do a thing..
If player dead will be teleported on the hospital of SF
How?
Re: death and hospital -
Camacorn - 19.09.2010
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
SendClientMessage(playerid, coloridhere, "You Have Died, And Have Been Taken To The Hospital!");
SetPlayerPos(playerid, X,Y,Z);
SetPlayerVirtualWorld(playerid, IDHERE);
return 1;
}
Change The Coords
Код:
SetPlayerPos(playerid, X,Y,Z);
To The Hospital Interior Coords, If You Have It In A Different Virtual World , Then Change
Код:
SetPlayerVirtualWorld(playerid, IDHERE);
To Whatever VW You Have It In.
If its not in an interior then remove:
Код:
SetPlayerVirtualWorld(playerid, IDHERE);
Make sure you change the 'coloridhere' to whatever color you want it to be, or just remove this line for no message:
Код:
SendClientMessage(playerid, coloridhere, "You Have Died, And Have Been Taken To The Hospital!");
Hope this helps
Re: death and hospital -
Matej_ - 19.09.2010
Quote:
Originally Posted by Logitech90
Hi all,i need to do a thing..
If player dead will be teleported on the hospital of SF
How?
|
1. Get Position of Hospital in San Fierro.
2. Go on
3. OnPlayerDeath type SetPlayerPos(playerid,X,Y,Z); < X,Y,Z = Position of Hospital in San Fierro.
Re: death and hospital -
Face9000 - 19.09.2010
Thanks alot
Re: death and hospital -
Seven. - 19.09.2010
pawn Код:
new JustDied[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(JustDied[playerid] == 1) { SetPlayerPos(playerid, X,Y,Z);/*hospital pos*/ JustDied[playerid] = 0; }
return 1;
}
public OnPlayerDeath(playerid,killerid,reason)
{
JustDied[playerid] = 1;
return 1;
}