Jump to content
  • 0

pomoc Spawn


PetrDonát

Dotaz

Ahoj, hele mám takový problém, snažil jsme se udělat spawn u nejbližší nemocnice. To zahrnuje to, že když zemřeš spadneš se u nejbližší nemocni jak jste určitě pochopili :d. Asi se tam použije funkce IsPlayerInSphere a IsPlayerInRangeOfPoint. Děkuji za pomoc.

Link to comment
Share on other sites

17 odpovědí na tuto otázku

Recommended Posts

  • 0

Ano ale nwm jak na to :d

 

asi to trochu souvisí z:

IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
   new Float:X, Float:Y, Float:Z;

   GetPlayerPos(playerid, X, Y, Z);
   if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY) {
       return 1;
   }
   return 0;
}

Link to comment
Share on other sites

  • 0
if(IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY))

toto daj ako podmienku do OnPlayerDeath

no jo ale to by vlastně přesouval mrtvé tělo pač chvili trvá než se spawne

Link to comment
Share on other sites

  • 0

Vlastne by mal dať sem len podmienku, premennu a SetPlayerPos do OnPlayerSpawn lebo po Deathe sa vykoná Spawn takže by mu to blblo keby to je v OnPlayerDeath

 

 

rhs ani nie skús si to v praxi mne to ide v pohode nepresúva mrtve telo

Link to comment
Share on other sites

  • 0

Nie :d

do OnPlayerDeath:

 

if(IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY))

a potom premennu nastavis napriklad nemocnica = 1 ( uz je na tebe aku )

a potom do OnPlayerSpawn

if(nemocnica[playerid] == 1)

SetPlayerPos

Link to comment
Share on other sites

  • 0
Takže pokut to chápu tak do OnPlayerSpawn

 

if(IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY))

{

//sem všechny porty a ono si to vybere :d

}

if(IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY))
{
//port 1
} else if(IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY))
{
//prot 2
} atd......

Link to comment
Share on other sites

  • 0
Nie :d

do OnPlayerDeath:

 

if(IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY))

a potom premennu nastavis napriklad nemocnica = 1 ( uz je na tebe aku )

a potom do OnPlayerSpawn

if(nemocnica[playerid] == 1)

SetPlayerPos

 

 

Ano ale jak mám dát do if(IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)) víc proměnných, aby to zjišťovalo kam mě to má zrovna tet kopnout pls ?? :)

Link to comment
Share on other sites

  • 0
rhs nebude to fungovat .. SetPlayerPos treba dať do OnPlayerSpawn teraz som to písal

Premiestni ho to po smrti ale hned sa aj vykona Spawn takže mu to bude na nič ... testoval som to

vždyt jo ja sem nepsal že místo //port 1 musí bej t SetPlayerPos :d

Link to comment
Share on other sites

  • 0

nahoru

new PlayerDeathSpawn[MAX_PLAYERS];

stock IsPlayerInLS(playerid)
{
new Float:xls,Float:yls,Float:zls;
GetPlayerPos(playerid,xls,yls,zls);
if(xls > 0 && yls < 0) return 1;
return 0;
}

stock IsPlayerInSF(playerid)
{
new Float:xls,Float:yls,Float:zls;
GetPlayerPos(playerid,xls,yls,zls);
if(xls < 0) return 1;
return 0;
}

stock IsPlayerInLV(playerid)
{
new Float:xls,Float:yls,Float:zls;
GetPlayerPos(playerid,xls,yls,zls);
if(xls > 0 && yls > 0) return 1;
return 0;
}
#define spawn_LS 0
#define spawn_LV 1
#define spawn_SF 3

 

OnPlayerDeath

if(IsPlayerInLS(playerid)) PlayerDeathSpawn[playerid] = spawn_LS;
if(IsPlayerInLV(playerid)) PlayerDeathSpawn[playerid] = spawn_LV;
if(IsPlayerInSF(playerid)) PlayerDeathSpawn[playerid] = spawn_SF;

 

OnPlayerSpawn

switch(PlayerDeathSpawn[playerid]){
case spawn_LS: SetPlayerPos(playerid, souradnice LS);
case spawn_LV: SetPlayerPos(playerid, souradnice_LV);
default: SetPlayerPos(playerid, souradnice_SF);
}

 

jen tak pro predstavu, vylepsi, ja pouzivam SetSpawnInfo .. zalezi na tobe ;)

Link to comment
Share on other sites

  • 0
nahoru

new PlayerDeathSpawn[MAX_PLAYERS];

stock IsPlayerInLS(playerid)
{
new Float:xls,Float:yls,Float:zls;
GetPlayerPos(playerid,xls,yls,zls);
if(xls > 0 && yls < 0) return 1;
return 0;
}

stock IsPlayerInSF(playerid)
{
new Float:xls,Float:yls,Float:zls;
GetPlayerPos(playerid,xls,yls,zls);
if(xls < 0) return 1;
return 0;
}

stock IsPlayerInLV(playerid)
{
new Float:xls,Float:yls,Float:zls;
GetPlayerPos(playerid,xls,yls,zls);
if(xls > 0 && yls > 0) return 1;
return 0;
}
#define spawn_LS 0
#define spawn_LV 1
#define spawn_SF 3

 

OnPlayerDeath

if(IsPlayerInLS(playerid)) PlayerDeathSpawn[playerid] = spawn_LS;
if(IsPlayerInLV(playerid)) PlayerDeathSpawn[playerid] = spawn_LV;
if(IsPlayerInSF(playerid)) PlayerDeathSpawn[playerid] = spawn_SF;

 

OnPlayerSpawn

switch(PlayerDeathSpawn[playerid]){
case spawn_LS: SetPlayerPos(playerid, souradnice LS);
case spawn_LV: SetPlayerPos(playerid, souradnice_LV);
default: SetPlayerPos(playerid, souradnice_SF);
}

 

jen tak pro predstavu, vylepsi, ja pouzivam SetSpawnInfo .. zalezi na tobe ;)

 

 

ok dík funguje to

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...