Distance calculation
#1

Hey everybody! Does someone know how would I create some distance calculations in my code. For example, there is hospital in los santos and in san fierro, I'm standing little bit closer to los santos, and when I die ( just for example ), I will spawn in hospital which is closer to me. Thank you for your support, I appreciate it.
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerDistanceFromPoint ****** man... ******... Under OnPlayerDeath add some if's comparing the 2 distances. If closer to the 1st building, give a value to a variable, if closest to the other, another value to the same variable like closest[playerid]=1 or 2 depending to which building you died more closely. Then under OnPlayerSpawn you use this variable with 2 if's to say where to spawn.
Reply
#3

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)