Jump to content
  • 0

pomoc Smrt


Mr.hustoch

Dotaz

Zdravím,jak se dá udělat kod že když hráč umře objeví se u nemocnice (prosím bez použítí inc) Vím že to je něco s OnPlayerDead ale dál si nevím rady když dám OnPlayerDead setplayerpos tak to změní pozice mrtvoli hráče a ta se potom stejně objeví na spawnu......

Link to comment
Share on other sites

8 odpovědí na tuto otázku

Recommended Posts

  • 0
public OnPlayerDeath(playerid, killerid, reason)
{
  SetPlayerPos(playerid,1176.6060,-1323.7875,14.0296);
    return 1;
}

Zkus to, nezkoušel jsem to, ale mělo by to fungovat

Link to comment
Share on other sites

  • 0
public OnPlayerDeath(playerid, killerid, reason)
{
  SetPlayerPos(playerid,1176.6060,-1323.7875,14.0296);
    return 1;
}

Zkus to, nezkoušel jsem to, ale mělo by to fungovat

 

 

Ak by si čítal Ďalej tak tam napísal že to robil :d 

 

hore:

 

new bool:smrt[MAX_PLAYERS];

 

do death:

 

 

smrt[playerid] = true;

do spawn:

 

 

if(smrt[playerid])
{
SetPlayerPos(playerid, X, Y, Z);
smrt[playerid] = false;
}
Link to comment
Share on other sites

  • 0

Proč OnPlayerDeath? To je callbac, který probíhá, když je mrtvý...

 

public
	OnPlayerSpawn(playerid)
{
	SetPlayerPos(playerid....);
	return 1;
}
Taky můžeš zkusit to nastavit lehce přes SetSpawnInfo.

 

 

Ale v prvom rade si musíš zistiť či ten hráč zomrel alebo ho spawnuje preto že sa pripojil alebo ho respawnuješ napríklad, cez SetSpawnInfo by to možno tiež išlo, to neviem, s tou funkciou som nerobil

Link to comment
Share on other sites

  • 0

Ok,ten kod od Nephalem nafunguje,Karolínka nedala bys mi sem ten kod pomocí spawninfo? 

 

tak skús upraviť podmienku na if(smrt[playerid] == true)

P.S.: musíš mať tú podmienku ako prvú v OnPlayerSpawn

Link to comment
Share on other sites

  • 0

Do OnPlayerDeath

SetPVarInt(playerid,"Death",1);

Do OnPlayerSpawn:

if(GetPVarInt(playerid,"Death") == 1)
{
      SetPlayerPos(playerid,X,Y,Z);
      SetPVarInt(playerid,"Death",0);
}

X,Y,Z si doplň

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...