02.03.2013, 10:54
Hi all,
so, I'm working on my garage system, and somehow when I create a garage, the coords are not seen by IsPlayerInRangeOfPoint.
Example:
GInfo[id][GOutX] means the x pos, and same for the Y and Z, the others aren't important now.
when I use my enter command, it doesn't detect the coords, check:
As you can see, I placed debug messages for when it does detect the coords, but they it doesn't even go past it.
The coords are set, because the house pickup appears at the right place, so it's IsPlayerInRangeOfPoint that doesn't work here..
Anything I'm doing wrong? I'm using the exact same method for my house system, and it works bugfree, so this is really strange..
The main thing I want to achieve, is that the 'Coords detected' message is shown in the console.
The exact thing I want to fix is this:
The rest of the stuff works fine so far, it's just that the player isn't found in the range of the coords, event though I'm standing on that pickup.
Thanks in advance
so, I'm working on my garage system, and somehow when I create a garage, the coords are not seen by IsPlayerInRangeOfPoint.
Example:
pawn Code:
GetPlayerPos(playerid,tx1,ty1,tz1);
GInfo[garagecount][Owned] = 0;
format(GInfo[garagecount][Owner],32,"No One");
GInfo[garagecount][Price] = cost;
GInfo[garagecount][IntType] = type;
GInfo[garagecount][GOutX] = tx1;
GInfo[garagecount][GOutY] = ty1;
GInfo[garagecount][GOutZ] = tz1;
GInfo[garagecount][Opened] = 0;
when I use my enter command, it doesn't detect the coords, check:
pawn Code:
for(new i=0; i < MAX_GARAGES; i++)
{
if(IsPlayerInRangeOfPoint(playerid,5.0,GInfo[i][GOutX],GInfo[i][GOutZ],GInfo[i][GOutZ]))
{
print("coords detected");
if(GetGarageAcces(playerid,i) == 0) return ShowPlayerDialog(playerid,9999,DIALOG_STYLE_MSGBOX,"Problem..","This garage is locked.","Ok","");
if(GetGarageAcces(playerid,i) == 1)
{
print("insidefunction");
SaveAccount(playerid);
new t = GInfo[i][IntType];
SetPlayerPos(playerid,GL[t][InX],GL[t][InY],GL[t][InZ]);
SetPlayerInterior(playerid,GL[t][Interior]);
SetPlayerVirtualWorld(playerid,i);
LastGarage[playerid] = i;
return 1;
}
The coords are set, because the house pickup appears at the right place, so it's IsPlayerInRangeOfPoint that doesn't work here..
Anything I'm doing wrong? I'm using the exact same method for my house system, and it works bugfree, so this is really strange..
The main thing I want to achieve, is that the 'Coords detected' message is shown in the console.
The exact thing I want to fix is this:
pawn Code:
if(IsPlayerInRangeOfPoint(playerid,5.0,GInfo[i][GOutX],GInfo[i][GOutZ],GInfo[i][GOutZ]))
{
Thanks in advance