IsPlayerInRangeOfPoint HELP!
#1

Hello everybody,i need some help with IsPlayerInRangeOfPoint.
I tried to make this:

Код:
	  if(!strcmp(tmp, "buy",true,4))
	  {
	    if(IsPlayerConnected(playerid))
	    {
				tmp = strtok(cmdtext, idx);
 				if(!strlen(tmp))
 				{
  					SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /v buy [Model]");
  					SendClientMessage(playerid, COLOR_GRAD2, "Use /v help to see the vehicle models and their prices.");
					return 1;
  			}
				if (IsPlayerInRangeOfPoint(playerid,8.0,332.5212,-1338.3401,14.5078))
			  {
					new car;
		  		car = strval(tmp);
		  		if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_LIGHTRED, "  Vehicle Number can't be below 400 or above 611!"); return 1; }
					if(CarsPrices[car-400] == 0)
					{
						SendClientMessage(playerid, COLOR_LIGHTRED, "This vehicle is not for sale !");
						return 1;
					}
					if(GetPlayerMoney(playerid) < CarsPrices[car-400])
					{
						SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have enough money !");
						return 1;
					}
					pCar[playerid] = car;
					ShowMenuForPlayer(ColorsS, playerid);
					DestroyVehicle(car);
					return 1;
				}
				else
				{
					SendClientMessage(playerid, COLOR_LIGHTRED, "You are not at a dealership !");
					return 1;
				}
			}
    }
when i type /v buy it always says 'You are not at a dealership!' even if i am.
i can't fix this..can you help me please? thanks.
Reply
#2

Please..i got to go soon ;(
sorry for the db.
Reply
#3

Make sure you entered the correct coordinates

+

Change this:

if (IsPlayerInRangeOfPoint(playerid,8.0,332.5212,-1338.3401,14.507)

To

if(IsPlayerInRangeOfPoint(playerid,8.0,332.5212,-1338.3401,14.507)
Reply
#4

Quote:
Originally Posted by Mo3
Make sure you entered the correct coordinates

+

Change this:

if (IsPlayerInRangeOfPoint(playerid,8.0,332.5212,-1338.3401,14.507)

To

if(IsPlayerInRangeOfPoint(playerid,8.0,332.5212,-1338.3401,14.507)
these are the correct co.
maybe it is because this is in another script? (it is used as a filterscript..)

Edit: nvm,i don't think i'm gonna use this script..it doesnt work so well.
Reply
#5

Quote:
Originally Posted by Mo3
Change this:

if (IsPlayerInRangeOfPoint(playerid,8.0,332.5212,-1338.3401,14.507)

To

if(IsPlayerInRangeOfPoint(playerid,8.0,332.5212,-1338.3401,14.507)
are the only differences in that the space after if? If so, changing that has no effect, and i rather think that a space after if is easier to read.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)