Iam Scripting On My New Work CR-RPv1.0 But Iam Upgraping It To PPC_Biz & PPC_Veh I Got This Error(s) On :-
pawn Код:
Dialog_BuyCarClass(playerid, response, listitem)
{
// Just close the dialog if the player clicked "Cancel"
if(!response) return 1;
// Setup local variables
new CarList[1000], DialogTitle[128];
// Set the player's chosen vehicle-class based on the listitem he chose (add 1 as the vehicleclass starts at 1)
APlayerData[playerid][DialogBuyVClass] = listitem + 1;
// Add all vehicles of the same class to the list
for (new i; i < sizeof(ABuyableVehicles); i++)
{
// Check if the vehicle in the list has the same class as requested
if (ABuyableVehicles[i][VehicleClass] == APlayerData[playerid][DialogBuyVClass])
{
// Add the carname to the list and it's price
format(CarList, 1000, "%s%s%s ($%i)", CarList, "\n", ABuyableVehicles[i][CarName], ABuyableVehicles[i][Price]); // Add the name of the next car to the list on the next line
}
}
// Check if the list is empty
if (strlen(CarList) == 0)
{
// Send the player a message that all vehicles have been disabled of the chosen class (no vehicles in the array of this class)
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}This is an empty list, the administrator may have disabled all vehicles of this class");
// Exit the function (don't ask to choose a vehicle)
return 1;
}
// Set a title for the dialog based on the requested vehicleclass
switch (APlayerData[playerid][DialogBuyVClass])
{
case VClassBike: format(DialogTitle, 128, "Buy a bike:");
case VClassBoat: format(DialogTitle, 128, "Buy a boat:");
case VClassConvertible: format(DialogTitle, 128, "Buy a convertible:");
case VClassHelicopter: format(DialogTitle, 128, "Buy a helicopter:");
case VClassIndustrial: format(DialogTitle, 128, "Buy a industrial vehicle:");
case VClassLowRider: format(DialogTitle, 128, "Buy a low-rider:");
case VClassOffRoad: format(DialogTitle, 128, "Buy an off-road vehicle:");
case VClassPlane: format(DialogTitle, 128, "Buy a plane:");
case VClassPublic: format(DialogTitle, 128, "Buy a public service vehicle:");
case VClassRCVehicle: format(DialogTitle, 128, "Buy a RC vehicle:");
case VClassSaloons: format(DialogTitle, 128, "Buy a saloon vehicle:");
case VClassSportCar: format(DialogTitle, 128, "Buy a sport vehicle:");
case VClassStationCar: format(DialogTitle, 128, "Buy a stationwagon:");
case VClassTrailer: format(DialogTitle, 128, "Buy a trailer:");
case VClassUnique: format(DialogTitle, 128, "Buy a unique vehicle:");
}
// Ask which car the player wants to have by showing the dialog
ShowPlayerDialog(playerid, DialogBuyCar, DIALOG_STYLE_LIST, DialogTitle, CarList, "Select", "Cancel");
return 1;
}
Dialog_GetCarSelectCar(playerid, response, listitem)
{
// Just close the dialog if the player clicked "Cancel"
if(!response) return 1;
// Get the HouseID from which to get the car
new HouseID = APlayerData[playerid][DialogGetCarHouseID];
// Get the vehicleid from the chosen listitem
new vid = AHouseData[HouseID][VehicleIDs][listitem];
// Check if it was a valid vehicleid
if (vid != 0)
{
// Setup local variables
new Float:x, Float:y, Float:z, Float:Angle;
// Get the player's position
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, Angle);
// Port the vehicle to the player
SetVehiclePos(vid, x, y, z);
// Put the player inside the vehicle and rotate the vehicle to face where the player was facing
PutPlayerInVehicle(playerid, vid, 0);
SetVehicleZAngle(vid, Angle);
// Turn on the engine and lights
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vid, 1, 1, alarm, doors, bonnet, boot, objective);
// Let the player know he should park the vehicle
SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}You've spawned your vehicle, now use \"{FFFF00}/park{00FF00}\" to park it near your house");
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}No vehicle exists in this vehicle-slot");
return 1;
}