Jump to content
  • 0

pomoc Po smrti spawn u nemocnice


jirka 16

Dotaz

Popis problému:

Mohl by mi prosím někdo poradit jak udělat spawn u nemocnice když zemře hráč a potom ještě jak nastavit která nemocnice je nejbližší ,jestli v LV , v LS nebo v SF

prvně jsem to zkoušel přes OnPlayerDeath ,ale to byl nesmysl ,a ptom jsem to zkoušel přes OnPlayerSpawn ,ale to netuším jak dál ...

 

Chyby/varování kompilátoru a při běhu:

--

 

Kód:

 

--

 

 

 

Dodatečné poznámky:

--

Link to comment
Share on other sites

8 odpovědí na tuto otázku

Recommended Posts

  • 0

new bool:isDeath[MAX_PLAYERS] = false;
new whereSpawned[MAX_PLAYERS];

OnPlayerDeath(playerid)
isDeath[playerid] = true;
ziskaš pozíciu ... a najdeš nemocnicu 
 

toto použí na určenie vzdialenosti od nemocnice 

stock GetDistance( Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2 )
{
return floatround( floatsqroot( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) + ( ( z1 - z2 ) * ( z1 - z2 ) ) ) ) );
}

niekde by si mal mať zadefinované všetký nemocince následne skontrolovať všetký nemocince a tá ktorú ma najmenšiu distance 
uložiť do whereSpawned[playerid] = X;

a do OnPlayerSpawn

if(isDeadth[playerid])
isDeath[playerid] = false;
switch(whereSpawned[playerid]){
    case 0: {
    // NEMOCNICA SF
   }
..... pokračuj dalej :)

}

spatlal som to na to aby si si zobral príklad ne aby si kopíroval

Link to comment
Share on other sites

  • 0

// Hospitals //
SetPlayerMapIcon(playerid, 10, 1604.6643, 1815.2538, 10.8203, 22, 0, MAPICON_LOCAL);//Las Venturas Hospital
SetPlayerMapIcon(playerid, 11, -1513.4323, 2518.9666, 56.0703, 22, 0, MAPICON_LOCAL);//El Quebrados Medical Centre
SetPlayerMapIcon(playerid, 12, 2034.3083, -1401.6720, 17.2961, 22, 0, MAPICON_LOCAL);//County General Los Santos Hospital
SetPlayerMapIcon(playerid, 13, 1172.0804, -1325.2925, 15.4073, 22, 0, MAPICON_LOCAL);//All Saints General Hospital
SetPlayerMapIcon(playerid, 14, -319.7292, 1048.2355, 20.3403, 22, 0, MAPICON_LOCAL);//Fort Carson Medical Center
SetPlayerMapIcon(playerid, 15, -2655.0598, 640.1436, 14.4545, 22, 0, MAPICON_LOCAL);//San Fierro Medical Centrum
SetPlayerMapIcon(playerid, 16, -2203.9302, -2309.3950, 31.3750, 22, 0,MAPICON_LOCAL);//Angel Pine Medical Center

 

Stačí do googlu: samp all hospitals

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...