Also, this retruns unknown
else if(strcmp(tmp,"buy",true) == 0 || strcmp(tmp,"b",true) == 0) {
if(IsPlayerConnected(playerid)) {
tmp = strtok(cmdtext, idx);
if(!IsAtDealership(playerid)) {
return 1;
}
if(!strlen(tmp)) {
if (PlayerInfo[playerid][pMember] == 1 && PlayerToPoint(30.0, playerid,2130.7195,-1147.0983,24.391
) {
SendClientMessage(playerid, COLOR_YELLOW3, "_____________________/v buy [Modelid] [ColorID] [ColorID2]_____________________");
SendClientMessage(playerid,COLOR_WHITE,"Cop Car LS (42000) (596), Cop Car SF (43000) (597), Cop Car LV (46000) (59
, Ranger (48000) (599)");
}
if (PlayerInfo[playerid][pDonateRank] == 1 && PlayerToPoint(30.0, playerid,2130.7195,-1147.0983,24.391
) {
SendClientMessage(playerid, COLOR_YELLOW3, "_____________________/v buy [Modelid] [ColorID] [ColorID2]_____________________");
SendClientMessage(playerid,COLOR_WHITE,"BMX (2000) (481)");
}
else if (PlayerInfo[playerid][pDonateRank] == 2 && PlayerToPoint(30.0, playerid,2130.7195,-1147.0983,24.391
) {
SendClientMessage(playerid, COLOR_YELLOW3, "_____________________/v buy [Modelid] [ColorID] [ColorID2]_____________________");
SendClientMessage(playerid,COLOR_WHITE,"BMX (2000) (481),Sanchez (16000) (46
");
}
else if (PlayerInfo[playerid][pDonateRank] == 3 && PlayerToPoint(30.0, playerid,2130.7195,-1147.0983,24.391
) {
SendClientMessage(playerid, COLOR_YELLOW3, "_____________________/v buy [Modelid] [ColorID] [ColorID2]_____________________");
SendClientMessage(playerid,COLOR_WHITE,"BMX (2000) (481),Sanchez (16000) (46
,FCR-900 (75000) (521)");
}
else if (PlayerInfo[playerid][pDonateRank] == 3 && PlayerToPoint(30.0, playerid,546.9250,-1292.2887,17.2482) || PlayerToPoint(30.0, playerid,1962.1156,-2263.7964,13.5469)) {
SendClientMessage(playerid, COLOR_YELLOW3, "_____________________/v buy [Modelid] [ColorID] [ColorID2]_____________________");
SendClientMessage(playerid,COLOR_WHITE,"Infernus (350000) (411), Turismo (600000) (451),Bullet (505000) (541)");
}
if(PlayerToPoint(30.0, playerid,2130.7195,-1147.0983,24.391
) {
SendClientMessage(playerid,COLOR_WHITE,"Faggio (15000) (462), Freeway (28000) (463)");
SendClientMessage(playerid,COLOR_WHITE,"PCJ-600 (55000) (461), Majestic (38000) (517), Tahoma (42000) (566)");
SendClientMessage(playerid,COLOR_WHITE,"Picador (36000) (600), Voodoo (65000) (412), Sabre (43000) (475), Buccaneer (36000) (51
");
SendClientMessage(playerid,COLOR_WHITE,"Bobcat (42000) (422), Mesa (45000) (500), Tornado (65000) (576) Huntley (89000) (579)");
SendClientMessage(playerid,COLOR_WHITE,"Hermes (50000) (474), Greenwood (33000) (492), Blade (69000) (536), Merit (56000) (551)");
SendClientMessage(playerid,COLOR_WHITE,"Feltzer (89000) (533), Sentinel (69000) (405), Stratum (28000) (561)");
SendClientMessage(playerid,COLOR_WHITE,"Washington (59000) (421), Broadway (75000) (575), Remmington (59000) (534)");
SendClientMessage(playerid,COLOR_WHITE,"Sunrise (35000) (550), Burrito (45000) (482), Glendale (35000) (466)");
SendClientMessage(playerid,COLOR_WHITE,"Savanna (62000) (567), Landstalker (42000) (400), Slamvan (55000) (535), Yosemite (85000) (554)");
SendClientMessage(playerid,COLOR_WHITE,"Admiral (85000) (445), Virgo (34000) (491), Stafford (125000) (580)");
SendClientMessage(playerid,COLOR_WHITE,"Glendale Shit (18000} (604), Camper (29000) (483), Super GT (250000) (506)");
SendClientMessage(playerid,COLOR_WHITE,"Hustler (125000) (545), Vincent (78000) (540), Blista Compact (38000) (496)");
SendClientMessage(playerid,COLOR_WHITE,"Regina (26000) (479), Phoenix (310000) (603), Emperor (95000) (585), Tampa (58000) (549)");
SendClientMessage(playerid,COLOR_WHITE,"Primo (52000) (547), Intruder (45000) (546), Willard (36000) (529), Cadrona (48000) (527)");
SendClientMessage(playerid,COLOR_WHITE,"Fortune (65000) (526), Taxi (50000) (420), Tow Truck (25000) (525), Nebula (59000) (516), Bike (1000) (509)");
SendClientMessage(playerid, COLOR_YELLOW3, "_____________________/v buy [Modelid] [ColorID] [ColorID2]_____________________");
}
else if(PlayerToPoint(30.0, playerid,546.9250,-1292.2887,17.2482) || PlayerToPoint(30.0, playerid,1962.1156,-2263.7964,13.5469)) {
SendClientMessage(playerid, COLOR_YELLOW3, "_____________________/v buy [Modelid] [ColorID] [ColorID2]_____________________");
SendClientMessage(playerid,COLOR_WHITE,"Rancher (85000) (489), Alpha (170000) (602), Windsor (200000) (555)");
SendClientMessage(playerid,COLOR_WHITE,"Buffalo (85000) (402), Uranus (85000) (55
, Elegy (95000) (562)");
SendClientMessage(playerid,COLOR_WHITE,"Flash (69000) (565), ZR-350 (300000) (477), Jester (125000) (559), Comet (75000) (480)");
SendClientMessage(playerid,COLOR_WHITE,"Cheetah (350000) (415), Sultan (250000) (560), Banshee (670000) (429)");
SendClientMessage(playerid,COLOR_WHITE,"Dodo (156000) (593), Maverick (165000) (487), SAN Maverick (145000) (48
, Shamal (245000) (519)");
SendClientMessage(playerid, COLOR_YELLOW3, "_____________________/v buy [Modelid] [ColorID] [ColorID2]_____________________");
}
return 1;
}
new vehicle;
vehicle = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_YELLOW3, "/v buy [Modelid] [ColorID] [ColorID2]");
return 1;
}
new color1;
color1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_YELLOW3, "/v buy [Modelid] [ColorID] [ColorID2]");
return 1;
}
new color2;
color2 = strval(tmp);
new vehicleprice;
if(color1 < 0 && color1 > 126) {
SendClientMessage(playerid,COLOR_GRAD3," Wrong color id!");
return 1;
}
if(color2 < 0 && color2 > 126) {
SendClientMessage(playerid,COLOR_GRAD3," Wrong color id!");
return 1;
}
if(PlayerToPoint(30.0, playerid,2130.7195,-1147.0983,24.391
) {
if(vehicle == 481) { vehicleprice = 2000; }
else if(vehicle == 462) { vehicleprice = 15000; }
else if(vehicle == 463) { vehicleprice = 28000; }
else if(vehicle == 46
{ vehicleprice = 16000; }
else if(vehicle == 461) { vehicleprice = 55000; }
else if(vehicle == 517) { vehicleprice = 38000; }
else if(vehicle == 566) { vehicleprice = 42000; }
else if(vehicle == 600) { vehicleprice = 36000; }
else if(vehicle == 412) { vehicleprice = 65000; }
else if(vehicle == 475) { vehicleprice = 43000; }
else if(vehicle == 51
{ vehicleprice = 36000; }
else if(vehicle == 422) { vehicleprice = 42000; }
else if(vehicle == 500) { vehicleprice = 45000; }
else if(vehicle == 576) { vehicleprice = 65000; }
else if(vehicle == 579) { vehicleprice = 89000; }
else if(vehicle == 474) { vehicleprice = 50000; }
else if(vehicle == 492) { vehicleprice = 33000; }
else if(vehicle == 536) { vehicleprice = 69000; }
else if(vehicle == 551) { vehicleprice = 56000; }
else if(vehicle == 533) { vehicleprice = 89000; }
else if(vehicle == 405) { vehicleprice = 69000; }
else if(vehicle == 561) { vehicleprice = 28000; }
else if(vehicle == 421) { vehicleprice = 59000; }
else if(vehicle == 575) { vehicleprice = 75000; }
else if(vehicle == 534) { vehicleprice = 59000; }
else if(vehicle == 550) { vehicleprice = 35000; }
else if(vehicle == 482) { vehicleprice = 45000; }
else if(vehicle == 466) { vehicleprice = 35000; }
else if(vehicle == 567) { vehicleprice = 62000; }
else if(vehicle == 400) { vehicleprice = 42000; }
else if(vehicle == 535) { vehicleprice = 55000; }
else if(vehicle == 554) { vehicleprice = 85000; }
else if(vehicle == 445) { vehicleprice = 85000; }
else if(vehicle == 491) { vehicleprice = 34000; }
else if(vehicle == 580) { vehicleprice = 125000; }
else if(vehicle == 604) { vehicleprice = 18000; }
else if(vehicle == 483) { vehicleprice = 29000; }
else if(vehicle == 521) { vehicleprice = 75000; }
else if(vehicle == 540) { vehicleprice = 78000; }
else if(vehicle == 545) { vehicleprice = 125000; }
else if(vehicle == 496) { vehicleprice = 38000; }
else if(vehicle == 479) { vehicleprice = 26000; }
else if(vehicle == 603) { vehicleprice = 310000; }
else if(vehicle == 585) { vehicleprice = 95000; }
else if(vehicle == 549) { vehicleprice = 58000; }
else if(vehicle == 547) { vehicleprice = 52000; }
else if(vehicle == 546) { vehicleprice = 45000; }
else if(vehicle == 529) { vehicleprice = 36000; }
else if(vehicle == 527) { vehicleprice = 48000; }
else if(vehicle == 526) { vehicleprice = 65000; }
else if(vehicle == 516) { vehicleprice = 59000; }
else if(vehicle == 509) { vehicleprice = 1000; }
else if(vehicle == 596) { vehicleprice = 42000; }
else if(vehicle == 597) { vehicleprice = 43000; }
else if(vehicle == 59
{ vehicleprice = 46000; }
else if(vehicle == 599) { vehicleprice = 48000; }
else if(vehicle == 506) { vehicleprice = 250000; }
else if(vehicle == 420) { vehicleprice = 50000; }
else if(vehicle == 525) { vehicleprice = 18000; }
else { SendClientMessage(playerid,COLOR_GRAD3," Invalid ModelID !"); return 1; }
}
else if(PlayerToPoint(30.0, playerid,546.9250,-1292.2887,17.2482) || PlayerToPoint(30.0, playerid,1962.1156,-2263.7964,13.5469)) {
if(vehicle == 489) { vehicleprice = 85000; }
else if(vehicle == 602) { vehicleprice = 52000; }
else if(vehicle == 555) { vehicleprice = 82000; }
else if(vehicle == 402) { vehicleprice = 85000; }
else if(vehicle == 55
{ vehicleprice = 85000; }
else if(vehicle == 562) { vehicleprice = 95000; }
else if(vehicle == 565) { vehicleprice = 69000; }
else if(vehicle == 477) { vehicleprice = 300000; }
else if(vehicle == 559) { vehicleprice = 125000; }
else if(vehicle == 480) { vehicleprice = 75000; }
else if(vehicle == 415) { vehicleprice = 350000; }
else if(vehicle == 560) { vehicleprice = 250000; }
else if(vehicle == 429) { vehicleprice = 67000; }
else if(vehicle == 541) { vehicleprice = 505000; }
else if(vehicle == 451) { vehicleprice = 600000; }
else if(vehicle == 411) { vehicleprice = 350000; }
else if(vehicle == 593) { vehicleprice = 156000; }
else if(vehicle == 487) { vehicleprice = 165000; }
else if(vehicle == 48
{ vehicleprice = 145000; }
else if(vehicle == 519) { vehicleprice = 245000; }
else { SendClientMessage(playerid,COLOR_GRAD3," Invalid ModelID !"); return 1; }
}
if(vehicleprice == 0) { return 1; }
if(GetPlayerPCash(playerid) < vehicleprice) {
SendClientMessage(playerid,COLOR_GRAD3," You cannot afford this vehicle !");
return 1;
}
if(ForwardOwnCar(1,playerid)) { SendClientMessage(playerid, COLOR_LIGHTRED, "You already have 1 of your vehicles spawned.Wait until the next server restart."); return 1; }
else if(ForwardOwnCar(2,playerid)) { SendClientMessage(playerid, COLOR_LIGHTRED, "You already have 1 of your vehicles spawned.Wait until the next server restart."); return 1; }
else if(ForwardOwnCar(3,playerid)) { SendClientMessage(playerid, COLOR_LIGHTRED, "You already have 1 of your vehicles spawned.Wait until the next server restart."); return 1; }
//new Float:cwx2,Float:cwy2,Float:cwz2;
if(PlayerInfo[playerid][pCarkey] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey2] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey3] != SCRIPT_CARS) {
SendClientMessage(playerid,COLOR_GRAD3," You already have 3 key slots !");
return 1;
}
new found = 0;
//for(new i = 0; i < sizeof(CarInfo); i++)
for(new i = 0; i < sizeof(CarInfo); i++) {
if(found != 1) {
if(CarInfo[i][cOwned] == 0) {
found = 1;
CarInfo[i][cMod][0] = 0;
CarInfo[i][cMod][1] = 0;
CarInfo[i][cMod][2] = 0;
CarInfo[i][cMod][3] = 0;
CarInfo[i][cMod][4] = 0;
CarInfo[i][cMod][5] = 0;
CarInfo[i][cMod][6] = 0;
CarInfo[i][cMod][7] = 0;
CarInfo[i][cMod][8] = 0;
CarInfo[i][cMod][9] = 0;
if(PlayerInfo[playerid][pCarkey] == SCRIPT_CARS) {
PlayerInfo[playerid][pCarkey] = i;
}
else if(PlayerInfo[playerid][pCarkey2] == SCRIPT_CARS) {
PlayerInfo[playerid][pCarkey2] = i;
}
else if(PlayerInfo[playerid][pCarkey3] == SCRIPT_CARS) {
PlayerInfo[playerid][pCarkey3] = i;
}
format(string, sizeof(string), "You have bought a %s, for $%d.",VehicleName[vehicle-400],vehicleprice);
SendClientMessage(playerid,COLOR_WHITE,string);
SendClientMessage(playerid,COLOR_GRAD3,"Please remember to /v buypark where you want to park it or /v park and /v for to see other commands");
GivePlayerPCash(playerid,-vehicleprice);
CarInfo[i][cOwned] = 1;
CarInfo[i][cModel] = vehicle;
format(string, sizeof(string), "%s",VehicleName[vehicle-400]);
strmid(CarInfo[i][cDescription], string, 0, strlen(string), 255);
CarInfo[i][cValue] = vehicleprice;
CarInfo[i][cColorOne] = color1;
CarInfo[i][cColorTwo] = color2;
CarInfo[i][cLock] = 0;
CarInfo[i][cLockBuy] = 0;
CarInfo[i][cRadio] = 0;
new Float:yx,Float:yy,Float:yz,Float:urangle;
GetPlayerPos(playerid, yx, yy, yz);
GetPlayerFacingAngle(playerid,urangle);
CarInfo[i][cLocationx] = yx;
CarInfo[i][cLocationy] = yy;
CarInfo[i][cLocationz] = yz;
CarInfo[i][cAngle] = urangle;
CarInfo[i][cDonate] = 0;
CarInfo[i][cFaction] = 0;
Owner[playerid] = 1;
//CarAlarm[]] = 0;
//new keyf = 10000 + random(89999);
// GetPlayerName(playerid, sendername, sizeof(sendername));
// format(string, sizeof(string), "%s", sendername);
/// strmid(CarInfo[i][cLicense], string, 0, strlen(string), 255);
CarInfo[i][cInsurances] = 2;
CarInfo[i][cImmobs] = 0;
CarInfo[i][cDestroys] = 0;
CarInfo[i][cAlarm] = 0;
CarAlarm[idcar][caalarm] = 0;
Station[i][rsdstation] = 0;
CarInfo[i][cToolkit] = 0;
CarInfo[i][cFuel] = 10;
CarInfo[i][cTrunkWep][1] = 0;
CarInfo[i][cTrunkWep][2] = 0;
CarInfo[i][cTrunkWep][3] = 0;
CarInfo[i][cTrunkWep][4] = 0;
CarInfo[i][cTrunkAmmo][1] = 0;
CarInfo[i][cTrunkAmmo][2] = 0;
CarInfo[i][cTrunkAmmo][3] = 0;
CarInfo[i][cEngine] = 0;
CarInfo[i][cTrunkAmmo][4] = 0;
CarInfo[i][cTrunkArmour] = 0.0;
CarInfo[i][cTrunkCounter] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s", sendername);
strmid(CarInfo[i][cOwner], string, 0, strlen(string), 255);
format(string, sizeof(string), "%s", sendername);
strmid(CarOwner[playerid], string, 0, strlen(string), 255);
new carid = AddStaticVehicleEx(CarInfo[i][cModel],CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz]+1,CarInfo[i][cAngle],CarInfo[i][cColorOne],CarInfo[i][cColorTwo],3600);
VehicleOwned[carid] = i;
SaveCars();
SavePlayerData(playerid);
return 1;
}
}
}
if(found != 1) {
SendClientMessage(playerid, COLOR_GRAD3, "Sorry, all the Vehicle Slots have been used please inform an admin.");
}
}
return 1;
}