19.05.2012, 08:05
When i press YES to buy the vehicle and when i will exit and again enter is still on buy and /v dont work what should i DO
[CODE]/*
new v;
#include <a_samp>
#include <dini>
#define DIALOGID 3304
#define BOJA1 0x33CCFFAA
#define BOJA2 0xFF0000AA
#pragma tabsize 0
//-------------------------------0.3c BOJE--------------------------------------
#define SULJA "{FFFF80}"
#define TPLAVA2 "{ADD6FF}"
#define TPLAVA "{0482FF}"
#define SZELENA "{00FF00}"
#define BIJELA "{FFFFFF}"
#define CRNA "{0E0101}"
#define SIVA "{C3C3C3}"
#define ZELENA "{6EF83C}"
#define CRVENA "{F81414}"
#define ZUTA "{F3FF02}"
#define NARANDZASTA "{FFAF00}"
#define LIME "{B7FF00}"
#define CYAN "{00FFEE}"
#define SPLAVA "{00C0FF}"
#define PLAVA "{0049FF}"
#define COL_MAGENTA "{F300FF}"
#define COL_VIOLET "{B700FF}"
#define ROZA "{FF00EA}"
#define COL_MARONE "{A90202}"
#define COL_PARAM "{3FCD02}"
#define COL_VALUE "{A3E4FF}"
#define COL_RULE "{F9E8B7}"
#define COL_RULE2 "{FBDF89}"
#define COL_RWHITE "{FFFFFF}"
#define SVETLO_ZELENA "{C9FFAB}"
#define SVETLO_CRVENA "{FFA1A1}"
#define SVJETLO_CRVENA2 "{C77D87}"
#define INFOBOJA "{37F906}"
#define COL_YELLOW "{F3FF02}"
//------------------------------------------------------------------------------
enum car_info
{
Model,
Price,
Float:CarX,
Float:CarY,
Float:CarZ,
Float:CarRot,
Locked,
mod1,
mod2,
mod3,
mod4,
mod5,
mod6,
mod7,
mod8,
mod9,
mod10,
mod11,
mod12,
mod13,
mod14,
mod15,
mod16,
mod17,
paintjob,
colora,
colorb
};
new VehicleInfo[MAX_PLAYERS][car_info];
new DealerCars[37];
new Text3DealerCar[37];
new Vehicle[MAX_PLAYERS];
new OwnerID[MAX_VEHICLES];
new CarPrice[MAX_VEHICLES];
new VehOwned[MAX_VEHICLES];
new ConfirmSale[MAX_PLAYERS];
new gVehLocked[MAX_VEHICLES];
new VehPlate[MAX_VEHICLES][256];
new gPlayerHasCar[MAX_PLAYERS];
new IsADealerCar[MAX_VEHICLES];
new Checkpoint[MAX_PLAYERS];
new boolestroyed[MAX_VEHICLES];
stock GetVehicleNameFromID(vehicleid)
{
static const scVehicleNames[][18] = {
"Landstalker",
"Bravura",
"Buffalo",
"Linerunner",
"Perrenial",
"Sentinel",
"Dumper",
"Firetruck",
"Trashmaster",
"Stretch",
"Manana",
"Infernus",
"Voodoo",
"Pony",
"Mule",
"Cheetah",
"Ambulance",
"Leviathan",
"Moonbeam",
"Esperanto",
"Taxi",
"Washington",
"Bobcat",
"Mr Whoopee",
"BF Injection",
"Hunter",
"Premier",
"Enforcer",
"Securicar",
"Banshee",
"Predator",
"Bus",
"Rhino",
"Barracks",
"Hotknife",
"Trailer 1",
"Previon",
"Coach",
"Cabbie",
"Stallion",
"Rumpo",
"RC Bandit",
"Romero",
"Packer",
"Monster",
"Admiral",
"Squalo",
"Seasparrow",
"Pizzaboy",
"Tram",
"Trailer 2",
"Turismo",
"Speeder",
"Reefer",
"Tropic",
"Flatbed",
"Yankee",
"Caddy",
"Solair",
"Berkley's RC Van",
"Skimmer",
"PCJ-600",
"Faggio",
"Freeway",
"RC Baron",
"RC Raider",
"Glendale",
"Oceanic",
"Sanchez",
"Sparrow",
"Patriot",
"Quad",
"Coastguard",
"Dinghy",
"Hermes",
"Sabre",
"Rustler",
"ZR-350",
"Walton",
"Regina",
"Comet",
"BMX",
"Burrito",
"Camper",
"Marquis",
"Baggage",
"Dozer",
"Maverick",
"News Chopper",
"Rancher",
"FBI Rancher",
"Virgo",
"Greenwood",
"Jetmax",
"Hotring",
"Sandking",
"Blista Compact",
"Police Maverick",
"Boxville",
"Benson",
"Mesa",
"RC Goblin",
"Hotring Racer A",
"Hotring Racer B",
"Bloodring Banger",
"Rancher",
"Super GT",
"Elegant",
"Journey",
"Bike",
"Mountain Bike",
"Beagle",
"Cropdust",
"Stunt",
"Tanker",
"Roadtrain",
"Nebula",
"Majestic",
"Buccaneer",
"Shamal",
"Hydra",
"FCR-900",
"NRG-500",
"HPV1000",
"Cement Truck",
"Tow Truck",
"Fortune",
"Cadrona",
"FBI Truck",
"Willard",
"Forklift",
"Tractor",
"Combine",
"Feltzer",
"Remington",
"Slamvan",
"Blade",
"Freight",
"Streak",
"Vortex",
"Vincent",
"Bullet",
"Clover",
"Sadler",
"Firetruck LA",
"Hustler",
"Intruder",
"Primo",
"Cargobob",
"Tampa",
"Sunrise",
"Merit",
"Utility",
"Nevada",
"Yosemite",
"Windsor",
"Monster A",
"Monster B",
"Uranus",
"Jester",
"Sultan",
"Stratum",
"Elegy",
"Raindance",
"RC Tiger",
"Flash",
"Tahoma",
"Savanna",
"Bandito",
"Freight Flat",
"Streak Carriage",
"Kart",
"Mower",
"Duneride",
"Sweeper",
"Broadway",
"Tornado",
"AT-400",
"DFT-30",
"Huntley",
"Stafford",
"BF-400",
"Newsvan",
"Tug",
"Trailer 3",
"Emperor",
"Wayfarer",
"Euros",
"Hotdog",
"Club",
"Freight Carriage",
"Trailer 3",
"Andromada",
"Dodo",
"RC Cam",
"Launch",
"LS Police Car",
"SF Police Car",
"LV Police Car",
"Police Ranger",
"Picador",
"S.W.A.T. Van",
"Alpha",
"Phoenix",
"Glendale",
"Sadler",
"Luggage Trailer A",
"Luggage Trailer B",
"Stair Trailer",
"Boxville",
"Farm Plow",
"Utility Trailer"
},
scOnFoot[18] = "OnFoot";
if (vehicleid > 0) {
return scVehicleNames[GetVehicleModel(vehicleid) - 400];
}
else {
return scOnFoot;
}
}
public OnGameModeInit()
{
return 1;
}
public OnFilterScriptInit()
{
DealerCars[0] = AddStaticVehicleEx(579,1460.90002441,-2348.30004883,13.60000038,0.00000000,1,-1,15); //Huntley
DealerCars[1] = AddStaticVehicleEx(495,1457.69995117,-2348.39990234,14.10000038,0.00000000,1,-1,15); //Sandking
DealerCars[2] = AddStaticVehicleEx(400,1454.19995117,-2348.10009766,13.69999981,0.00000000,1,54,15); //Landstalker
DealerCars[3] = AddStaticVehicleEx(500,1451.09997559,-2348.30004883,13.80000019,0.00000000,1,1,15); //Mesa
DealerCars[4] = AddStaticVehicleEx(489,1448.00000000,-2347.60009766,13.89999962,0.00000000,1,-1,15); //Rancher
DealerCars[5] = AddStaticVehicleEx(589,1438.09997559,-2347.10009766,13.30000019,0.00000000,87,87,15); //Club
DealerCars[6] = AddStaticVehicleEx(554,1444.50000000,-2347.19995117,13.69999981,0.00000000,1,1,15); //Yosemite
DealerCars[7] = AddStaticVehicleEx(587,1441.40002441,-2347.39990234,13.39999962,0.00000000,1,1,15); //Euros
DealerCars[8] = AddStaticVehicleEx(560,1384.90002441,-2364.50000000,13.39999962,0.00000000,53,53,15); //Sultan
DealerCars[9] = AddStaticVehicleEx(562,1388.40002441,-2364.80004883,13.30000019,0.00000000,53,53,15); //Elegy
DealerCars[10] = AddStaticVehicleEx(565,1391.50000000,-2364.69995117,13.19999981,0.00000000,53,53,15); //Flash
DealerCars[11] = AddStaticVehicleEx(559,1394.80004883,-2364.89990234,13.30000019,0.00000000,53,53,15); //Jester
DealerCars[12] = AddStaticVehicleEx(558,1398.09997559,-2364.60009766,13.30000019,0.00000000,53,53,15); //Uranus
DealerCars[13] = AddStaticVehicleEx(534,1401.40002441,-2364.69995117,13.39999962,0.00000000,53,53,15); //Remington
DealerCars[14] = AddStaticVehicleEx(535,1404.69995117,-2364.60009766,13.39999962,0.00000000,53,53,15); //Slamvan
DealerCars[15] = AddStaticVehicleEx(536,1408.00000000,-2364.30004883,13.39999962,0.00000000,53,53,15); //Blade
DealerCars[16] = AddStaticVehicleEx(567,1411.19995117,-2364.50000000,13.50000000,0.00000000,53,53,15); //Savanna
DealerCars[17] = AddStaticVehicleEx(561,1385.09997559,-2347.39990234,13.50000000,0.00000000,51,51,15); //Stratum
DealerCars[18] = AddStaticVehicleEx(507,1388.40002441,-2347.10009766,13.50000000,0.00000000,51,51,15); //Elegant
DealerCars[19] = AddStaticVehicleEx(550,1391.59997559,-2347.19995117,13.50000000,0.00000000,51,51,15); //Sunrise
DealerCars[20] = AddStaticVehicleEx(551,1395.00000000,-2347.10009766,13.39999962,0.00000000,51,51,15); //Merit
DealerCars[21] = AddStaticVehicleEx(402,1398.09997559,-2347.10009766,13.50000000,0.00000000,51,51,15); //Buffalo
DealerCars[22] = AddStaticVehicleEx(477,1401.40002441,-2347.30004883,13.39999962,0.00000000,51,51,15); //ZR-350
DealerCars[23] = AddStaticVehicleEx(555,1411.19995117,-2347.60009766,13.30000019,0.00000000,51,51,15); //Windsor
DealerCars[24] = AddStaticVehicleEx(602,1404.90002441,-2347.39990234,13.39999962,0.00000000,51,51,15); //Alpha
DealerCars[25] = AddStaticVehicleEx(603,1408.00000000,-2347.30004883,13.50000000,0.00000000,51,51,15); //Phoenix
DealerCars[26] = AddStaticVehicleEx(527,1415.00000000,-2347.50000000,13.30000019,0.00000000,51,51,15); //Cadrona
DealerCars[27] = AddStaticVehicleEx(533,1411.30004883,-2330.50000000,13.30000019,0.00000000,6,6,15); //Feltzer
DealerCars[28] = AddStaticVehicleEx(545,1407.90002441,-2330.39990234,13.50000000,0.00000000,53,53,15); //Hustler
DealerCars[29] = AddStaticVehicleEx(541,1385.19995117,-2314.30004883,13.19999981,0.00000000,1,86,15); //Bullet
DealerCars[30] = AddStaticVehicleEx(429,1388.50000000,-2314.19995117,13.30000019,0.00000000,1,86,15); //Banshee
DealerCars[31] = AddStaticVehicleEx(415,1391.59997559,-2314.30004883,13.39999962,0.00000000,1,1,15); //Cheetah
DealerCars[32] = AddStaticVehicleEx(506,1394.69995117,-2314.10009766,13.30000019,0.00000000,1,1,15); //Super GT
DealerCars[33] = AddStaticVehicleEx(451,1398.09997559,-2314.10009766,13.30000019,0.00000000,1,1,15); //Turismo
DealerCars[34] = AddStaticVehicleEx(480,1401.40002441,-2314.00000000,13.39999962,0.00000000,1,1,15); //Comet
DealerCars[35] = AddStaticVehicleEx(556,1411.19995117,-2313.60009766,14.50000000,0.00000000,-1,-1,15); //Monster A
DealerCars[36] = AddStaticVehicleEx(411,1408.00000000,-2313.80004883,13.30000019,0.00000000,1,1,15); //Infernus
IsADealerCar[DealerCars[0]] = true;
IsADealerCar[DealerCars[1]] = true;
IsADealerCar[DealerCars[2]] = true;
IsADealerCar[DealerCars[3]] = true;
IsADealerCar[DealerCars[4]] = true;
IsADealerCar[DealerCars[5]] = true;
IsADealerCar[DealerCars[6]] = true;
IsADealerCar[DealerCars[7]] = true;
IsADealerCar[DealerCars[8]] = true;
IsADealerCar[DealerCars[9]] = true;
IsADealerCar[DealerCars[10]] = true;
IsADealerCar[DealerCars[11]] = true;
IsADealerCar[DealerCars[12]] = true;
IsADealerCar[DealerCars[13]] = true;
IsADealerCar[DealerCars[14]] = true;
IsADealerCar[DealerCars[15]] = true;
IsADealerCar[DealerCars[16]] = true;
IsADealerCar[DealerCars[17]] = true;
IsADealerCar[DealerCars[18]] = true;
IsADealerCar[DealerCars[19]] = true;
IsADealerCar[DealerCars[20]] = true;
IsADealerCar[DealerCars[21]] = true;
IsADealerCar[DealerCars[22]] = true;
IsADealerCar[DealerCars[23]] = true;
IsADealerCar[DealerCars[24]] = true;
IsADealerCar[DealerCars[25]] = true;
IsADealerCar[DealerCars[26]] = true;
IsADealerCar[DealerCars[27]] = true;
IsADealerCar[DealerCars[28]] = true;
IsADealerCar[DealerCars[29]] = true;
IsADealerCar[DealerCars[30]] = true;
IsADealerCar[DealerCars[31]] = true;
IsADealerCar[DealerCars[32]] = true;
IsADealerCar[DealerCars[33]] = true;
IsADealerCar[DealerCars[34]] = true;
IsADealerCar[DealerCars[35]] = true;
IsADealerCar[DealerCars[36]] = true;
CarPrice[DealerCars[0]] = 200000;
CarPrice[DealerCars[1]] = 800000;
CarPrice[DealerCars[2]] = 500000;
CarPrice[DealerCars[3]] = 300000;
CarPrice[DealerCars[4]] = 900000;
CarPrice[DealerCars[5]] = 452000;
CarPrice[DealerCars[6]] = 452000;
CarPrice[DealerCars[7]] = 652000;
CarPrice[DealerCars[8]] = 900000;
CarPrice[DealerCars[9]] = 752000;
CarPrice[DealerCars[10]] = 752000;
CarPrice[DealerCars[11]] = 852000;
CarPrice[DealerCars[12]] = 752000;
CarPrice[DealerCars[13]] = 752000;
CarPrice[DealerCars[14]] = 752000;
CarPrice[DealerCars[15]] = 900000;
CarPrice[DealerCars[16]] = 900000;
CarPrice[DealerCars[17]] = 652000;
CarPrice[DealerCars[18]] = 600000;
CarPrice[DealerCars[19]] = 752000;
CarPrice[DealerCars[20]] = 752000;
CarPrice[DealerCars[21]] = 1000000;
CarPrice[DealerCars[22]] = 900000;
CarPrice[DealerCars[23]] = 752000;
CarPrice[DealerCars[24]] = 600000;
CarPrice[DealerCars[25]] = 852000;
CarPrice[DealerCars[26]] = 750000;
CarPrice[DealerCars[27]] = 750000;
CarPrice[DealerCars[28]] = 750000;
CarPrice[DealerCars[29]] = 1100000;
CarPrice[DealerCars[30]] = 1300000;
CarPrice[DealerCars[31]] = 900000;
CarPrice[DealerCars[32]] = 900000;
CarPrice[DealerCars[33]] = 1200000;
CarPrice[DealerCars[34]] = 900000;
CarPrice[DealerCars[35]] = 3000000;
CarPrice[DealerCars[36]] = 2000000;
return 1;
}
public OnFilterScriptExit()
{
IsADealerCar[DealerCars[0]] = false;
IsADealerCar[DealerCars[1]] = false;
IsADealerCar[DealerCars[2]] = false;
IsADealerCar[DealerCars[3]] = false;
IsADealerCar[DealerCars[4]] = false;
IsADealerCar[DealerCars[5]] = false;
IsADealerCar[DealerCars[6]] = false;
IsADealerCar[DealerCars[7]] = false;
IsADealerCar[DealerCars[8]] = false;
IsADealerCar[DealerCars[9]] = false;
IsADealerCar[DealerCars[10]] = false;
IsADealerCar[DealerCars[11]] = false;
IsADealerCar[DealerCars[12]] = false;
IsADealerCar[DealerCars[13]] = false;
IsADealerCar[DealerCars[14]] = false;
IsADealerCar[DealerCars[15]] = false;
IsADealerCar[DealerCars[16]] = false;
IsADealerCar[DealerCars[17]] = false;
IsADealerCar[DealerCars[18]] = false;
IsADealerCar[DealerCars[19]] = false;
IsADealerCar[DealerCars[20]] = false;
IsADealerCar[DealerCars[21]] = false;
IsADealerCar[DealerCars[22]] = false;
IsADealerCar[DealerCars[23]] = false;
IsADealerCar[DealerCars[24]] = false;
IsADealerCar[DealerCars[25]] = false;
IsADealerCar[DealerCars[26]] = false;
IsADealerCar[DealerCars[27]] = false;
IsADealerCar[DealerCars[28]] = false;
IsADealerCar[DealerCars[29]] = false;
IsADealerCar[DealerCars[30]] = false;
IsADealerCar[DealerCars[31]] = false;
IsADealerCar[DealerCars[32]] = false;
IsADealerCar[DealerCars[33]] = false;
IsADealerCar[DealerCars[34]] = false;
IsADealerCar[DealerCars[35]] = false;
IsADealerCar[DealerCars[36]] = false;
CarPrice[DealerCars[0]] = 0;
CarPrice[DealerCars[1]] = 0;
CarPrice[DealerCars[2]] = 0;
CarPrice[DealerCars[3]] = 0;
CarPrice[DealerCars[4]] = 0;
CarPrice[DealerCars[5]] = 0;
CarPrice[DealerCars[6]] = 0;
CarPrice[DealerCars[7]] = 0;
CarPrice[DealerCars[8]] = 0;
CarPrice[DealerCars[9]] = 0;
CarPrice[DealerCars[10]] = 0;
CarPrice[DealerCars[11]] = 0;
CarPrice[DealerCars[12]] = 0;
CarPrice[DealerCars[13]] = 0;
CarPrice[DealerCars[14]] = 0;
CarPrice[DealerCars[15]] = 0;
CarPrice[DealerCars[16]] = 0;
CarPrice[DealerCars[17]] = 0;
CarPrice[DealerCars[18]] = 0;
CarPrice[DealerCars[19]] = 0;
CarPrice[DealerCars[20]] = 0;
CarPrice[DealerCars[21]] = 0;
CarPrice[DealerCars[22]] = 0;
CarPrice[DealerCars[23]] = 0;
CarPrice[DealerCars[24]] = 0;
CarPrice[DealerCars[25]] = 0;
CarPrice[DealerCars[26]] = 0;
CarPrice[DealerCars[27]] = 0;
CarPrice[DealerCars[28]] = 0;
CarPrice[DealerCars[29]] = 0;
CarPrice[DealerCars[30]] = 0;
CarPrice[DealerCars[31]] = 0;
CarPrice[DealerCars[32]] = 0;
CarPrice[DealerCars[33]] = 0;
CarPrice[DealerCars[34]] = 0;
CarPrice[DealerCars[35]] = 0;
CarPrice[DealerCars[36]] = 0;
DestroyVehicle(DealerCars[0]);
DestroyVehicle(DealerCars[1]);
DestroyVehicle(DealerCars[2]);
DestroyVehicle(DealerCars[3]);
DestroyVehicle(DealerCars[4]);
DestroyVehicle(DealerCars[5]);
DestroyVehicle(DealerCars[6]);
DestroyVehicle(DealerCars[7]);
DestroyVehicle(DealerCars[8]);
DestroyVehicle(DealerCars[9]);
DestroyVehicle(DealerCars[10]);
DestroyVehicle(DealerCars[11]);
DestroyVehicle(DealerCars[12]);
DestroyVehicle(DealerCars[13]);
DestroyVehicle(DealerCars[14]);
DestroyVehicle(DealerCars[15]);
DestroyVehicle(DealerCars[16]);
DestroyVehicle(DealerCars[17]);
DestroyVehicle(DealerCars[18]);
DestroyVehicle(DealerCars[19]);
DestroyVehicle(DealerCars[20]);
DestroyVehicle(DealerCars[21]);
DestroyVehicle(DealerCars[22]);
DestroyVehicle(DealerCars[23]);
DestroyVehicle(DealerCars[24]);
DestroyVehicle(DealerCars[25]);
DestroyVehicle(DealerCars[26]);
DestroyVehicle(DealerCars[27]);
DestroyVehicle(DealerCars[28]);
DestroyVehicle(DealerCars[29]);
DestroyVehicle(DealerCars[30]);
DestroyVehicle(DealerCars[31]);
DestroyVehicle(DealerCars[32]);
DestroyVehicle(DealerCars[33]);
DestroyVehicle(DealerCars[34]);
DestroyVehicle(DealerCars[35]);
DestroyVehicle(DealerCars[36]);
return 1;
}
public OnPlayerConnect(playerid)
{
new file[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Cars/%s.ini",name);
if(dini_Exists(file))
{
VehicleInfo[playerid][Model] = dini_Int(file, "Model");
VehicleInfo[playerid][Price] = dini_Int(file, "Price");
VehicleInfo[playerid][CarX] = dini_Float(file, "X");
VehicleInfo[playerid][CarY] = dini_Float(file, "Y");
VehicleInfo[playerid][CarZ] = dini_Float(file, "Z");
VehicleInfo[playerid][CarRot] = dini_Float(file, "Rot");
VehicleInfo[playerid][Locked] = dini_Int(file, "Locked");
VehicleInfo[playerid][mod1] = dini_Int(file, "mod1");
VehicleInfo[playerid][mod2] = dini_Int(file, "mod2");
VehicleInfo[playerid][mod3] = dini_Int(file, "mod3");
VehicleInfo[playerid][mod4] = dini_Int(file, "mod4");
VehicleInfo[playerid][mod5] = dini_Int(file, "mod5");
VehicleInfo[playerid][mod6] = dini_Int(file, "mod6");
VehicleInfo[playerid][mod7] = dini_Int(file, "mod7");
VehicleInfo[playerid][mod8] = dini_Int(file, "mod8");
VehicleInfo[playerid][mod9] = dini_Int(file, "mod9");
VehicleInfo[playerid][mod10] = dini_Int(file, "mod10");
VehicleInfo[playerid][mod11] = dini_Int(file, "mod11");
VehicleInfo[playerid][mod12] = dini_Int(file, "mod12");
VehicleInfo[playerid][mod13] = dini_Int(file, "mod13");
VehicleInfo[playerid][mod14] = dini_Int(file, "mod14");
VehicleInfo[playerid][mod15] = dini_Int(file, "mod15");
VehicleInfo[playerid][mod16] = dini_Int(file, "mod16");
VehicleInfo[playerid][mod17] = dini_Int(file, "mod17");
VehicleInfo[playerid][paintjob] = dini_Int(file, "paintjob");
VehicleInfo[playerid][colora] = dini_Int(file, "color1");
VehicleInfo[playerid][colorb] = dini_Int(file, "color2");
Vehicle[playerid] = CreateVehicle(VehicleInfo[playerid][Model], VehicleInfo[playerid][CarX], VehicleInfo[playerid][CarY], VehicleInfo[playerid][CarZ], VehicleInfo[playerid][CarRot], -1, -1, 3600000);
if(VehicleInfo[playerid][mod1]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod1]); }
if(VehicleInfo[playerid][mod2]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod2]); }
if(VehicleInfo[playerid][mod3]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod3]); }
if(VehicleInfo[playerid][mod4]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod4]); }
if(VehicleInfo[playerid][mod5]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod5]); }
if(VehicleInfo[playerid][mod6]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod6]); }
if(VehicleInfo[playerid][mod7]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod7]); }
if(VehicleInfo[playerid][mod8]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod8]); }
if(VehicleInfo[playerid][mod9]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod9]); }
if(VehicleInfo[playerid][mod10]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod10]); }
if(VehicleInfo[playerid][mod11]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod11]); }
if(VehicleInfo[playerid][mod12]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod12]); }
if(VehicleInfo[playerid][mod13]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod13]); }
if(VehicleInfo[playerid][mod14]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod14]); }
if(VehicleInfo[playerid][mod15]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod15]); }
if(VehicleInfo[playerid][mod16]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod16]); }
if(VehicleInfo[playerid][mod17]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod17]); }
if(VehicleInfo[playerid][colora]!=0 || VehicleInfo[playerid][colorb]!=0)
{
ChangeVehicleColor(Vehicle[playerid],VehicleInfo[playerid][colora],VehicleInfo[playerid][colorb]);
}
if(VehicleInfo[playerid][paintjob]!=0)
{
ChangeVehiclePaintjob(Vehicle[playerid],VehicleInfo[playerid][paintjob]);
}
new tmp[256]; tmp = dini_Get(file, "Plate");
gPlayerHasCar[playerid] = 1;
VehOwned[Vehicle[playerid]] = 1;
OwnerID[Vehicle[playerid]] = playerid;
SetVehicleParamsForPlayer(Vehicle[playerid], playerid, 0, VehicleInfo[playerid][Locked]);
gVehLocked[Vehicle[playerid]] = VehicleInfo[playerid][Locked];
SetVehicleNumberPlate(Vehicle[playerid], tmp);
VehPlate[Vehicle[playerid]] = tmp;
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
new file[256], name[24];
GetPlayerName(playerid, name, 24);
format(file,sizeof(file),"Cars/%s.ini",name);
if(dini_Exists(file))
{
dini_IntSet(file, "Model", GetVehicleModel(Vehicle[playerid]));
dini_IntSet(file, "Price", VehicleInfo[playerid][Price]);
dini_FloatSet(file, "X", VehicleInfo[playerid][CarX]);
dini_FloatSet(file, "Y", VehicleInfo[playerid][CarY]);
dini_FloatSet(file, "Z", VehicleInfo[playerid][CarZ]);
dini_FloatSet(file, "Rot", VehicleInfo[playerid][CarRot]);
dini_IntSet(file, "Locked", VehicleInfo[playerid][Locked]);
dini_Set(file, "Plate", VehPlate[Vehicle[playerid]]);
dini_IntSet(file, "mod1", VehicleInfo[playerid][mod1]);
dini_IntSet(file, "mod2", VehicleInfo[playerid][mod2]);
dini_IntSet(file, "mod3", VehicleInfo[playerid][mod3]);
dini_IntSet(file, "mod4", VehicleInfo[playerid][mod4]);
dini_IntSet(file, "mod5", VehicleInfo[playerid][mod5]);
dini_IntSet(file, "mod6", VehicleInfo[playerid][mod6]);
dini_IntSet(file, "mod7", VehicleInfo[playerid][mod7]);
dini_IntSet(file, "mod8", VehicleInfo[playerid][mod8]);
dini_IntSet(file, "mod9", VehicleInfo[playerid][mod9]);
dini_IntSet(file, "mod10", VehicleInfo[playerid][mod10]);
dini_IntSet(file, "mod11", VehicleInfo[playerid][mod11]);
dini_IntSet(file, "mod12", VehicleInfo[playerid][mod12]);
dini_IntSet(file, "mod13", VehicleInfo[playerid][mod13]);
dini_IntSet(file, "mod14", VehicleInfo[playerid][mod14]);
dini_IntSet(file, "mod15", VehicleInfo[playerid][mod15]);
dini_IntSet(file, "mod16", VehicleInfo[playerid][mod16]);
dini_IntSet(file, "mod17", VehicleInfo[playerid][mod17]);
dini_IntSet(file, "paintjob", VehicleInfo[playerid][paintjob]);
dini_IntSet(file, "color1", VehicleInfo[playerid][colora]);
dini_IntSet(file, "color2", VehicleInfo[playerid][colorb]);
DestroyVehicle(Vehicle[playerid]);
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(playerid);
if(VehOwned[veh] == 0)
{
if(IsADealerCar[veh] == 1)
{
new string[128];
format(string, sizeof(string), ""TPLAVA2"Sakate li da go kupite %s za $%i?", GetVehicleNameFromID(veh), CarPrice[veh]);
ShowPlayerDialog(playerid, 669, DIALOG_STYLE_MSGBOX, "Avto Salon", string, "Da", "Ne");
return 1;
}
}
else if(VehOwned[veh] == 1)
{
new owner[24], string[128];
GetPlayerName(OwnerID[veh], owner, sizeof(owner));
format(string, sizeof(string), ""TPLAVA2"Avtomobil: %s {F3FF02}Gazda: %s.", GetVehicleNameFromID(veh), owner);
SendClientMessage(playerid, 0xFFFF00AA, string);
return 1;
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 3304)
{
if(response)
{
//-------------/LOCKcars-------------
if(listitem == 0)
{
if(gPlayerHasCar[playerid] == 1)
{
new veh, Float:vehx, Float:vehy, Float:vehz;
veh = Vehicle[playerid];
GetVehiclePos(veh, vehx, vehy, vehz);
if(IsPlayerInRangeOfPoint(playerid, 3.0, vehx, vehy, vehz))
{
if(VehicleInfo[playerid][Locked] == 0)
{
SetVehicleParamsForPlayer(veh, playerid, 0, 1);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~r~Avtomobil zaklucen!", 3000, 3);
VehicleInfo[playerid][Locked] = 1;
gVehLocked[v] = 1;
return 1;
}
if(VehicleInfo[playerid][Locked] == 1)
{
SetVehicleParamsForPlayer(veh, playerid, 0, 0);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~g~Avtomobil otklucen!", 3000, 3);
VehicleInfo[playerid][Locked] = 0;
gVehLocked[v] = 0;
return 1;
}
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA, ""INFOBOJA"INFO: "BIJELA"Ne ste do vasiot avtomobil.");
return 1;
}
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA, ""INFOBOJA"INFO: "BIJELA"Vie neposeduvate Avtomobil.");
}
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z, Float:Rot;
if(!IsPlayerInVehicle(playerid, Vehicle[playerid]))
{
SendClientMessage(playerid, 0xFFFFFFAA, ""INFOBOJA"INFO: "BIJELA"Ne ste vo vasiot avtomobil.");
return 1;
}
new file[256], name[24];
GetPlayerName(playerid, name, 24);
format(file,sizeof(file),"Cars/%s.ini",name);
dini_IntSet(file, "Model", VehicleInfo[playerid][Model]);
dini_IntSet(file, "Price", VehicleInfo[playerid][Price]);
dini_FloatSet(file, "X", VehicleInfo[playerid][CarX]);
dini_FloatSet(file, "Y", VehicleInfo[playerid][CarY]);
dini_FloatSet(file, "Z", VehicleInfo[playerid][CarZ]);
dini_FloatSet(file, "Rot", VehicleInfo[playerid][CarRot]);
dini_IntSet(file, "Locked", VehicleInfo[playerid][Locked]);
dini_IntSet(file, "paintjob", VehicleInfo[playerid][paintjob]);
dini_IntSet(file, "color1", VehicleInfo[playerid][colora]);
dini_IntSet(file, "color1", VehicleInfo[playerid][colorb]);
SendClientMessage(playerid, 0xFFFF00FF, ""INFOBOJA"INFO: "BIJELA"Go parkiravte vasiot avtomobil na ovoa mesto.");
GetVehiclePos(Vehicle[playerid], X, Y, Z);
GetVehicleZAngle(Vehicle[playerid], Rot);
VehicleInfo[playerid][Model] = GetVehicleModel(playerid);
VehicleInfo[playerid][CarX] = X;
VehicleInfo[playerid][CarY] = Y;
VehicleInfo[playerid][CarZ] = Z;
VehicleInfo[playerid][CarRot] = Rot;
return 1;
}
if(listitem == 2)
{
if(IsPlayerConnected(playerid))
{
if(!IsPlayerInVehicle(playerid, Vehicle[playerid]))
{
SendClientMessage(playerid, 0xFFFFFFAA, ""INFOBOJA"INFO: "BIJELA"Ne ste vo vasiot avtomobil.");
}
if(ConfirmSale[playerid] == 0) {
//SendClientMessage(playerid, 0xFFFF00FF, "Jeste li sigutni da zelite prodati biciklu (Koristi /prodajcars jos jednom da ga prodas).");
ConfirmSale[playerid] = 1;
}
new string[128], file[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Cars/%s.ini",name);
GameTextForPlayer(playerid, "~g~Uspesno go prodadovte vasiot avtomobil!", 3000, 3);
format(string, sizeof(string), ""INFOBOJA"INFO: "BIJELA"Go prodadovte vasiot avtomobil za 50 posto, za $%i.", VehicleInfo[playerid][Price]/2);
GivePlayerMoney(playerid, VehicleInfo[playerid][Price]/2);
DestroyVehicle(Vehicle[playerid]);
dini_Remove(file);
Vehicle[playerid] = 0;
gPlayerHasCar[playerid] = 0;
VehicleInfo[playerid][Model] = 0;
VehicleInfo[playerid][Price] = 0;
VehicleInfo[playerid][CarX] = 0;
VehicleInfo[playerid][CarY] = 0;
VehicleInfo[playerid][CarZ] = 0;
VehicleInfo[playerid][CarRot] = 0;
ConfirmSale[playerid] = 0;
SendClientMessage(playerid, 0xFFFF00FF, string);
}
}
}
if(listitem == 3)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerHasCar[playerid] == 1)
{
new Float:vx, Float:vy, Float:vz;
GetVehiclePos(Vehicle[playerid], vx, vy, vz);
SetPlayerCheckpoint(playerid, vx, vy, vz, 10.0);
Checkpoint[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, ""INFOBOJA"INFO: "BIJELA"Odete do crveniot marker!");
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA, ""INFOBOJA"INFO: "BIJELA"Vie ne poseduvate Avtomobil.");
}
}
}
return 1;
}
///
if(dialogid == 669)
{
if(response)
{
new file[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Cars/%s.ini",name);
new veh = GetPlayerVehicleID(playerid);
new money = GetPlayerMoney(playerid);
if(money >= CarPrice[veh])
{
/*RemovePlayerFromVehicle(playerid);
{*/
RemovePlayerFromVehicle(playerid);
if(gPlayerHasCar[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, ""INFOBOJA"INFO: "BIJELA" Veke imate 1 avtomobil!");
new string[64];
SendClientMessage(playerid, 0xAFAFAFAA, "Cestito Kupivte Avtomobil.");
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
dini_Create(file);
Vehicle[playerid] = CreateVehicle(GetVehicleModel(veh), 1459.0154,-2173.8457,13.7221,178.1962, 1, 1, 3600000);
SendClientMessage(playerid, 0xAFAFAFAA, string);
VehicleInfo[playerid][Model] = GetVehicleModel(veh);
VehicleInfo[playerid][Price] = CarPrice[veh];
VehicleInfo[playerid][CarX] = 1459.0154;
VehicleInfo[playerid][CarY] = -2173.8457;
VehicleInfo[playerid][CarZ] = 13.7221;
VehicleInfo[playerid][CarRot] = 178.1962;
gPlayerHasCar[playerid] = 1;
RemovePlayerFromVehicle(playerid);
OwnerID[Vehicle[playerid]] = playerid;
VehPlate[Vehicle[playerid]] = "XYZR 000";
PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
GivePlayerMoney(playerid, -VehicleInfo[playerid][Price]);
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xAFAFAFAA, ""INFOBOJA"INFO: "BIJELA"Nemate dovolno pari za ovoj avtomobil.");
return 1;
}
}
else
{
RemovePlayerFromVehicle(playerid);
}
}
if(dialogid == 670)
{
if(response)
{
new file[256], name[24], license[10];
GetPlayerName(playerid, name, 24);
format(file,sizeof(file),"Cars/%s.ini",name);
dini_IntSet(file, "Model", VehicleInfo[playerid][Model]);
dini_IntSet(file, "Price", VehicleInfo[playerid][Price]);
dini_FloatSet(file, "X", VehicleInfo[playerid][CarX]);
dini_FloatSet(file, "Y", VehicleInfo[playerid][CarY]);
dini_FloatSet(file, "Z", VehicleInfo[playerid][CarZ]);
dini_FloatSet(file, "Rot", VehicleInfo[playerid][CarRot]);
dini_IntSet(file, "Locked", VehicleInfo[playerid][Locked]);
dini_IntSet(file, "mod1", VehicleInfo[playerid][mod1]);
dini_IntSet(file, "mod2", VehicleInfo[playerid][mod2]);
dini_IntSet(file, "mod3", VehicleInfo[playerid][mod3]);
dini_IntSet(file, "mod4", VehicleInfo[playerid][mod4]);
dini_IntSet(file, "mod5", VehicleInfo[playerid][mod5]);
dini_IntSet(file, "mod6", VehicleInfo[playerid][mod6]);
dini_IntSet(file, "mod7", VehicleInfo[playerid][mod7]);
dini_IntSet(file, "mod8", VehicleInfo[playerid][mod8]);
dini_IntSet(file, "mod9", VehicleInfo[playerid][mod9]);
dini_IntSet(file, "mod10", VehicleInfo[playerid][mod10]);
dini_IntSet(file, "mod11", VehicleInfo[playerid][mod11]);
dini_IntSet(file, "mod12", VehicleInfo[playerid][mod12]);
dini_IntSet(file, "mod13", VehicleInfo[playerid][mod13]);
dini_IntSet(file, "mod14", VehicleInfo[playerid][mod14]);
dini_IntSet(file, "mod15", VehicleInfo[playerid][mod15]);
dini_IntSet(file, "mod16", VehicleInfo[playerid][mod16]);
dini_IntSet(file, "mod17", VehicleInfo[playerid][mod17]);
dini_IntSet(file, "paintjob", VehicleInfo[playerid][paintjob]);
dini_IntSet(file, "color1", VehicleInfo[playerid][colora]);
dini_IntSet(file, "color2", VehicleInfo[playerid][colorb]);
new string[128], Float:CarHP, Float:OldCarHP, Float:X, Float:Y, Float:Z, Float:Rot;
new plate = strlen(inputtext);
if(plate < 4) return ShowPlayerDialog(playerid, 670, DIALOG_STYLE_INPUT, "Plate", "Plate must be at least 4 characters.\n\nPlease try again.", "Done", "Cancel");
if(plate > return ShowPlayerDialog(playerid, 670, DIALOG_STYLE_INPUT, "Plate", "Plate must be below 8 characters.\n\nPlease try again.", "Done", "Cancel");
GetVehicleHealth(Vehicle[playerid], CarHP);
OldCarHP = CarHP;
GetVehiclePos(Vehicle[playerid], X, Y, Z);
GetVehicleZAngle(Vehicle[playerid], Rot);
SetVehicleNumberPlate(Vehicle[playerid], inputtext);
SetVehicleToRespawn(Vehicle[playerid]);
SetVehiclePos(Vehicle[playerid], X, Y, Z);
SetVehicleZAngle(Vehicle[playerid], Rot);
PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
format(license, sizeof(license), "%s", inputtext);
VehPlate[Vehicle[playerid]] = license;
dini_Set(file, "Plate", VehPlate[Vehicle[playerid]]);
format(string, sizeof(string), "{FFFF00}You have set your vehicle's plate to:{FFFFFF} %s", inputtext);
SendClientMessage(playerid, 0xFFFFFFFF, string);
SendClientMessage(playerid, 0xFFFFFFFF, "NOTE: Your vehicle's health was restored to the previous amount (to prevent exploitation).");
SetVehicleHealth(Vehicle[playerid], OldCarHP);
VehicleInfo[playerid][Model] = dini_Int(file, "Model");
VehicleInfo[playerid][Price] = dini_Int(file, "Price");
VehicleInfo[playerid][CarX] = dini_Float(file, "X");
VehicleInfo[playerid][CarY] = dini_Float(file, "Y");
VehicleInfo[playerid][CarZ] = dini_Float(file, "Z");
VehicleInfo[playerid][CarRot] = dini_Float(file, "Rot");
VehicleInfo[playerid][Locked] = dini_Int(file, "Locked");
VehicleInfo[playerid][mod1] = dini_Int(file, "mod1");
VehicleInfo[playerid][mod2] = dini_Int(file, "mod2");
VehicleInfo[playerid][mod3] = dini_Int(file, "mod3");
VehicleInfo[playerid][mod4] = dini_Int(file, "mod4");
VehicleInfo[playerid][mod5] = dini_Int(file, "mod5");
VehicleInfo[playerid][mod6] = dini_Int(file, "mod6");
VehicleInfo[playerid][mod7] = dini_Int(file, "mod7");
VehicleInfo[playerid][mod8] = dini_Int(file, "mod8");
VehicleInfo[playerid][mod9] = dini_Int(file, "mod9");
VehicleInfo[playerid][mod10] = dini_Int(file, "mod10");
VehicleInfo[playerid][mod11] = dini_Int(file, "mod11");
VehicleInfo[playerid][mod12] = dini_Int(file, "mod12");
VehicleInfo[playerid][mod13] = dini_Int(file, "mod13");
VehicleInfo[playerid][mod14] = dini_Int(file, "mod14");
VehicleInfo[playerid][mod15] = dini_Int(file, "mod15");
VehicleInfo[playerid][mod16] = dini_Int(file, "mod16");
VehicleInfo[playerid][mod17] = dini_Int(file, "mod17");
VehicleInfo[playerid][paintjob] = dini_Int(file, "paintjob");
VehicleInfo[playerid][colora] = dini_Int(file, "color1");
VehicleInfo[playerid][colorb] = dini_Int(file, "color2");
if(VehicleInfo[playerid][mod1]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod1]); }
if(VehicleInfo[playerid][mod2]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod2]); }
if(VehicleInfo[playerid][mod3]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod3]); }
if(VehicleInfo[playerid][mod4]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod4]); }
if(VehicleInfo[playerid][mod5]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod5]); }
if(VehicleInfo[playerid][mod6]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod6]); }
if(VehicleInfo[playerid][mod7]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod7]); }
if(VehicleInfo[playerid][mod8]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod8]); }
if(VehicleInfo[playerid][mod9]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod9]); }
if(VehicleInfo[playerid][mod10]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod10]); }
if(VehicleInfo[playerid][mod11]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod11]); }
if(VehicleInfo[playerid][mod12]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod12]); }
if(VehicleInfo[playerid][mod13]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod13]); }
if(VehicleInfo[playerid][mod14]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod14]); }
if(VehicleInfo[playerid][mod15]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod15]); }
if(VehicleInfo[playerid][mod16]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod16]); }
if(VehicleInfo[playerid][mod17]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod17]); }
if(VehicleInfo[playerid][colora]!=0 || VehicleInfo[playerid][colorb]!=0)
{
ChangeVehicleColor(Vehicle[playerid],VehicleInfo[playerid][colora],VehicleInfo[playerid][colorb]);
}
if(VehicleInfo[playerid][paintjob]!=0)
{
ChangeVehiclePaintjob(Vehicle[playerid],VehicleInfo[playerid][paintjob]);
}
SetVehicleParamsForPlayer(Vehicle[playerid], playerid, 0, VehicleInfo[playerid][Locked]);
gVehLocked[Vehicle[playerid]] = VehicleInfo[playerid][Locked];
CarHP = 0;
OldCarHP = 0;
return 1;
}
return 1;
}
return 1;
}
[CODE]/*
new v;
#include <a_samp>
#include <dini>
#define DIALOGID 3304
#define BOJA1 0x33CCFFAA
#define BOJA2 0xFF0000AA
#pragma tabsize 0
//-------------------------------0.3c BOJE--------------------------------------
#define SULJA "{FFFF80}"
#define TPLAVA2 "{ADD6FF}"
#define TPLAVA "{0482FF}"
#define SZELENA "{00FF00}"
#define BIJELA "{FFFFFF}"
#define CRNA "{0E0101}"
#define SIVA "{C3C3C3}"
#define ZELENA "{6EF83C}"
#define CRVENA "{F81414}"
#define ZUTA "{F3FF02}"
#define NARANDZASTA "{FFAF00}"
#define LIME "{B7FF00}"
#define CYAN "{00FFEE}"
#define SPLAVA "{00C0FF}"
#define PLAVA "{0049FF}"
#define COL_MAGENTA "{F300FF}"
#define COL_VIOLET "{B700FF}"
#define ROZA "{FF00EA}"
#define COL_MARONE "{A90202}"
#define COL_PARAM "{3FCD02}"
#define COL_VALUE "{A3E4FF}"
#define COL_RULE "{F9E8B7}"
#define COL_RULE2 "{FBDF89}"
#define COL_RWHITE "{FFFFFF}"
#define SVETLO_ZELENA "{C9FFAB}"
#define SVETLO_CRVENA "{FFA1A1}"
#define SVJETLO_CRVENA2 "{C77D87}"
#define INFOBOJA "{37F906}"
#define COL_YELLOW "{F3FF02}"
//------------------------------------------------------------------------------
enum car_info
{
Model,
Price,
Float:CarX,
Float:CarY,
Float:CarZ,
Float:CarRot,
Locked,
mod1,
mod2,
mod3,
mod4,
mod5,
mod6,
mod7,
mod8,
mod9,
mod10,
mod11,
mod12,
mod13,
mod14,
mod15,
mod16,
mod17,
paintjob,
colora,
colorb
};
new VehicleInfo[MAX_PLAYERS][car_info];
new DealerCars[37];
new Text3DealerCar[37];
new Vehicle[MAX_PLAYERS];
new OwnerID[MAX_VEHICLES];
new CarPrice[MAX_VEHICLES];
new VehOwned[MAX_VEHICLES];
new ConfirmSale[MAX_PLAYERS];
new gVehLocked[MAX_VEHICLES];
new VehPlate[MAX_VEHICLES][256];
new gPlayerHasCar[MAX_PLAYERS];
new IsADealerCar[MAX_VEHICLES];
new Checkpoint[MAX_PLAYERS];
new boolestroyed[MAX_VEHICLES];
stock GetVehicleNameFromID(vehicleid)
{
static const scVehicleNames[][18] = {
"Landstalker",
"Bravura",
"Buffalo",
"Linerunner",
"Perrenial",
"Sentinel",
"Dumper",
"Firetruck",
"Trashmaster",
"Stretch",
"Manana",
"Infernus",
"Voodoo",
"Pony",
"Mule",
"Cheetah",
"Ambulance",
"Leviathan",
"Moonbeam",
"Esperanto",
"Taxi",
"Washington",
"Bobcat",
"Mr Whoopee",
"BF Injection",
"Hunter",
"Premier",
"Enforcer",
"Securicar",
"Banshee",
"Predator",
"Bus",
"Rhino",
"Barracks",
"Hotknife",
"Trailer 1",
"Previon",
"Coach",
"Cabbie",
"Stallion",
"Rumpo",
"RC Bandit",
"Romero",
"Packer",
"Monster",
"Admiral",
"Squalo",
"Seasparrow",
"Pizzaboy",
"Tram",
"Trailer 2",
"Turismo",
"Speeder",
"Reefer",
"Tropic",
"Flatbed",
"Yankee",
"Caddy",
"Solair",
"Berkley's RC Van",
"Skimmer",
"PCJ-600",
"Faggio",
"Freeway",
"RC Baron",
"RC Raider",
"Glendale",
"Oceanic",
"Sanchez",
"Sparrow",
"Patriot",
"Quad",
"Coastguard",
"Dinghy",
"Hermes",
"Sabre",
"Rustler",
"ZR-350",
"Walton",
"Regina",
"Comet",
"BMX",
"Burrito",
"Camper",
"Marquis",
"Baggage",
"Dozer",
"Maverick",
"News Chopper",
"Rancher",
"FBI Rancher",
"Virgo",
"Greenwood",
"Jetmax",
"Hotring",
"Sandking",
"Blista Compact",
"Police Maverick",
"Boxville",
"Benson",
"Mesa",
"RC Goblin",
"Hotring Racer A",
"Hotring Racer B",
"Bloodring Banger",
"Rancher",
"Super GT",
"Elegant",
"Journey",
"Bike",
"Mountain Bike",
"Beagle",
"Cropdust",
"Stunt",
"Tanker",
"Roadtrain",
"Nebula",
"Majestic",
"Buccaneer",
"Shamal",
"Hydra",
"FCR-900",
"NRG-500",
"HPV1000",
"Cement Truck",
"Tow Truck",
"Fortune",
"Cadrona",
"FBI Truck",
"Willard",
"Forklift",
"Tractor",
"Combine",
"Feltzer",
"Remington",
"Slamvan",
"Blade",
"Freight",
"Streak",
"Vortex",
"Vincent",
"Bullet",
"Clover",
"Sadler",
"Firetruck LA",
"Hustler",
"Intruder",
"Primo",
"Cargobob",
"Tampa",
"Sunrise",
"Merit",
"Utility",
"Nevada",
"Yosemite",
"Windsor",
"Monster A",
"Monster B",
"Uranus",
"Jester",
"Sultan",
"Stratum",
"Elegy",
"Raindance",
"RC Tiger",
"Flash",
"Tahoma",
"Savanna",
"Bandito",
"Freight Flat",
"Streak Carriage",
"Kart",
"Mower",
"Duneride",
"Sweeper",
"Broadway",
"Tornado",
"AT-400",
"DFT-30",
"Huntley",
"Stafford",
"BF-400",
"Newsvan",
"Tug",
"Trailer 3",
"Emperor",
"Wayfarer",
"Euros",
"Hotdog",
"Club",
"Freight Carriage",
"Trailer 3",
"Andromada",
"Dodo",
"RC Cam",
"Launch",
"LS Police Car",
"SF Police Car",
"LV Police Car",
"Police Ranger",
"Picador",
"S.W.A.T. Van",
"Alpha",
"Phoenix",
"Glendale",
"Sadler",
"Luggage Trailer A",
"Luggage Trailer B",
"Stair Trailer",
"Boxville",
"Farm Plow",
"Utility Trailer"
},
scOnFoot[18] = "OnFoot";
if (vehicleid > 0) {
return scVehicleNames[GetVehicleModel(vehicleid) - 400];
}
else {
return scOnFoot;
}
}
public OnGameModeInit()
{
return 1;
}
public OnFilterScriptInit()
{
DealerCars[0] = AddStaticVehicleEx(579,1460.90002441,-2348.30004883,13.60000038,0.00000000,1,-1,15); //Huntley
DealerCars[1] = AddStaticVehicleEx(495,1457.69995117,-2348.39990234,14.10000038,0.00000000,1,-1,15); //Sandking
DealerCars[2] = AddStaticVehicleEx(400,1454.19995117,-2348.10009766,13.69999981,0.00000000,1,54,15); //Landstalker
DealerCars[3] = AddStaticVehicleEx(500,1451.09997559,-2348.30004883,13.80000019,0.00000000,1,1,15); //Mesa
DealerCars[4] = AddStaticVehicleEx(489,1448.00000000,-2347.60009766,13.89999962,0.00000000,1,-1,15); //Rancher
DealerCars[5] = AddStaticVehicleEx(589,1438.09997559,-2347.10009766,13.30000019,0.00000000,87,87,15); //Club
DealerCars[6] = AddStaticVehicleEx(554,1444.50000000,-2347.19995117,13.69999981,0.00000000,1,1,15); //Yosemite
DealerCars[7] = AddStaticVehicleEx(587,1441.40002441,-2347.39990234,13.39999962,0.00000000,1,1,15); //Euros
DealerCars[8] = AddStaticVehicleEx(560,1384.90002441,-2364.50000000,13.39999962,0.00000000,53,53,15); //Sultan
DealerCars[9] = AddStaticVehicleEx(562,1388.40002441,-2364.80004883,13.30000019,0.00000000,53,53,15); //Elegy
DealerCars[10] = AddStaticVehicleEx(565,1391.50000000,-2364.69995117,13.19999981,0.00000000,53,53,15); //Flash
DealerCars[11] = AddStaticVehicleEx(559,1394.80004883,-2364.89990234,13.30000019,0.00000000,53,53,15); //Jester
DealerCars[12] = AddStaticVehicleEx(558,1398.09997559,-2364.60009766,13.30000019,0.00000000,53,53,15); //Uranus
DealerCars[13] = AddStaticVehicleEx(534,1401.40002441,-2364.69995117,13.39999962,0.00000000,53,53,15); //Remington
DealerCars[14] = AddStaticVehicleEx(535,1404.69995117,-2364.60009766,13.39999962,0.00000000,53,53,15); //Slamvan
DealerCars[15] = AddStaticVehicleEx(536,1408.00000000,-2364.30004883,13.39999962,0.00000000,53,53,15); //Blade
DealerCars[16] = AddStaticVehicleEx(567,1411.19995117,-2364.50000000,13.50000000,0.00000000,53,53,15); //Savanna
DealerCars[17] = AddStaticVehicleEx(561,1385.09997559,-2347.39990234,13.50000000,0.00000000,51,51,15); //Stratum
DealerCars[18] = AddStaticVehicleEx(507,1388.40002441,-2347.10009766,13.50000000,0.00000000,51,51,15); //Elegant
DealerCars[19] = AddStaticVehicleEx(550,1391.59997559,-2347.19995117,13.50000000,0.00000000,51,51,15); //Sunrise
DealerCars[20] = AddStaticVehicleEx(551,1395.00000000,-2347.10009766,13.39999962,0.00000000,51,51,15); //Merit
DealerCars[21] = AddStaticVehicleEx(402,1398.09997559,-2347.10009766,13.50000000,0.00000000,51,51,15); //Buffalo
DealerCars[22] = AddStaticVehicleEx(477,1401.40002441,-2347.30004883,13.39999962,0.00000000,51,51,15); //ZR-350
DealerCars[23] = AddStaticVehicleEx(555,1411.19995117,-2347.60009766,13.30000019,0.00000000,51,51,15); //Windsor
DealerCars[24] = AddStaticVehicleEx(602,1404.90002441,-2347.39990234,13.39999962,0.00000000,51,51,15); //Alpha
DealerCars[25] = AddStaticVehicleEx(603,1408.00000000,-2347.30004883,13.50000000,0.00000000,51,51,15); //Phoenix
DealerCars[26] = AddStaticVehicleEx(527,1415.00000000,-2347.50000000,13.30000019,0.00000000,51,51,15); //Cadrona
DealerCars[27] = AddStaticVehicleEx(533,1411.30004883,-2330.50000000,13.30000019,0.00000000,6,6,15); //Feltzer
DealerCars[28] = AddStaticVehicleEx(545,1407.90002441,-2330.39990234,13.50000000,0.00000000,53,53,15); //Hustler
DealerCars[29] = AddStaticVehicleEx(541,1385.19995117,-2314.30004883,13.19999981,0.00000000,1,86,15); //Bullet
DealerCars[30] = AddStaticVehicleEx(429,1388.50000000,-2314.19995117,13.30000019,0.00000000,1,86,15); //Banshee
DealerCars[31] = AddStaticVehicleEx(415,1391.59997559,-2314.30004883,13.39999962,0.00000000,1,1,15); //Cheetah
DealerCars[32] = AddStaticVehicleEx(506,1394.69995117,-2314.10009766,13.30000019,0.00000000,1,1,15); //Super GT
DealerCars[33] = AddStaticVehicleEx(451,1398.09997559,-2314.10009766,13.30000019,0.00000000,1,1,15); //Turismo
DealerCars[34] = AddStaticVehicleEx(480,1401.40002441,-2314.00000000,13.39999962,0.00000000,1,1,15); //Comet
DealerCars[35] = AddStaticVehicleEx(556,1411.19995117,-2313.60009766,14.50000000,0.00000000,-1,-1,15); //Monster A
DealerCars[36] = AddStaticVehicleEx(411,1408.00000000,-2313.80004883,13.30000019,0.00000000,1,1,15); //Infernus
IsADealerCar[DealerCars[0]] = true;
IsADealerCar[DealerCars[1]] = true;
IsADealerCar[DealerCars[2]] = true;
IsADealerCar[DealerCars[3]] = true;
IsADealerCar[DealerCars[4]] = true;
IsADealerCar[DealerCars[5]] = true;
IsADealerCar[DealerCars[6]] = true;
IsADealerCar[DealerCars[7]] = true;
IsADealerCar[DealerCars[8]] = true;
IsADealerCar[DealerCars[9]] = true;
IsADealerCar[DealerCars[10]] = true;
IsADealerCar[DealerCars[11]] = true;
IsADealerCar[DealerCars[12]] = true;
IsADealerCar[DealerCars[13]] = true;
IsADealerCar[DealerCars[14]] = true;
IsADealerCar[DealerCars[15]] = true;
IsADealerCar[DealerCars[16]] = true;
IsADealerCar[DealerCars[17]] = true;
IsADealerCar[DealerCars[18]] = true;
IsADealerCar[DealerCars[19]] = true;
IsADealerCar[DealerCars[20]] = true;
IsADealerCar[DealerCars[21]] = true;
IsADealerCar[DealerCars[22]] = true;
IsADealerCar[DealerCars[23]] = true;
IsADealerCar[DealerCars[24]] = true;
IsADealerCar[DealerCars[25]] = true;
IsADealerCar[DealerCars[26]] = true;
IsADealerCar[DealerCars[27]] = true;
IsADealerCar[DealerCars[28]] = true;
IsADealerCar[DealerCars[29]] = true;
IsADealerCar[DealerCars[30]] = true;
IsADealerCar[DealerCars[31]] = true;
IsADealerCar[DealerCars[32]] = true;
IsADealerCar[DealerCars[33]] = true;
IsADealerCar[DealerCars[34]] = true;
IsADealerCar[DealerCars[35]] = true;
IsADealerCar[DealerCars[36]] = true;
CarPrice[DealerCars[0]] = 200000;
CarPrice[DealerCars[1]] = 800000;
CarPrice[DealerCars[2]] = 500000;
CarPrice[DealerCars[3]] = 300000;
CarPrice[DealerCars[4]] = 900000;
CarPrice[DealerCars[5]] = 452000;
CarPrice[DealerCars[6]] = 452000;
CarPrice[DealerCars[7]] = 652000;
CarPrice[DealerCars[8]] = 900000;
CarPrice[DealerCars[9]] = 752000;
CarPrice[DealerCars[10]] = 752000;
CarPrice[DealerCars[11]] = 852000;
CarPrice[DealerCars[12]] = 752000;
CarPrice[DealerCars[13]] = 752000;
CarPrice[DealerCars[14]] = 752000;
CarPrice[DealerCars[15]] = 900000;
CarPrice[DealerCars[16]] = 900000;
CarPrice[DealerCars[17]] = 652000;
CarPrice[DealerCars[18]] = 600000;
CarPrice[DealerCars[19]] = 752000;
CarPrice[DealerCars[20]] = 752000;
CarPrice[DealerCars[21]] = 1000000;
CarPrice[DealerCars[22]] = 900000;
CarPrice[DealerCars[23]] = 752000;
CarPrice[DealerCars[24]] = 600000;
CarPrice[DealerCars[25]] = 852000;
CarPrice[DealerCars[26]] = 750000;
CarPrice[DealerCars[27]] = 750000;
CarPrice[DealerCars[28]] = 750000;
CarPrice[DealerCars[29]] = 1100000;
CarPrice[DealerCars[30]] = 1300000;
CarPrice[DealerCars[31]] = 900000;
CarPrice[DealerCars[32]] = 900000;
CarPrice[DealerCars[33]] = 1200000;
CarPrice[DealerCars[34]] = 900000;
CarPrice[DealerCars[35]] = 3000000;
CarPrice[DealerCars[36]] = 2000000;
return 1;
}
public OnFilterScriptExit()
{
IsADealerCar[DealerCars[0]] = false;
IsADealerCar[DealerCars[1]] = false;
IsADealerCar[DealerCars[2]] = false;
IsADealerCar[DealerCars[3]] = false;
IsADealerCar[DealerCars[4]] = false;
IsADealerCar[DealerCars[5]] = false;
IsADealerCar[DealerCars[6]] = false;
IsADealerCar[DealerCars[7]] = false;
IsADealerCar[DealerCars[8]] = false;
IsADealerCar[DealerCars[9]] = false;
IsADealerCar[DealerCars[10]] = false;
IsADealerCar[DealerCars[11]] = false;
IsADealerCar[DealerCars[12]] = false;
IsADealerCar[DealerCars[13]] = false;
IsADealerCar[DealerCars[14]] = false;
IsADealerCar[DealerCars[15]] = false;
IsADealerCar[DealerCars[16]] = false;
IsADealerCar[DealerCars[17]] = false;
IsADealerCar[DealerCars[18]] = false;
IsADealerCar[DealerCars[19]] = false;
IsADealerCar[DealerCars[20]] = false;
IsADealerCar[DealerCars[21]] = false;
IsADealerCar[DealerCars[22]] = false;
IsADealerCar[DealerCars[23]] = false;
IsADealerCar[DealerCars[24]] = false;
IsADealerCar[DealerCars[25]] = false;
IsADealerCar[DealerCars[26]] = false;
IsADealerCar[DealerCars[27]] = false;
IsADealerCar[DealerCars[28]] = false;
IsADealerCar[DealerCars[29]] = false;
IsADealerCar[DealerCars[30]] = false;
IsADealerCar[DealerCars[31]] = false;
IsADealerCar[DealerCars[32]] = false;
IsADealerCar[DealerCars[33]] = false;
IsADealerCar[DealerCars[34]] = false;
IsADealerCar[DealerCars[35]] = false;
IsADealerCar[DealerCars[36]] = false;
CarPrice[DealerCars[0]] = 0;
CarPrice[DealerCars[1]] = 0;
CarPrice[DealerCars[2]] = 0;
CarPrice[DealerCars[3]] = 0;
CarPrice[DealerCars[4]] = 0;
CarPrice[DealerCars[5]] = 0;
CarPrice[DealerCars[6]] = 0;
CarPrice[DealerCars[7]] = 0;
CarPrice[DealerCars[8]] = 0;
CarPrice[DealerCars[9]] = 0;
CarPrice[DealerCars[10]] = 0;
CarPrice[DealerCars[11]] = 0;
CarPrice[DealerCars[12]] = 0;
CarPrice[DealerCars[13]] = 0;
CarPrice[DealerCars[14]] = 0;
CarPrice[DealerCars[15]] = 0;
CarPrice[DealerCars[16]] = 0;
CarPrice[DealerCars[17]] = 0;
CarPrice[DealerCars[18]] = 0;
CarPrice[DealerCars[19]] = 0;
CarPrice[DealerCars[20]] = 0;
CarPrice[DealerCars[21]] = 0;
CarPrice[DealerCars[22]] = 0;
CarPrice[DealerCars[23]] = 0;
CarPrice[DealerCars[24]] = 0;
CarPrice[DealerCars[25]] = 0;
CarPrice[DealerCars[26]] = 0;
CarPrice[DealerCars[27]] = 0;
CarPrice[DealerCars[28]] = 0;
CarPrice[DealerCars[29]] = 0;
CarPrice[DealerCars[30]] = 0;
CarPrice[DealerCars[31]] = 0;
CarPrice[DealerCars[32]] = 0;
CarPrice[DealerCars[33]] = 0;
CarPrice[DealerCars[34]] = 0;
CarPrice[DealerCars[35]] = 0;
CarPrice[DealerCars[36]] = 0;
DestroyVehicle(DealerCars[0]);
DestroyVehicle(DealerCars[1]);
DestroyVehicle(DealerCars[2]);
DestroyVehicle(DealerCars[3]);
DestroyVehicle(DealerCars[4]);
DestroyVehicle(DealerCars[5]);
DestroyVehicle(DealerCars[6]);
DestroyVehicle(DealerCars[7]);
DestroyVehicle(DealerCars[8]);
DestroyVehicle(DealerCars[9]);
DestroyVehicle(DealerCars[10]);
DestroyVehicle(DealerCars[11]);
DestroyVehicle(DealerCars[12]);
DestroyVehicle(DealerCars[13]);
DestroyVehicle(DealerCars[14]);
DestroyVehicle(DealerCars[15]);
DestroyVehicle(DealerCars[16]);
DestroyVehicle(DealerCars[17]);
DestroyVehicle(DealerCars[18]);
DestroyVehicle(DealerCars[19]);
DestroyVehicle(DealerCars[20]);
DestroyVehicle(DealerCars[21]);
DestroyVehicle(DealerCars[22]);
DestroyVehicle(DealerCars[23]);
DestroyVehicle(DealerCars[24]);
DestroyVehicle(DealerCars[25]);
DestroyVehicle(DealerCars[26]);
DestroyVehicle(DealerCars[27]);
DestroyVehicle(DealerCars[28]);
DestroyVehicle(DealerCars[29]);
DestroyVehicle(DealerCars[30]);
DestroyVehicle(DealerCars[31]);
DestroyVehicle(DealerCars[32]);
DestroyVehicle(DealerCars[33]);
DestroyVehicle(DealerCars[34]);
DestroyVehicle(DealerCars[35]);
DestroyVehicle(DealerCars[36]);
return 1;
}
public OnPlayerConnect(playerid)
{
new file[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Cars/%s.ini",name);
if(dini_Exists(file))
{
VehicleInfo[playerid][Model] = dini_Int(file, "Model");
VehicleInfo[playerid][Price] = dini_Int(file, "Price");
VehicleInfo[playerid][CarX] = dini_Float(file, "X");
VehicleInfo[playerid][CarY] = dini_Float(file, "Y");
VehicleInfo[playerid][CarZ] = dini_Float(file, "Z");
VehicleInfo[playerid][CarRot] = dini_Float(file, "Rot");
VehicleInfo[playerid][Locked] = dini_Int(file, "Locked");
VehicleInfo[playerid][mod1] = dini_Int(file, "mod1");
VehicleInfo[playerid][mod2] = dini_Int(file, "mod2");
VehicleInfo[playerid][mod3] = dini_Int(file, "mod3");
VehicleInfo[playerid][mod4] = dini_Int(file, "mod4");
VehicleInfo[playerid][mod5] = dini_Int(file, "mod5");
VehicleInfo[playerid][mod6] = dini_Int(file, "mod6");
VehicleInfo[playerid][mod7] = dini_Int(file, "mod7");
VehicleInfo[playerid][mod8] = dini_Int(file, "mod8");
VehicleInfo[playerid][mod9] = dini_Int(file, "mod9");
VehicleInfo[playerid][mod10] = dini_Int(file, "mod10");
VehicleInfo[playerid][mod11] = dini_Int(file, "mod11");
VehicleInfo[playerid][mod12] = dini_Int(file, "mod12");
VehicleInfo[playerid][mod13] = dini_Int(file, "mod13");
VehicleInfo[playerid][mod14] = dini_Int(file, "mod14");
VehicleInfo[playerid][mod15] = dini_Int(file, "mod15");
VehicleInfo[playerid][mod16] = dini_Int(file, "mod16");
VehicleInfo[playerid][mod17] = dini_Int(file, "mod17");
VehicleInfo[playerid][paintjob] = dini_Int(file, "paintjob");
VehicleInfo[playerid][colora] = dini_Int(file, "color1");
VehicleInfo[playerid][colorb] = dini_Int(file, "color2");
Vehicle[playerid] = CreateVehicle(VehicleInfo[playerid][Model], VehicleInfo[playerid][CarX], VehicleInfo[playerid][CarY], VehicleInfo[playerid][CarZ], VehicleInfo[playerid][CarRot], -1, -1, 3600000);
if(VehicleInfo[playerid][mod1]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod1]); }
if(VehicleInfo[playerid][mod2]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod2]); }
if(VehicleInfo[playerid][mod3]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod3]); }
if(VehicleInfo[playerid][mod4]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod4]); }
if(VehicleInfo[playerid][mod5]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod5]); }
if(VehicleInfo[playerid][mod6]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod6]); }
if(VehicleInfo[playerid][mod7]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod7]); }
if(VehicleInfo[playerid][mod8]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod8]); }
if(VehicleInfo[playerid][mod9]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod9]); }
if(VehicleInfo[playerid][mod10]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod10]); }
if(VehicleInfo[playerid][mod11]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod11]); }
if(VehicleInfo[playerid][mod12]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod12]); }
if(VehicleInfo[playerid][mod13]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod13]); }
if(VehicleInfo[playerid][mod14]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod14]); }
if(VehicleInfo[playerid][mod15]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod15]); }
if(VehicleInfo[playerid][mod16]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod16]); }
if(VehicleInfo[playerid][mod17]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod17]); }
if(VehicleInfo[playerid][colora]!=0 || VehicleInfo[playerid][colorb]!=0)
{
ChangeVehicleColor(Vehicle[playerid],VehicleInfo[playerid][colora],VehicleInfo[playerid][colorb]);
}
if(VehicleInfo[playerid][paintjob]!=0)
{
ChangeVehiclePaintjob(Vehicle[playerid],VehicleInfo[playerid][paintjob]);
}
new tmp[256]; tmp = dini_Get(file, "Plate");
gPlayerHasCar[playerid] = 1;
VehOwned[Vehicle[playerid]] = 1;
OwnerID[Vehicle[playerid]] = playerid;
SetVehicleParamsForPlayer(Vehicle[playerid], playerid, 0, VehicleInfo[playerid][Locked]);
gVehLocked[Vehicle[playerid]] = VehicleInfo[playerid][Locked];
SetVehicleNumberPlate(Vehicle[playerid], tmp);
VehPlate[Vehicle[playerid]] = tmp;
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
new file[256], name[24];
GetPlayerName(playerid, name, 24);
format(file,sizeof(file),"Cars/%s.ini",name);
if(dini_Exists(file))
{
dini_IntSet(file, "Model", GetVehicleModel(Vehicle[playerid]));
dini_IntSet(file, "Price", VehicleInfo[playerid][Price]);
dini_FloatSet(file, "X", VehicleInfo[playerid][CarX]);
dini_FloatSet(file, "Y", VehicleInfo[playerid][CarY]);
dini_FloatSet(file, "Z", VehicleInfo[playerid][CarZ]);
dini_FloatSet(file, "Rot", VehicleInfo[playerid][CarRot]);
dini_IntSet(file, "Locked", VehicleInfo[playerid][Locked]);
dini_Set(file, "Plate", VehPlate[Vehicle[playerid]]);
dini_IntSet(file, "mod1", VehicleInfo[playerid][mod1]);
dini_IntSet(file, "mod2", VehicleInfo[playerid][mod2]);
dini_IntSet(file, "mod3", VehicleInfo[playerid][mod3]);
dini_IntSet(file, "mod4", VehicleInfo[playerid][mod4]);
dini_IntSet(file, "mod5", VehicleInfo[playerid][mod5]);
dini_IntSet(file, "mod6", VehicleInfo[playerid][mod6]);
dini_IntSet(file, "mod7", VehicleInfo[playerid][mod7]);
dini_IntSet(file, "mod8", VehicleInfo[playerid][mod8]);
dini_IntSet(file, "mod9", VehicleInfo[playerid][mod9]);
dini_IntSet(file, "mod10", VehicleInfo[playerid][mod10]);
dini_IntSet(file, "mod11", VehicleInfo[playerid][mod11]);
dini_IntSet(file, "mod12", VehicleInfo[playerid][mod12]);
dini_IntSet(file, "mod13", VehicleInfo[playerid][mod13]);
dini_IntSet(file, "mod14", VehicleInfo[playerid][mod14]);
dini_IntSet(file, "mod15", VehicleInfo[playerid][mod15]);
dini_IntSet(file, "mod16", VehicleInfo[playerid][mod16]);
dini_IntSet(file, "mod17", VehicleInfo[playerid][mod17]);
dini_IntSet(file, "paintjob", VehicleInfo[playerid][paintjob]);
dini_IntSet(file, "color1", VehicleInfo[playerid][colora]);
dini_IntSet(file, "color2", VehicleInfo[playerid][colorb]);
DestroyVehicle(Vehicle[playerid]);
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(playerid);
if(VehOwned[veh] == 0)
{
if(IsADealerCar[veh] == 1)
{
new string[128];
format(string, sizeof(string), ""TPLAVA2"Sakate li da go kupite %s za $%i?", GetVehicleNameFromID(veh), CarPrice[veh]);
ShowPlayerDialog(playerid, 669, DIALOG_STYLE_MSGBOX, "Avto Salon", string, "Da", "Ne");
return 1;
}
}
else if(VehOwned[veh] == 1)
{
new owner[24], string[128];
GetPlayerName(OwnerID[veh], owner, sizeof(owner));
format(string, sizeof(string), ""TPLAVA2"Avtomobil: %s {F3FF02}Gazda: %s.", GetVehicleNameFromID(veh), owner);
SendClientMessage(playerid, 0xFFFF00AA, string);
return 1;
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 3304)
{
if(response)
{
//-------------/LOCKcars-------------
if(listitem == 0)
{
if(gPlayerHasCar[playerid] == 1)
{
new veh, Float:vehx, Float:vehy, Float:vehz;
veh = Vehicle[playerid];
GetVehiclePos(veh, vehx, vehy, vehz);
if(IsPlayerInRangeOfPoint(playerid, 3.0, vehx, vehy, vehz))
{
if(VehicleInfo[playerid][Locked] == 0)
{
SetVehicleParamsForPlayer(veh, playerid, 0, 1);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~r~Avtomobil zaklucen!", 3000, 3);
VehicleInfo[playerid][Locked] = 1;
gVehLocked[v] = 1;
return 1;
}
if(VehicleInfo[playerid][Locked] == 1)
{
SetVehicleParamsForPlayer(veh, playerid, 0, 0);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~g~Avtomobil otklucen!", 3000, 3);
VehicleInfo[playerid][Locked] = 0;
gVehLocked[v] = 0;
return 1;
}
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA, ""INFOBOJA"INFO: "BIJELA"Ne ste do vasiot avtomobil.");
return 1;
}
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA, ""INFOBOJA"INFO: "BIJELA"Vie neposeduvate Avtomobil.");
}
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z, Float:Rot;
if(!IsPlayerInVehicle(playerid, Vehicle[playerid]))
{
SendClientMessage(playerid, 0xFFFFFFAA, ""INFOBOJA"INFO: "BIJELA"Ne ste vo vasiot avtomobil.");
return 1;
}
new file[256], name[24];
GetPlayerName(playerid, name, 24);
format(file,sizeof(file),"Cars/%s.ini",name);
dini_IntSet(file, "Model", VehicleInfo[playerid][Model]);
dini_IntSet(file, "Price", VehicleInfo[playerid][Price]);
dini_FloatSet(file, "X", VehicleInfo[playerid][CarX]);
dini_FloatSet(file, "Y", VehicleInfo[playerid][CarY]);
dini_FloatSet(file, "Z", VehicleInfo[playerid][CarZ]);
dini_FloatSet(file, "Rot", VehicleInfo[playerid][CarRot]);
dini_IntSet(file, "Locked", VehicleInfo[playerid][Locked]);
dini_IntSet(file, "paintjob", VehicleInfo[playerid][paintjob]);
dini_IntSet(file, "color1", VehicleInfo[playerid][colora]);
dini_IntSet(file, "color1", VehicleInfo[playerid][colorb]);
SendClientMessage(playerid, 0xFFFF00FF, ""INFOBOJA"INFO: "BIJELA"Go parkiravte vasiot avtomobil na ovoa mesto.");
GetVehiclePos(Vehicle[playerid], X, Y, Z);
GetVehicleZAngle(Vehicle[playerid], Rot);
VehicleInfo[playerid][Model] = GetVehicleModel(playerid);
VehicleInfo[playerid][CarX] = X;
VehicleInfo[playerid][CarY] = Y;
VehicleInfo[playerid][CarZ] = Z;
VehicleInfo[playerid][CarRot] = Rot;
return 1;
}
if(listitem == 2)
{
if(IsPlayerConnected(playerid))
{
if(!IsPlayerInVehicle(playerid, Vehicle[playerid]))
{
SendClientMessage(playerid, 0xFFFFFFAA, ""INFOBOJA"INFO: "BIJELA"Ne ste vo vasiot avtomobil.");
}
if(ConfirmSale[playerid] == 0) {
//SendClientMessage(playerid, 0xFFFF00FF, "Jeste li sigutni da zelite prodati biciklu (Koristi /prodajcars jos jednom da ga prodas).");
ConfirmSale[playerid] = 1;
}
new string[128], file[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Cars/%s.ini",name);
GameTextForPlayer(playerid, "~g~Uspesno go prodadovte vasiot avtomobil!", 3000, 3);
format(string, sizeof(string), ""INFOBOJA"INFO: "BIJELA"Go prodadovte vasiot avtomobil za 50 posto, za $%i.", VehicleInfo[playerid][Price]/2);
GivePlayerMoney(playerid, VehicleInfo[playerid][Price]/2);
DestroyVehicle(Vehicle[playerid]);
dini_Remove(file);
Vehicle[playerid] = 0;
gPlayerHasCar[playerid] = 0;
VehicleInfo[playerid][Model] = 0;
VehicleInfo[playerid][Price] = 0;
VehicleInfo[playerid][CarX] = 0;
VehicleInfo[playerid][CarY] = 0;
VehicleInfo[playerid][CarZ] = 0;
VehicleInfo[playerid][CarRot] = 0;
ConfirmSale[playerid] = 0;
SendClientMessage(playerid, 0xFFFF00FF, string);
}
}
}
if(listitem == 3)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerHasCar[playerid] == 1)
{
new Float:vx, Float:vy, Float:vz;
GetVehiclePos(Vehicle[playerid], vx, vy, vz);
SetPlayerCheckpoint(playerid, vx, vy, vz, 10.0);
Checkpoint[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, ""INFOBOJA"INFO: "BIJELA"Odete do crveniot marker!");
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA, ""INFOBOJA"INFO: "BIJELA"Vie ne poseduvate Avtomobil.");
}
}
}
return 1;
}
///
if(dialogid == 669)
{
if(response)
{
new file[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Cars/%s.ini",name);
new veh = GetPlayerVehicleID(playerid);
new money = GetPlayerMoney(playerid);
if(money >= CarPrice[veh])
{
/*RemovePlayerFromVehicle(playerid);
{*/
RemovePlayerFromVehicle(playerid);
if(gPlayerHasCar[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, ""INFOBOJA"INFO: "BIJELA" Veke imate 1 avtomobil!");
new string[64];
SendClientMessage(playerid, 0xAFAFAFAA, "Cestito Kupivte Avtomobil.");
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
dini_Create(file);
Vehicle[playerid] = CreateVehicle(GetVehicleModel(veh), 1459.0154,-2173.8457,13.7221,178.1962, 1, 1, 3600000);
SendClientMessage(playerid, 0xAFAFAFAA, string);
VehicleInfo[playerid][Model] = GetVehicleModel(veh);
VehicleInfo[playerid][Price] = CarPrice[veh];
VehicleInfo[playerid][CarX] = 1459.0154;
VehicleInfo[playerid][CarY] = -2173.8457;
VehicleInfo[playerid][CarZ] = 13.7221;
VehicleInfo[playerid][CarRot] = 178.1962;
gPlayerHasCar[playerid] = 1;
RemovePlayerFromVehicle(playerid);
OwnerID[Vehicle[playerid]] = playerid;
VehPlate[Vehicle[playerid]] = "XYZR 000";
PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
GivePlayerMoney(playerid, -VehicleInfo[playerid][Price]);
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xAFAFAFAA, ""INFOBOJA"INFO: "BIJELA"Nemate dovolno pari za ovoj avtomobil.");
return 1;
}
}
else
{
RemovePlayerFromVehicle(playerid);
}
}
if(dialogid == 670)
{
if(response)
{
new file[256], name[24], license[10];
GetPlayerName(playerid, name, 24);
format(file,sizeof(file),"Cars/%s.ini",name);
dini_IntSet(file, "Model", VehicleInfo[playerid][Model]);
dini_IntSet(file, "Price", VehicleInfo[playerid][Price]);
dini_FloatSet(file, "X", VehicleInfo[playerid][CarX]);
dini_FloatSet(file, "Y", VehicleInfo[playerid][CarY]);
dini_FloatSet(file, "Z", VehicleInfo[playerid][CarZ]);
dini_FloatSet(file, "Rot", VehicleInfo[playerid][CarRot]);
dini_IntSet(file, "Locked", VehicleInfo[playerid][Locked]);
dini_IntSet(file, "mod1", VehicleInfo[playerid][mod1]);
dini_IntSet(file, "mod2", VehicleInfo[playerid][mod2]);
dini_IntSet(file, "mod3", VehicleInfo[playerid][mod3]);
dini_IntSet(file, "mod4", VehicleInfo[playerid][mod4]);
dini_IntSet(file, "mod5", VehicleInfo[playerid][mod5]);
dini_IntSet(file, "mod6", VehicleInfo[playerid][mod6]);
dini_IntSet(file, "mod7", VehicleInfo[playerid][mod7]);
dini_IntSet(file, "mod8", VehicleInfo[playerid][mod8]);
dini_IntSet(file, "mod9", VehicleInfo[playerid][mod9]);
dini_IntSet(file, "mod10", VehicleInfo[playerid][mod10]);
dini_IntSet(file, "mod11", VehicleInfo[playerid][mod11]);
dini_IntSet(file, "mod12", VehicleInfo[playerid][mod12]);
dini_IntSet(file, "mod13", VehicleInfo[playerid][mod13]);
dini_IntSet(file, "mod14", VehicleInfo[playerid][mod14]);
dini_IntSet(file, "mod15", VehicleInfo[playerid][mod15]);
dini_IntSet(file, "mod16", VehicleInfo[playerid][mod16]);
dini_IntSet(file, "mod17", VehicleInfo[playerid][mod17]);
dini_IntSet(file, "paintjob", VehicleInfo[playerid][paintjob]);
dini_IntSet(file, "color1", VehicleInfo[playerid][colora]);
dini_IntSet(file, "color2", VehicleInfo[playerid][colorb]);
new string[128], Float:CarHP, Float:OldCarHP, Float:X, Float:Y, Float:Z, Float:Rot;
new plate = strlen(inputtext);
if(plate < 4) return ShowPlayerDialog(playerid, 670, DIALOG_STYLE_INPUT, "Plate", "Plate must be at least 4 characters.\n\nPlease try again.", "Done", "Cancel");
if(plate > return ShowPlayerDialog(playerid, 670, DIALOG_STYLE_INPUT, "Plate", "Plate must be below 8 characters.\n\nPlease try again.", "Done", "Cancel");
GetVehicleHealth(Vehicle[playerid], CarHP);
OldCarHP = CarHP;
GetVehiclePos(Vehicle[playerid], X, Y, Z);
GetVehicleZAngle(Vehicle[playerid], Rot);
SetVehicleNumberPlate(Vehicle[playerid], inputtext);
SetVehicleToRespawn(Vehicle[playerid]);
SetVehiclePos(Vehicle[playerid], X, Y, Z);
SetVehicleZAngle(Vehicle[playerid], Rot);
PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
format(license, sizeof(license), "%s", inputtext);
VehPlate[Vehicle[playerid]] = license;
dini_Set(file, "Plate", VehPlate[Vehicle[playerid]]);
format(string, sizeof(string), "{FFFF00}You have set your vehicle's plate to:{FFFFFF} %s", inputtext);
SendClientMessage(playerid, 0xFFFFFFFF, string);
SendClientMessage(playerid, 0xFFFFFFFF, "NOTE: Your vehicle's health was restored to the previous amount (to prevent exploitation).");
SetVehicleHealth(Vehicle[playerid], OldCarHP);
VehicleInfo[playerid][Model] = dini_Int(file, "Model");
VehicleInfo[playerid][Price] = dini_Int(file, "Price");
VehicleInfo[playerid][CarX] = dini_Float(file, "X");
VehicleInfo[playerid][CarY] = dini_Float(file, "Y");
VehicleInfo[playerid][CarZ] = dini_Float(file, "Z");
VehicleInfo[playerid][CarRot] = dini_Float(file, "Rot");
VehicleInfo[playerid][Locked] = dini_Int(file, "Locked");
VehicleInfo[playerid][mod1] = dini_Int(file, "mod1");
VehicleInfo[playerid][mod2] = dini_Int(file, "mod2");
VehicleInfo[playerid][mod3] = dini_Int(file, "mod3");
VehicleInfo[playerid][mod4] = dini_Int(file, "mod4");
VehicleInfo[playerid][mod5] = dini_Int(file, "mod5");
VehicleInfo[playerid][mod6] = dini_Int(file, "mod6");
VehicleInfo[playerid][mod7] = dini_Int(file, "mod7");
VehicleInfo[playerid][mod8] = dini_Int(file, "mod8");
VehicleInfo[playerid][mod9] = dini_Int(file, "mod9");
VehicleInfo[playerid][mod10] = dini_Int(file, "mod10");
VehicleInfo[playerid][mod11] = dini_Int(file, "mod11");
VehicleInfo[playerid][mod12] = dini_Int(file, "mod12");
VehicleInfo[playerid][mod13] = dini_Int(file, "mod13");
VehicleInfo[playerid][mod14] = dini_Int(file, "mod14");
VehicleInfo[playerid][mod15] = dini_Int(file, "mod15");
VehicleInfo[playerid][mod16] = dini_Int(file, "mod16");
VehicleInfo[playerid][mod17] = dini_Int(file, "mod17");
VehicleInfo[playerid][paintjob] = dini_Int(file, "paintjob");
VehicleInfo[playerid][colora] = dini_Int(file, "color1");
VehicleInfo[playerid][colorb] = dini_Int(file, "color2");
if(VehicleInfo[playerid][mod1]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod1]); }
if(VehicleInfo[playerid][mod2]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod2]); }
if(VehicleInfo[playerid][mod3]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod3]); }
if(VehicleInfo[playerid][mod4]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod4]); }
if(VehicleInfo[playerid][mod5]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod5]); }
if(VehicleInfo[playerid][mod6]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod6]); }
if(VehicleInfo[playerid][mod7]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod7]); }
if(VehicleInfo[playerid][mod8]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod8]); }
if(VehicleInfo[playerid][mod9]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod9]); }
if(VehicleInfo[playerid][mod10]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod10]); }
if(VehicleInfo[playerid][mod11]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod11]); }
if(VehicleInfo[playerid][mod12]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod12]); }
if(VehicleInfo[playerid][mod13]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod13]); }
if(VehicleInfo[playerid][mod14]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod14]); }
if(VehicleInfo[playerid][mod15]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod15]); }
if(VehicleInfo[playerid][mod16]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod16]); }
if(VehicleInfo[playerid][mod17]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod17]); }
if(VehicleInfo[playerid][colora]!=0 || VehicleInfo[playerid][colorb]!=0)
{
ChangeVehicleColor(Vehicle[playerid],VehicleInfo[playerid][colora],VehicleInfo[playerid][colorb]);
}
if(VehicleInfo[playerid][paintjob]!=0)
{
ChangeVehiclePaintjob(Vehicle[playerid],VehicleInfo[playerid][paintjob]);
}
SetVehicleParamsForPlayer(Vehicle[playerid], playerid, 0, VehicleInfo[playerid][Locked]);
gVehLocked[Vehicle[playerid]] = VehicleInfo[playerid][Locked];
CarHP = 0;
OldCarHP = 0;
return 1;
}
return 1;
}
return 1;
}