death and hospital
#1

Hi all,i need to do a thing..

If player dead will be teleported on the hospital of SF

How?
Reply
#2

Код:
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
Reply
#3

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
pawn Код:
OnPlayerDeath
3. OnPlayerDeath type SetPlayerPos(playerid,X,Y,Z); < X,Y,Z = Position of Hospital in San Fierro.
Reply
#4

Thanks alot
Reply
#5

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)