new bool:isDeath[MAX_PLAYERS] = false;
new Float:x, Float:y, Float:z;
new whereSpawned[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(isDeath[playerid])
isDeath[playerid] = false;
switch(whereSpawned[playerid]){
case 0: {
SetPlayerPos(playerid,-2655.0598, 640.1436, 14.4545);//SF nemocnice
}
case 1: {
SetPlayerPos(playerid,1604.6643, 1815.2538, 10.8203);//LV nemocnice
}
case 2: {
SetPlayerPos(playerid,-1513.4323, 2518.9666, 56.0703);//El Quebrados Medical Centre
}
case 3: {
SetPlayerPos(playerid,2034.3083, -1401.6720, 17.2961);//County General Los Santos Hospital
}
case 4: {
SetPlayerPos(playerid,1172.0804, -1325.2925, 15.4073);//All Saints General Hospital
}
case 5: {
SetPlayerPos(playerid,-319.7292, 1048.2355, 20.3403);//Fort Carson Medical Center
}
case 6: {
SetPlayerPos(playerid,-2203.9302, -2309.3950, 31.3750);//Angel Pine Medical Center
}
}
}
public OnPlayerDeath(playerid)
{
isDeath[playerid] = true; {
new Distance = GetPlayerDistanceFromPoint(playerid, x, y, z); // ??? Nevím
}
Dotaz
Monael 0
Potřebuji vymyslet jak udělat při smrti respawn u nejbližší nemocnice, bohužel nevím jak porovnat všechny souřadnice a zjistit u které jsem nejblíže.
Vím, že musím použít něco GetPlayerDistanceFromPoint https://open.mp/docs/scripting/functions/GetPlayerDistanceFromPoint
Z tohodle to nevyčtu https://pawno.cz/index.php?/topic/54885-po-smrti-spawn-u-nemocnice/#comment-335040
Co mám za kód:
new bool:isDeath[MAX_PLAYERS] = false;
new Float:x, Float:y, Float:z;
new whereSpawned[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(isDeath[playerid])
isDeath[playerid] = false;
switch(whereSpawned[playerid]){
case 0: {
SetPlayerPos(playerid,-2655.0598, 640.1436, 14.4545);//SF nemocnice
}
case 1: {
SetPlayerPos(playerid,1604.6643, 1815.2538, 10.8203);//LV nemocnice
}
case 2: {
SetPlayerPos(playerid,-1513.4323, 2518.9666, 56.0703);//El Quebrados Medical Centre
}
case 3: {
SetPlayerPos(playerid,2034.3083, -1401.6720, 17.2961);//County General Los Santos Hospital
}
case 4: {
SetPlayerPos(playerid,1172.0804, -1325.2925, 15.4073);//All Saints General Hospital
}
case 5: {
SetPlayerPos(playerid,-319.7292, 1048.2355, 20.3403);//Fort Carson Medical Center
}
case 6: {
SetPlayerPos(playerid,-2203.9302, -2309.3950, 31.3750);//Angel Pine Medical Center
}
}
}
public OnPlayerDeath(playerid)
{
isDeath[playerid] = true; {
new Distance = GetPlayerDistanceFromPoint(playerid, x, y, z); // ??? Nevím
}
}
Ps. Jsem uplný začátečník
Link to comment
Share on other sites
6 odpovědí na tuto otázku
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now