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;
}
}
|
Originally Posted by Calon
Use IsPlayerInRangeOfPoint(params).
|
|
Originally Posted by [B2K
|