SetPlayerToPoint - Help Please.
#1

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
Reply
#2

Use IsPlayerInRangeOfPoint(params).
Reply
#3

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

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)