SA-MP Forums Archive
IsPlayerInRangeOfPoint HELP! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: IsPlayerInRangeOfPoint HELP! (/showthread.php?tid=109428)



IsPlayerInRangeOfPoint HELP! - Nakash - 20.11.2009

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.


Re: IsPlayerInRangeOfPoint HELP! - Nakash - 20.11.2009

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


Re: IsPlayerInRangeOfPoint HELP! - Striker_Moe - 20.11.2009

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)


Re: IsPlayerInRangeOfPoint HELP! - Nakash - 20.11.2009

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.


Re: IsPlayerInRangeOfPoint HELP! - Daren_Jacobson - 20.11.2009

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.