Not much to show. I have defined two points that create a large box in a map. Within this box, I wish to spawn things 50 units above the ground. Here's how I'm getting my points (this works):
PHP Code:
FindPointAboveGround(Float:Origin[3])
{
static Float:Start[3]
static Float:End[3]
do
{
Start[0]=random_float(X1,X2)
Start[1]=random_float(Y1,Y2)
Start[2]=random_float(Z1,Z2)
End[0]=Start[0]
End[1]=Start[1]
End[2]=(Start[2]-5000.0)
trace_line(0,Start,End,Origin)
}while(Origin[2]<-5000.0)
Origin[2]+=50.0
}
But I don't know if this is necessarily a "good way" to do it, by assigning an arbitrarily huge number to trace down to, or if there's another way to make it just trace until it hits the ground.
The Origin[2]<-5000.0 condition is what I check against to see if my random start point was created inside of a wall, in which case it traces through the map to the huge number below, and I do it again.
__________________