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;
}
When you say "doesn't work", what exactly does it do, and what should it do? Also, you haven't declared "ZString"
|
YCMD:v_buy(playerid, params[], help)
{
if(PR[playerid][VehiclesOwned] >= 1)
return SendClientMessage(playerid, COLOR_ERROR, "[ ! ] You already reach the maximum amount of vehicles you can have!");
new dealershipid = -1;
for(new i = 0; i < MAX_DEALERSHIPS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, DS[i][DsLocX], DS[i][DsLocY], DS[i][DsLocZ]))
{
dealershipid = i;
}
}
if(dealershipid != -1)
{
format(ZString, sizeof(ZString), "Saloon Vehicles\nStation Wagons\nIndustrial\nPublic Service\nBikes\nHelicopters\nAir Planes\nSport Vehicles");
ShowPlayerDialog(playerid, DIALOG_DEALERSHIP_BUY, DIALOG_STYLE_LIST, "Vehicles DealerShip", ZString, "Purchase", "Close");
}
else
{
SendClientMessage(playerid, COLOR_ERROR, "[ ! ] You are not near any dealership!");
}
return 1;
}
YCMD:v_buy(playerid, params[], help)
{
if(PR[playerid][VehiclesOwned] >= 1) return SendClientMessage(playerid, COLOR_ERROR, "[ ! ] You already reach the maximum amount of vehicles you can have!");
for(new i = 0 ; i < MAX_DEALERSHIPS ; i ++)
{
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");
ShowPlayerDialog(playerid, DIALOG_DEALERSHIP_BUY, DIALOG_STYLE_LIST, "Vehicles DealerShip", ZString, "Purchase", "Close");//add this line here
return 1;
}
}
SendClientMessage(playerid, COLOR_ERROR, "[ ! ] You are not near any dealership!");
return 1;
}