Random house coordinates
#1

Hi all, maybe you know, how I can get from the all my server houses one random house? My houses system is Dynamic, so I know, that it's possible.

HTML Code:
new house = random(MAX_HOUSES);
	            						
SetPlayerCheckpointEx(playerid, PIZZA_DELIVERY_CHECKPOINT, HouseInfo[house][ExitX], HouseInfo[house][ExitY], HouseInfo[house][ExitZ], 3.0);
This is my code, but checkpoint is going to the 0.0, 0.0, 0.0 coordinates.
Reply
#2

You don't occupy all house "slots" then.
Reply
#3

How to do that?
Reply
#4

did you load the values from your files and stored it in the variables? if not, the variables become with zeros.
Reply
#5

Quote:
Originally Posted by Juvanii
View Post
did you load the values from your files and stored it in the variables? if not, the variables become with zeros.
Yes, the houses are loaded from mysql db
Reply
#6

Quote:
Originally Posted by rOps
View Post
Yes, the houses are loaded from mysql db
make a simple command to check if it has been loaded or not such as:
pawn Code:
CMD:test(playerid,params[])
{
    new string[50];
    format(string,sizeof(string),"%f ,%f ,%f", HouseInfo[house][ExitX],HouseInfo[house][ExitY],HouseInfo[house][ExitZ]);
    SendClientMessage(playerid,-1,string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)