SA-MP Forums Archive
SetPlayerToPoint - Help Please. - 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: SetPlayerToPoint - Help Please. (/showthread.php?tid=109231)



SetPlayerToPoint - Help Please. - Nakash - 18.11.2009

The problem is when i type /v buy MODEL it allways says 'You are not at a dealership!',even if i am.
It worked in the other version of samp,but now it doesn't.
Here is the code:

Код:
	  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 (PlayerToPoint(8.0,playerid,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;
				}
			}
thanks


Re: SetPlayerToPoint - Help Please. - Calon - 18.11.2009

Use IsPlayerInRangeOfPoint(params).


Re: SetPlayerToPoint - Help Please. - Nakash - 18.11.2009

Quote:
Originally Posted by Calon
Use IsPlayerInRangeOfPoint(params).
Can you show me an example?thanks.


Re: SetPlayerToPoint - Help Please. - member - 18.11.2009

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: SetPlayerToPoint - Help Please. - Nakash - 18.11.2009

Quote:
Originally Posted by [B2K
Thank you !
It worked.