30.12.2014, 13:18
I am trying to check if the player is in range of one of the dealerships and it just doesn't work.
I've encountered a problem like this one before I just don't know the solution now.
I've encountered a problem like this one before I just don't know the solution now.
pawn Код:
YCMD:v_buy(playerid, params[], help) { //Accessing the vehicle purhcasing menu.
if(PR[playerid][VehiclesOwned] >= 1) return SendClientMessage(playerid, COLOR_ERROR, "[ ! ] You already reach the maximum amount of vehicles you can have!");
else {
for(new i = 0 ; i < MAX_DEALERSHIPS ; i ++) { //This command doesn't work properly, fix it.
if(IsPlayerInRangeOfPoint(playerid, 5, DS[i][DsLocX], DS[i][DsLocY], DS[i][DsLocZ])) {
format(ZString, sizeof(ZString), "Saloon Vehicles\nStation Wagons\nIndustrial\nPublic Service\nBikes\nHelicopters\nAir Planes\nSport Vehicles");
return 1;
} else {
SendClientMessage(playerid, COLOR_ERROR, "[ ! ] You are not near any dealership!");
break;
}
}
ShowPlayerDialog(playerid, DIALOG_DEALERSHIP_BUY, DIALOG_STYLE_LIST, "Vehicles DealerShip", ZString, "Purchase", "Close");
}
return 1;
}