Then add up the remainders: Var1X - Var1Y = Close1; Close1 - Var1Z = Close1; Var2X - Var2Y = Close2; Close2 - Var2Z = Close2; etc, etc, etc. |
Originally Posted by Zezombia
Theory:
Get all the cords of the hospitals, and save them in separate global variables: new H1X = 423.43, H1Y = 1353.56, H1Z = 3.23; new H2X = 1353.43, H2Y = 133.56, H2Z = 8.32; etc. Do that for all the hospitals. When a player dies, get his location, and do: X - H1X = Var1X; Y - H1Y = Var1Y; Z - H1Z = Var1Z; X - H2X = Var2Z; Y - H2Y = Var2Z; Z - H2Z = Var2Z; etc, etc, etc. Then add up the remainders: Var1X - Var1Y = Close1; Close1 - Var1Z = Close1; Var2X - Var2Y = Close2; Close2 - Var2Z = Close2; etc, etc, etc. What ever number is smaller: if(Close1 < Close2) return SetPlayerPos(playerid, H1X H1Y H1Z); else if(Close1 > Close2) return SetPlayerPos(playerid, H2X H2Y H2Z); etc, etc, etc. Yes, I know I'm making a lot of "new"s, but I'm not looking for quality, I'm looking for functionality, you can always change it :P. |
Originally Posted by Zezombia
new H1X = 423.43, H1Y = 1353.56, H1Z = 3.23;
new H2X = 1353.43, H2Y = 133.56, H2Z = 8.32; |
Originally Posted by Zezombia
new Float:H1X = 423.43, Float:H1Y = 1353.56, Float:H1Z = 3.23;
new Float:H2X = 1353.43, Float:H2Y = 133.56, Float:H2Z = 8.32; |
Originally Posted by XtremeChio
One thing. Why just not put the
SetPlayerPos(etc) at OnPlayerDeath ? You just put the coordinates and that's it..Or no ? |
Originally Posted by Rizard
@ Don Correlli,
I have the same problems if I create the H1X as not just a variable but a float.... the errors like 'tag mismatch' and 'lvalue (non constant) remain? Greetz Riz |
new H1X = 1614.6682, H1Y = 1818.1664, H1Z = 10.8203; //line 1761
new H2X = 1176.6060, H2Y = -1323.7875, H2Z = 14.0296; //line 1762
new Var1X, Var1Y, Var1Z, Var2X, Var2Y, Var2Z; //line 1763
new Close1, Close2; //line 1764
Xhosp - H1X = Var1X; Yhosp - H1Y = Var1Y; Zhosp - H1Z = Var1Z; //1774
Xhosp - H2X = Var2X; Yhosp - H2Y = Var2Y; Zhosp - H2Z = Var2Z; //1775
Var1X - Var1Y = Close1; Close1 - Var1Z = Close1; //1776
Var2X - Var2Y = Close2; Close2 - Var2Z = Close2; //1777
GetPlayerPos(playerid,Xhosp,Yhosp,Zhosp); //1976
C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1761) : warning 213: tag mismatch C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1761) : warning 213: tag mismatch C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1761) : warning 213: tag mismatch C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1762) : warning 213: tag mismatch C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1762) : warning 213: tag mismatch C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1762) : warning 213: tag mismatch C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1774) : error 022: must be lvalue (non-constant) C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1774) : warning 215: expression has no effect C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1774) : error 022: must be lvalue (non-constant) C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1774) : warning 215: expression has no effect C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1774) : error 022: must be lvalue (non-constant) C:\Users\Rien\Documents\Samp server 2\gamemodes\ronserver.pwn(1774) : fatal error 107: too many error messages on one line