Annoyed - confused - Befuzzled
#8

Quote:
Originally Posted by Schneider
Посмотреть сообщение
I just tested it with some random generated coordinates.and the function works good as it should...
Are you sure the house-coordinates are stored correctly and are you using the function correctly? Can you show us the command where you use this function?

Edit: This is the code I used to test it:

//Top of script:
pawn Код:
enum hinfo
{
    Float:EHouseX,
    Float:EHouseY,
    Float:EHouseZ
};
new Houses[90][hinfo];
//@ OnGameModeInit
pawn Код:
for(new i; i<90; i++)
{
    Houses[i][EHouseX] = (random(6000)-3000);
    Houses[i][EHouseY] = (random(6000)-3000);
    Houses[i][EHouseZ] = (random(30));
}
//@ OnPlayerConnect:
pawn Код:
for(new i; i<90; i++)
{
    SetPlayerMapIcon(playerid, i, Houses[i][EHouseX], Houses[i][EHouseY], Houses[i][EHouseZ], 31, 0, MAPICON_GLOBAL);
}
//Command:
pawn Код:
COMMAND:getnearesthouse(playerid, params[])
{
    new house = getClosestPizzaDelivery(playerid);
    if(house != -1)
    {
        SetPlayerCheckpoint(playerid, Houses[house][EHouseX], Houses[house][EHouseY], Houses[house][EHouseZ], 6.0);
    }
    return 1;
}
It works as it should, It shows a checkpoint at the nearest 'house'.

That's just selecting the closest house to your current location...
Also, My information saves via SQL, An selects all houses on loading an saves the info.;

How I need it = IT selects a random house >> GREATER than 500 distance an then returns it..
Reply


Messages In This Thread
Annoyed - confused - Befuzzled - by Prokill911 - 05.02.2015, 20:10
Re: Annoyed - confused - Befuzzled - by Schneider - 05.02.2015, 20:27
Re: Annoyed - confused - Befuzzled - by Prokill911 - 05.02.2015, 20:52
Re: Annoyed - confused - Befuzzled - by Schneider - 05.02.2015, 21:00
Re: Annoyed - confused - Befuzzled - by Prokill911 - 05.02.2015, 21:03
Re: Annoyed - confused - Befuzzled - by Keyhead - 05.02.2015, 21:41
Re: Annoyed - confused - Befuzzled - by Schneider - 05.02.2015, 21:48
Re: Annoyed - confused - Befuzzled - by Prokill911 - 05.02.2015, 22:02
Re: Annoyed - confused - Befuzzled - by Prokill911 - 05.02.2015, 22:05
Re: Annoyed - confused - Befuzzled - by Schneider - 05.02.2015, 22:37
Re: Annoyed - confused - Befuzzled - by Keyhead - 07.02.2015, 02:01

Forum Jump:


Users browsing this thread: 1 Guest(s)