#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Car Spawner Menu by Yuri was loaded");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
print("\n--------------------------------------");
print(" Car Spawner Menu by Yuri was Unloaded");
print("--------------------------------------\n");
return 1;
}
#endif
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,0xFFFF00AA,"HelpBot: Type /v for a list of all cars.");
SendClientMessage(playerid,0xFFFF00A,"HelpBot: Type /register password to create an account.");
SendClientMessage(playerid,0xFF0000AA,"HelpBot: Type /ltele");
SendClientMessage(playerid,0xFFFFFFAA,"HelpBot: If your account is registered type /login password");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/vehicles", cmdtext, true, 10) == 0)
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new Float: X, Float: Y, Float: Z;
GetPlayerPos(playerid,X,Y,Z);
if(dialogid == 2)
{
if(response)
{
if(listitem == 0)
{
new allvehicles[] = "1\tAndromada\n2\tAT-400\n3\tBeagle\n4\tCropduster\n5\tDodo\n6\tHydra\n7\tNevada\n8\tRustler\n9\tShamal\n10\tSkimmer\n11\tStunt Plane";
ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"Airplanes: || Scroll Down for more",allvehicles,"Select","Cancel");
}
else if(listitem == 1)
{
new allvehicles[] = "1\tCargobob\n2\tHunter\n3\tLeviathan\n4\tMaverick\n5\tNews Maverick\n6\tPolice Maverick\n7\tRaindance\n8\tSeasparrow\n9\tSparrow";
ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Helicopters: || Scroll Down for more",allvehicles,"Select","Cancel");
}
else if(listitem == 2)
{
new allvehicles[] = "1\tBF-400\n2\tBike\n3\tBMX\n4\tFaggio\n5\tFCR-900\n6\tFreeway\n7\tMountain Bike\n8\tNRG-500\n9\tPCJ-600\n10\tPizzaBoy\n11\tQuad\n12\tSanchez\n13\tWayfarer";
ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"Bikes: || Scroll Down for more",allvehicles,"Select","Cancel");
}
else if(listitem == 3)
{
new allvehicles[] = "1\tComet\n2\tFeltzer\n3\tStallion\n4\tWindsor";
ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Convertibles:",allvehicles,"Select","Cancel");
}
else if(listitem == 4)
{
new allvehicles[] = "1\tBenson\n2\tBobcat\n3\tBurrito\n4\tBoxville\n5\tBoxburg\n6\tCement Truck\n7\tDFT-300\n8\tFlatbed\n9\tLinerunner\n10\tMule\n11\tNews Van\n12\tPacker\n13\tPetrol Tanker\n14\tPicador\n15\tPony\n16\tRoad Train\n17\tRumpo\n18\tSadler\n19\tSadler Shit( Ghost Car )\n20\tTopfun\n21\tTractor\n22\tTrashmaster\n23\tUitlity Van\n24\tWalton\n25\tYankee\n26\tYosemite";
ShowPlayerDialog(playerid,7,DIALOG_STYLE_LIST,"Industrial Vehicles:",allvehicles,"Select","Cancel");
}
else if(listitem == 5)
{
new allvehicles[] = "1\tBlade\n2\tBroadway\n3\tRemington\n4\tSavanna\n5\tSlamvan\n6\tTahoma\n7\tTornado\n8\tVoodoo";
ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"Lowriders:",allvehicles,"Select","Cancel");
}
else if(listitem == 6)
{
new allvehicles[] = "1\tBandito\n2\tBF Injection\n3\tDune\n4\tHuntley\n5\tLandstalker\n6\tMesa\n7\tMonster Truck\n8\tMonster Truck 'A'\n9\tMonster Truck 'B'\n10\tPatriot\n11\tRancher 'A'\n12\tRancher 'B'\n13\tSandking";
ShowPlayerDialog(playerid,9,DIALOG_STYLE_LIST,"Off Road Vehicles:",allvehicles,"Select","Cancel");
}
else if(listitem == 7)
{
new allvehicles[] = "1\tAmbulance\n2\tBarracks\n3\tBus\n4\tCabbie\n5\tCoach\n6\tHPV-1000 ( Cop Bike )\n7\tEnforcer\n8\tF.B.I Rancher\n9\tF.B.I Truck\n10\tFiretruck\n11\tFireTruck LA\n12\tPolice Car ( LSPD )\n13\tPolice Car ( LVPD )\n14\tPolice Car ( SFPD )\n15\tRanger\n16\tS.W.A.T\n17\tTaxi\n18\n18Rhino";
ShowPlayerDialog(playerid,10,DIALOG_STYLE_LIST,"Public Service Vehicles:",allvehicles,"Select","Cancel");
}
else if(listitem == 8)
{
new allvehicles[] = "1\tAdmiral\n2\tBloodring Banger\n3\tBravura\n4\tBuccaneer\n5\tCadrona\n6\tClover\n7\tElegant\n8\tElegy\n9\tEmperor\n10\tEsperanto\n11\tFortune\n12\tGlendale Shit ( Ghost Car )\n13\tGlendale\n14\tGreenwood\n15\tHermes\n16\tIntruder\n17\tMajestic\n18\tMananal\n19\tMerit\n20\tNebula\n21\tOceanic\n22\tPremier\n23\tPrevion\n24\tPrimo\n25\tSentinel\n26\tStafford\n27\tSultan \n28\tSunrise\n29\tTampa\n30\tVicent\n31\tVirgo\n32\tWillard\n33\tWashington";
ShowPlayerDialog(playerid,11,DIALOG_STYLE_LIST,"Saloons Vehicles:",allvehicles,"Select","Cancel");
}
else if(listitem == 9)
{
new allvehicles[] = "1\tAlpha\n2\tBanshee\n3\tBlista Compact\n4\tBuffalo\n5\tBullet\n6\tCheetah\n7\tClub\n8\tEuros\n9\tFlash\n10\tHotring Racer 'A'\n11\tHotring Racer 'B'\n12\tHotring Racer 'C'\n13\tInfernus\n14\tJester\n15\tPhoenix\n16\tSabre\n17\tSuper GT\n18\tTurismo\n19\tUranus\n20\tZR-350";
ShowPlayerDialog(playerid,12,DIALOG_STYLE_LIST,"Sport Vehicles:",allvehicles,"Select","Cancel");
}
else if(listitem == 10)
{
new allvehicles[] = "1\tMoonbeam\n2\tPerenniel\n3\tRegina\n4\tSolair\n5\tStratum";
ShowPlayerDialog(playerid,13,DIALOG_STYLE_LIST,"Station Wagons Vehicles:",allvehicles,"Select","Cancel");
}
else if(listitem == 11)
{
new allvehicles[] = "1\tCoastguard\n2\tDinghy\n3\tJetmax\n4\tLaunch\n5\tMarquis\n6\tPredator\n7\tReefer\n8\tSpeeder\n9\tSquallo\n10\tTropic";
ShowPlayerDialog(playerid,14,DIALOG_STYLE_LIST,"Boats:",allvehicles,"Select","Cancel");
}
else if(listitem == 12)
{
new allvehicles[] = "1\tBaggage\n2\tCaddy\n3\tCamper 'A'\n4\tCamper 'B'\n5\tCobine Harvester\n6\tDozer\n7\tDumper\n8\tForklift\n9\tHotknife\n10\tHustler\n11\tHotdog\n12\tKart\n13\tMower\n14\tMr. Whoopee\n15\tRomero\n16\tSecuricar\n17\tStretch\n18\tSweeper\n19\tTowtruck\n20\tTug\n21\tVortex";
ShowPlayerDialog(playerid,15,DIALOG_STYLE_LIST,"Unique Vehicles:",allvehicles,"Select","Cancel");
}
else if(listitem == 13)
{
new allvehicles[] = "1\tRC Bandit\n2\tRC Baron\n3\tRC Raider'\n4\tRC Goblin'\n5\tRC Tiger\n6\tRC Cam";
ShowPlayerDialog(playerid,16,DIALOG_STYLE_LIST,"RC Vehicles:",allvehicles,"Select","Cancel");
}
else if(listitem == 14)
{
new allvehicles[] = "1\tArticle Trailer\n2\tArticle Trailer 2\n3\tArticle Trailer 3'\n4\tBaggage Trailer 'A''\n5\tBaggage Trailer 'B'\n6\tFarm Trailer\n7\tFreight Frat Trailer(Train)\n8\tFreight Box Trailer(Train)\n9\tPetrol Trailer\n10\tStreak Trailer(Train)\n11\tStairs Trailer\n12\tUitlity Trailer";
ShowPlayerDialog(playerid,17,DIALOG_STYLE_LIST,"Trailers Vehicles:",allvehicles,"Select","Cancel");
}
}
}
else if(dialogid == 3)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(592,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(577,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(511,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(512,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(593,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(520,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(553,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(476,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 8)
{
PutPlayerInVehicle(playerid,CreateVehicle(510,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 9)
{
PutPlayerInVehicle(playerid,CreateVehicle(460,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 10)
{
PutPlayerInVehicle(playerid,CreateVehicle(513,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 4)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(548,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(425,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(417,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(487,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(488,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(497,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(563,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(447,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 8)
{
PutPlayerInVehicle(playerid,CreateVehicle(469,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 5)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(581,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(509,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(481,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(462,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(521,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(463,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(510,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(522,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 8)
{
PutPlayerInVehicle(playerid,CreateVehicle(461,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 9)
{
PutPlayerInVehicle(playerid,CreateVehicle(448,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 10)
{
PutPlayerInVehicle(playerid,CreateVehicle(471,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 11)
{
PutPlayerInVehicle(playerid,CreateVehicle(468,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 12)
{
PutPlayerInVehicle(playerid,CreateVehicle(586,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 6)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(480,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(533,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(439,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(555,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 7)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(499,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(422,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(482,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(498,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(609,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(524,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(578,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(455,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 8)
{
PutPlayerInVehicle(playerid,CreateVehicle(403,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 9)
{
PutPlayerInVehicle(playerid,CreateVehicle(414,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 10)
{
PutPlayerInVehicle(playerid,CreateVehicle(582,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 11)
{
PutPlayerInVehicle(playerid,CreateVehicle(443,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 12)
{
PutPlayerInVehicle(playerid,CreateVehicle(514,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 13)
{
PutPlayerInVehicle(playerid,CreateVehicle(600,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 14)
{
PutPlayerInVehicle(playerid,CreateVehicle(413,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 15)
{
PutPlayerInVehicle(playerid,CreateVehicle(515,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 16)
{
PutPlayerInVehicle(playerid,CreateVehicle(440,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 17)
{
PutPlayerInVehicle(playerid,CreateVehicle(543,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 18)
{
PutPlayerInVehicle(playerid,CreateVehicle(605,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 19)
{
PutPlayerInVehicle(playerid,CreateVehicle(459,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 20)
{
PutPlayerInVehicle(playerid,CreateVehicle(531,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 21)
{
PutPlayerInVehicle(playerid,CreateVehicle(408,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 22)
{
PutPlayerInVehicle(playerid,CreateVehicle(552,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 23)
{
PutPlayerInVehicle(playerid,CreateVehicle(478,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 24)
{
PutPlayerInVehicle(playerid,CreateVehicle(556,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 25)
{
PutPlayerInVehicle(playerid,CreateVehicle(554,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 8)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(536,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(575,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(534,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(567,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(535,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(566,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(576,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(412,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 9)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(568,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(424,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(573,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(579,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(400,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(500,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(444,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(556,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 8)
{
PutPlayerInVehicle(playerid,CreateVehicle(557,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 9)
{
PutPlayerInVehicle(playerid,CreateVehicle(470,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 10)
{
PutPlayerInVehicle(playerid,CreateVehicle(489,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 11)
{
PutPlayerInVehicle(playerid,CreateVehicle(505,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 12)
{
PutPlayerInVehicle(playerid,CreateVehicle(495,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 10)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(416,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(433,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(431,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(438,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(437,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(523,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(427,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(490,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 8)
{
PutPlayerInVehicle(playerid,CreateVehicle(528,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 9)
{
PutPlayerInVehicle(playerid,CreateVehicle(407,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 10)
{
PutPlayerInVehicle(playerid,CreateVehicle(544,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 11)
{
PutPlayerInVehicle(playerid,CreateVehicle(596,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 12)
{
PutPlayerInVehicle(playerid,CreateVehicle(598,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 13)
{
PutPlayerInVehicle(playerid,CreateVehicle(597,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 14)
{
PutPlayerInVehicle(playerid,CreateVehicle(599,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 15)
{
PutPlayerInVehicle(playerid,CreateVehicle(601,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 16)
{
PutPlayerInVehicle(playerid,CreateVehicle(420,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 17)
{
PutPlayerInVehicle(playerid,CreateVehicle(432,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 11)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(445,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(504,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(401,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(518,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(527,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(542,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(507,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(562,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 8)
{
PutPlayerInVehicle(playerid,CreateVehicle(585,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 9)
{
PutPlayerInVehicle(playerid,CreateVehicle(419,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 10)
{
PutPlayerInVehicle(playerid,CreateVehicle(526,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 11)
{
PutPlayerInVehicle(playerid,CreateVehicle(604,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 12)
{
PutPlayerInVehicle(playerid,CreateVehicle(466,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 13)
{
PutPlayerInVehicle(playerid,CreateVehicle(492,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 14)
{
PutPlayerInVehicle(playerid,CreateVehicle(474,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 15)
{
PutPlayerInVehicle(playerid,CreateVehicle(546,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 16)
{
PutPlayerInVehicle(playerid,CreateVehicle(517,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 17)
{
PutPlayerInVehicle(playerid,CreateVehicle(310,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 18)
{
PutPlayerInVehicle(playerid,CreateVehicle(551,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 19)
{
PutPlayerInVehicle(playerid,CreateVehicle(516,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 20)
{
PutPlayerInVehicle(playerid,CreateVehicle(467,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 21)
{
PutPlayerInVehicle(playerid,CreateVehicle(426,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 22)
{
PutPlayerInVehicle(playerid,CreateVehicle(436,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 23)
{
PutPlayerInVehicle(playerid,CreateVehicle(547,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 24)
{
PutPlayerInVehicle(playerid,CreateVehicle(405,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 25)
{
PutPlayerInVehicle(playerid,CreateVehicle(580,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 26)
{
PutPlayerInVehicle(playerid,CreateVehicle(560,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 27)
{
PutPlayerInVehicle(playerid,CreateVehicle(550,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 28)
{
PutPlayerInVehicle(playerid,CreateVehicle(549,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 29)
{
PutPlayerInVehicle(playerid,CreateVehicle(540,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 30)
{
PutPlayerInVehicle(playerid,CreateVehicle(491,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 31)
{
PutPlayerInVehicle(playerid,CreateVehicle(529,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 32)
{
PutPlayerInVehicle(playerid,CreateVehicle(421,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 12)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(602,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(429,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(496,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(402,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(541,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(415,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(589,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(587,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 8)
{
PutPlayerInVehicle(playerid,CreateVehicle(565,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 9)
{
PutPlayerInVehicle(playerid,CreateVehicle(494,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 10)
{
PutPlayerInVehicle(playerid,CreateVehicle(502,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 11)
{
PutPlayerInVehicle(playerid,CreateVehicle(503,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 12)
{
PutPlayerInVehicle(playerid,CreateVehicle(411,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 13)
{
PutPlayerInVehicle(playerid,CreateVehicle(559,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 14)
{
PutPlayerInVehicle(playerid,CreateVehicle(603,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 15)
{
PutPlayerInVehicle(playerid,CreateVehicle(475,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 16)
{
PutPlayerInVehicle(playerid,CreateVehicle(506,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 17)
{
PutPlayerInVehicle(playerid,CreateVehicle(451,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 18)
{
PutPlayerInVehicle(playerid,CreateVehicle(558,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 19)
{
PutPlayerInVehicle(playerid,CreateVehicle(477,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 13)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(418,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(404,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(479,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(458,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(561,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 14)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(472,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(473,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(493,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(595,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(484,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(430,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(453,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(452,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 8)
{
PutPlayerInVehicle(playerid,CreateVehicle(446,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 9)
{
PutPlayerInVehicle(playerid,CreateVehicle(454,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 15)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(485,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(457,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(483,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(508,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(532,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(486,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(406,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(530,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 8)
{
PutPlayerInVehicle(playerid,CreateVehicle(434,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 9)
{
PutPlayerInVehicle(playerid,CreateVehicle(545,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 10)
{
PutPlayerInVehicle(playerid,CreateVehicle(588,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 11)
{
PutPlayerInVehicle(playerid,CreateVehicle(571,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 12)
{
PutPlayerInVehicle(playerid,CreateVehicle(572,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 13)
{
PutPlayerInVehicle(playerid,CreateVehicle(423,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 14)
{
PutPlayerInVehicle(playerid,CreateVehicle(442,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 15)
{
PutPlayerInVehicle(playerid,CreateVehicle(428,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 16)
{
PutPlayerInVehicle(playerid,CreateVehicle(409,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 17)
{
PutPlayerInVehicle(playerid,CreateVehicle(574,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 18)
{
PutPlayerInVehicle(playerid,CreateVehicle(525,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 19)
{
PutPlayerInVehicle(playerid,CreateVehicle(583,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 20)
{
PutPlayerInVehicle(playerid,CreateVehicle(539,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 16)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(441,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(464,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(465,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(501,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(564,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(594,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
else if(dialogid == 17)
{
if(response)
{
if(listitem == 0)
{
PutPlayerInVehicle(playerid,CreateVehicle(435,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 1)
{
PutPlayerInVehicle(playerid,CreateVehicle(450,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 2)
{
PutPlayerInVehicle(playerid,CreateVehicle(591,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 3)
{
PutPlayerInVehicle(playerid,CreateVehicle(606,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 4)
{
PutPlayerInVehicle(playerid,CreateVehicle(607,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 5)
{
PutPlayerInVehicle(playerid,CreateVehicle(610,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 6)
{
PutPlayerInVehicle(playerid,CreateVehicle(569,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 7)
{
PutPlayerInVehicle(playerid,CreateVehicle(590,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 8)
{
PutPlayerInVehicle(playerid,CreateVehicle(584,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 9)
{
PutPlayerInVehicle(playerid,CreateVehicle(570,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 10)
{
PutPlayerInVehicle(playerid,CreateVehicle(608,X,Y,Z,0,-1,-1,-1),0);
}
else if(listitem == 11)
{
PutPlayerInVehicle(playerid,CreateVehicle(611,X,Y,Z,0,-1,-1,-1),0);
}
}
else
{
new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
}
}
return 1;
}
/*
Release:
» Race System Filterscript
Author:
» » RyDeR «
Last Update:
» 26/04/2010
ChangeLog:
» v0.1a:
- Initial release
» v0.2a:
- Major Bugs fixed!
- Racing in other worlds added (enable/disbable with uncomment/comment-ing the define)
- New Commands added:
- /startautorace: You can enable that the script starts automaticly a race after the previous one is done.
- /stopautorace: You can disable the command above.
- /exitrace: To exit the race safely
- Best Race Times added (Top 5 best time laps; You will see a message when the record is broken).
- Crash while creating a race is fixed.
- Etc..
Bugs:
» No bugs
Version:
» v0.2a
Functions:
» IsPlayerInRace(playerid); >> UseFull in stunt servers to disable speedhack, nitro etc. while racing.
Credits:
» Joker: He knows why ;)
» Joe Torran C, ModrLicC: For testing.
» DracoBlue: 'Dini' include.
» ******: 'IsOdd' function.
» Seif_: 'function' function.
» ZeeX: 'zcmd' include.
» Switch: InRace Position function.
*/
#include <a_samp>
#include <dini>
#include <zcmd>
#pragma unused \
ret_memcpy
#define ForEach(%0,%1) \
for(new %0 = 0; %0 != %1; %0++) if(IsPlayerConnected(%0) && !IsPlayerNPC(%0))
#define Loop(%0,%1) \
for(new %0 = 0; %0 != %1; %0++)
#define IsOdd(%1) \
((%1) & 1)
#define ConvertTime(%0,%1,%2,%3,%4) \
new \
Float: %0 = floatdiv(%1, 60000) \
;\
%2 = floatround(%0, floatround_tozero); \
%3 = floatround(floatmul(%0 - %2, 60), floatround_tozero); \
%4 = floatround(floatmul(floatmul(%0 - %2, 60) - %3, 1000), floatround_tozero)
#define function%0(%1) \
forward%0(%1); public%0(%1)
#define MAX_RACE_CHECKPOINTS_EACH_RACE \
120
#define MAX_RACES \
100
#define COUNT_DOWN_TILL_RACE_START \
240 // seconds
#define MAX_RACE_TIME \
960 // seconds
#define RACE_CHECKPOINT_SIZE \
12.0
#define DEBUG_RACE \
1
//#define RACE_IN_OTHER_WORLD // Uncomment to enable
#define GREY \
0xAFAFAFAA
#define GREEN \
0x9FFF00FF
#define RED \
0xE60000FF
#define YELLOW \
0xFFFF00AA
#define WHITE \
0xFFFFFFAA
new
vNames[212][] =
{
{"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"},
{"Police Car (LSPD)"},
{"Police Car (SFPD)"},
{"Police Car (LVPD)"},
{"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"}
},
BuildRace,
BuildRaceType,
BuildVehicle,
BuildCreatedVehicle,
BuildModeVID,
BuildName[30],
bool: BuildTakeVehPos,
BuildVehPosCount,
bool: BuildTakeCheckpoints,
BuildCheckPointCount,
RaceBusy = 0x00,
RaceName[30],
RaceVehicle,
RaceType,
TotalCP,
Float: RaceVehCoords[2][4],
Float: CPCoords[MAX_RACE_CHECKPOINTS_EACH_RACE][4],
CreatedRaceVeh[MAX_PLAYERS],
Index,
PlayersCount[2],
CountTimer,
CountAmount,
bool: Joined[MAX_PLAYERS],
RaceTick,
RaceStarted,
CPProgess[MAX_PLAYERS],
Position,
FinishCount,
JoinCount,
rCounter,
RaceTime,
Text: RaceInfo[MAX_PLAYERS],
InfoTimer[MAX_PLAYERS],
RacePosition[MAX_PLAYERS],
RaceNames[MAX_RACES][128],
TotalRaces,
bool: AutomaticRace,
TimeProgress
;
public OnFilterScriptExit()
{
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00);
KillTimer(rCounter);
KillTimer(CountTimer);
Loop(i, MAX_PLAYERS)
{
DisablePlayerRaceCheckpoint(i);
TextDrawDestroy(RaceInfo[i]);
DestroyVehicle(CreatedRaceVeh[i]);
Joined[i] = false;
KillTimer(InfoTimer[i]);
}
JoinCount = 0;
FinishCount = 0;
TimeProgress = 0;
AutomaticRace = false;
return 1;
}
CMD:buildrace(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "<!> You are not an administrator!");
if(BuildRace != 0) return SendClientMessage(playerid, RED, "<!> There's already someone building a race!");
if(RaceBusy == 0x01) return SendClientMessage(playerid, RED, "<!> Wait first till race ends!");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "<!> Please leave your vehicle first!");
BuildRace = playerid+1;
ShowDialog(playerid, 599);
return 1;
}
CMD:startrace(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "<!> You are not an administrator!");
if(AutomaticRace == true) return SendClientMessage(playerid, RED, "<!> Not possible. Automatic race is enabled!");
if(BuildRace != 0) return SendClientMessage(playerid, RED, "<!> There's someone building a race!");
if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> There's a race currently. Wait first till race ends!");
if(isnull(params)) return SendClientMessage(playerid, RED, "<!> /startrace [racename]");
LoadRace(playerid, params);
return 1;
}
CMD:stoprace(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "<!> You are not an administrator!");
if(RaceBusy == 0x00 || RaceStarted == 0) return SendClientMessage(playerid, RED, "<!> There's no race to stop!");
SendClientMessageToAll(RED, ">> An admin stopped the current race!");
return StopRace();
}
CMD:join(playerid, params[])
{
if(RaceStarted == 1) return SendClientMessage(playerid, RED, "The race already started!");
if(RaceBusy == 0x00) return SendClientMessage(playerid, RED, "There's currently no race to join!");
if(Joined[playerid] == true) return SendClientMessage(playerid, RED, "");
if(IsPlayerInAnyVehicle(playerid)) return SetTimerEx("SetupRaceForPlayer", 2500, 0, "e", playerid), RemovePlayerFromVehicle(playerid), Joined[playerid] = true;
SetupRaceForPlayer(playerid);
Joined[playerid] = true;
return 1;
}
CMD:startautorace(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "<!> You are not an administrator!");
if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> There's a race currently. Wait first till race ends!");
if(AutomaticRace == true) return SendClientMessage(playerid, RED, "<!> It's already enabled!");
LoadRaceNames();
LoadAutoRace(RaceNames[random(TotalRaces)]);
AutomaticRace = true;
SendClientMessage(playerid, GREEN, ">> You stared auto race. The filterscript will start a random race everytime the previous race is over!");
return 1;
}
CMD:stopautorace(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "<!> You are not an administrator!");
if(AutomaticRace == false) return SendClientMessage(playerid, RED, "<!> It's already disabled!");
AutomaticRace = false;
return 1;
}
CMD:leave(playerid, params[])
{
if(Joined[playerid] == true)
{
JoinCount--;
Joined[playerid] = false;
DestroyVehicle(CreatedRaceVeh[playerid]);
DisablePlayerRaceCheckpoint(playerid);
TextDrawHideForPlayer(playerid, RaceInfo[playerid]);
CPProgess[playerid] = 0;
KillTimer(InfoTimer[playerid]);
TogglePlayerControllable(playerid, true);
SetCameraBehindPlayer(playerid);
#if defined RACE_IN_OTHER_WORLD
SetPlayerVirtualWorld(playerid, 0);
#endif
} else return SendClientMessage(playerid, RED, "<!> You are not in a race!");
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(CPProgess[playerid] == TotalCP -1)
{
new
TimeStamp,
TotalRaceTime,
string[256],
rFile[256],
pName[MAX_PLAYER_NAME],
rTime[3],
Prize[2],
TempTotalTime,
TempTime[3]
;
Position++;
GetPlayerName(playerid, pName, sizeof(pName));
TimeStamp = GetTickCount();
TotalRaceTime = TimeStamp - RaceTick;
ConvertTime(var, TotalRaceTime, rTime[0], rTime[1], rTime[2]);
switch(Position)
{
case 1: Prize[0] = (random(random(2000)) + 1000), Prize[1] = 10;
case 2: Prize[0] = (random(random(1000)) + 1000), Prize[1] = 9;
case 3: Prize[0] = (random(random(750)) + 1000), Prize[1] = 8;
default: Prize[0] = random(random(500)), Prize[1] = 1;
}
format(string, sizeof(string), ">> \"%s\" has finished the race in position \"%d\".", pName, Position);
SendClientMessageToAll(WHITE, string);
format(string, sizeof(string), " - Time: \"%d:%d.%d\".", rTime[0], rTime[1], rTime[2]);
SendClientMessageToAll(WHITE, string);
format(string, sizeof(string), " - Prize: \"$%d and +%d Score\".", Prize[0], Prize[1]);
SendClientMessageToAll(WHITE, string);
if(FinishCount <= 5)
{
format(rFile, sizeof(rFile), "/rRaceSystem/%s.RRACE", RaceName);
format(string, sizeof(string), "BestRacerTime_%d", TimeProgress);
TempTotalTime = dini_Int(rFile, string);
ConvertTime(var1, TempTotalTime, TempTime[0], TempTime[1], TempTime[2]);
if(TotalRaceTime <= dini_Int(rFile, string) || TempTotalTime == 0)
{
dini_IntSet(rFile, string, TotalRaceTime);
format(string, sizeof(string), "BestRacer_%d", TimeProgress);
if(TempTotalTime != 0) format(string, sizeof(string), ">> \"%s\" has broken the record of \"%s\" with \"%d\" seconds faster on the \"%d\"'st/th place!", pName, dini_Get(rFile, string), -(rTime[1] - TempTime[1]), TimeProgress+1);
else format(string, sizeof(string), ">> \"%s\" has broken a new record of on the \"%d\"'st/th place!", pName, TimeProgress+1);
SendClientMessageToAll(GREEN, " ");
SendClientMessageToAll(GREEN, string);
SendClientMessageToAll(GREEN, " ");
format(string, sizeof(string), "BestRacer_%d", TimeProgress);
dini_Set(rFile, string, pName);
TimeProgress++;
}
}
FinishCount++;
GivePlayerMoney(playerid, Prize[0]);
SetPlayerScore(playerid, GetPlayerScore(playerid) + Prize[1]);
DisablePlayerRaceCheckpoint(playerid);
CPProgess[playerid]++;
if(FinishCount >= JoinCount) return StopRace();
}
else
{
CPProgess[playerid]++;
CPCoords[CPProgess[playerid]][3]++;
RacePosition[playerid] = floatround(CPCoords[CPProgess[playerid]][3], floatround_floor);
SetCP(playerid, CPProgess[playerid], CPProgess[playerid]+1, TotalCP, RaceType);
PlayerPlaySound(playerid, 1137, 0.0, 0.0, 0.0);
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
if(Joined[playerid] == true)
{
JoinCount--;
Joined[playerid] = false;
DestroyVehicle(CreatedRaceVeh[playerid]);
DisablePlayerRaceCheckpoint(playerid);
TextDrawHideForPlayer(playerid, RaceInfo[playerid]);
CPProgess[playerid] = 0;
KillTimer(InfoTimer[playerid]);
#if defined RACE_IN_OTHER_WORLD
SetPlayerVirtualWorld(playerid, 0);
#endif
}
TextDrawDestroy(RaceInfo[playerid]);
if(BuildRace == playerid+1) BuildRace = 0;
return 1;
}
public OnPlayerConnect(playerid)
{
RaceInfo[playerid] = TextDrawCreate(633.000000, 348.000000, " ");
TextDrawAlignment(RaceInfo[playerid], 3);
TextDrawBackgroundColor(RaceInfo[playerid], 255);
TextDrawFont(RaceInfo[playerid], 1);
TextDrawLetterSize(RaceInfo[playerid], 0.240000, 1.100000);
TextDrawColor(RaceInfo[playerid], -687931137);
TextDrawSetOutline(RaceInfo[playerid], 0);
TextDrawSetProportional(RaceInfo[playerid], 1);
TextDrawSetShadow(RaceInfo[playerid], 1);
return 1;
}
public OnPlayerDeath(playerid)
{
if(Joined[playerid] == true)
{
JoinCount--;
Joined[playerid] = false;
DestroyVehicle(CreatedRaceVeh[playerid]);
DisablePlayerRaceCheckpoint(playerid);
TextDrawHideForPlayer(playerid, RaceInfo[playerid]);
CPProgess[playerid] = 0;
KillTimer(InfoTimer[playerid]);
#if defined RACE_IN_OTHER_WORLD
SetPlayerVirtualWorld(playerid, 0);
#endif
}
if(BuildRace == playerid+1) BuildRace = 0;
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 599:
{
if(!response) return BuildRace = 0;
switch(listitem)
{
case 0: BuildRaceType = 0;
case 1: BuildRaceType = 3;
}
ShowDialog(playerid, 600);
}
case 600..601:
{
if(!response) return ShowDialog(playerid, 599);
if(!strlen(inputtext)) return ShowDialog(playerid, 601);
if(strlen(inputtext) < 1 || strlen(inputtext) > 20) return ShowDialog(playerid, 601);
strmid(BuildName, inputtext, 0, strlen(inputtext), sizeof(BuildName));
ShowDialog(playerid, 602);
}
case 602..603:
{
if(!response) return ShowDialog(playerid, 600);
if(!strlen(inputtext)) return ShowDialog(playerid, 603);
if(isNumeric(inputtext))
{
if(!IsValidVehicle(strval(inputtext))) return ShowDialog(playerid, 603);
new
Float: pPos[4]
;
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
GetPlayerFacingAngle(playerid, pPos[3]);
BuildModeVID = strval(inputtext);
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00);
BuildVehicle = CreateVehicle(strval(inputtext), pPos[0], pPos[1], pPos[2], pPos[3], random(126), random(126), (60 * 60));
PutPlayerInVehicle(playerid, BuildVehicle, 0);
BuildCreatedVehicle = 0x01;
ShowDialog(playerid, 604);
}
else
{
if(!IsValidVehicle(ReturnVehicleID(inputtext))) return ShowDialog(playerid, 603);
new
Float: pPos[4]
;
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
GetPlayerFacingAngle(playerid, pPos[3]);
BuildModeVID = ReturnVehicleID(inputtext);
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00);
BuildVehicle = CreateVehicle(ReturnVehicleID(inputtext), pPos[0], pPos[1], pPos[2], pPos[3], random(126), random(126), (60 * 60));
PutPlayerInVehicle(playerid, BuildVehicle, 0);
BuildCreatedVehicle = 0x01;
ShowDialog(playerid, 604);
}
}
case 604:
{
if(!response) return ShowDialog(playerid, 602);
SendClientMessage(playerid, GREEN, ">> Go to the start line on the left road and press 'KEY_FIRE' and do the same with the right road block.");
SendClientMessage(playerid, GREEN, " - When this is done, you will see a dialog to continue.");
BuildVehPosCount = 0;
BuildTakeVehPos = true;
}
case 605:
{
if(!response) return ShowDialog(playerid, 604);
SendClientMessage(playerid, GREEN, ">> Start taking checkpoints now by clicking 'KEY_FIRE'.");
SendClientMessage(playerid, GREEN, " - IMPORTANT: Press 'ENTER' when you're done with the checkpoints! If it doesn't react press again and again.");
BuildCheckPointCount = 0;
BuildTakeCheckpoints = true;
}
case 606:
{
if(!response) return ShowDialog(playerid, 606);
BuildRace = 0;
BuildCheckPointCount = 0;
BuildVehPosCount = 0;
BuildTakeCheckpoints = false;
BuildTakeVehPos = false;
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle = 0x00);
}
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new
string[256],
rNameFile[256],
rFile[256],
Float: vPos[4]
;
if(newkeys & KEY_FIRE)
{
if(BuildRace == playerid+1)
{
if(BuildTakeVehPos == true)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, ">> You need to be in a vehicle");
format(rFile, sizeof(rFile), "/rRaceSystem/%s.RRACE", BuildName);
GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]);
GetVehicleZAngle(GetPlayerVehicleID(playerid), vPos[3]);
dini_Create(rFile);
dini_IntSet(rFile, "vModel", BuildModeVID);
dini_IntSet(rFile, "rType", BuildRaceType);
format(string, sizeof(string), "vPosX_%d", BuildVehPosCount), dini_FloatSet(rFile, string, vPos[0]);
format(string, sizeof(string), "vPosY_%d", BuildVehPosCount), dini_FloatSet(rFile, string, vPos[1]);
format(string, sizeof(string), "vPosZ_%d", BuildVehPosCount), dini_FloatSet(rFile, string, vPos[2]);
format(string, sizeof(string), "vAngle_%d", BuildVehPosCount), dini_FloatSet(rFile, string, vPos[3]);
format(string, sizeof(string), ">> Vehicle Pos '%d' has been taken.", BuildVehPosCount+1);
SendClientMessage(playerid, YELLOW, string);
BuildVehPosCount++;
}
if(BuildVehPosCount >= 2)
{
BuildVehPosCount = 0;
BuildTakeVehPos = false;
ShowDialog(playerid, 605);
}
if(BuildTakeCheckpoints == true)
{
if(BuildCheckPointCount > MAX_RACE_CHECKPOINTS_EACH_RACE) return SendClientMessage(playerid, RED, ">> You reached the maximum amount of checkpoints!");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, ">> You need to be in a vehicle");
format(rFile, sizeof(rFile), "/rRaceSystem/%s.RRACE", BuildName);
GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]);
format(string, sizeof(string), "CP_%d_PosX", BuildCheckPointCount), dini_FloatSet(rFile, string, vPos[0]);
format(string, sizeof(string), "CP_%d_PosY", BuildCheckPointCount), dini_FloatSet(rFile, string, vPos[1]);
format(string, sizeof(string), "CP_%d_PosZ", BuildCheckPointCount), dini_FloatSet(rFile, string, vPos[2]);
format(string, sizeof(string), ">> Checkpoint '%d' has been setted!", BuildCheckPointCount+1);
SendClientMessage(playerid, YELLOW, string);
BuildCheckPointCount++;
}
}
}
if(newkeys & KEY_SECONDARY_ATTACK)
{
if(BuildTakeCheckpoints == true)
{
ShowDialog(playerid, 606);
format(rNameFile, sizeof(rNameFile), "/rRaceSystem/RaceNames/RaceNames.txt");
TotalRaces = dini_Int(rNameFile, "TotalRaces");
TotalRaces++;
dini_IntSet(rNameFile, "TotalRaces", TotalRaces);
format(string, sizeof(string), "Race_%d", TotalRaces-1);
format(rFile, sizeof(rFile), "/rRaceSystem/%s.RRACE", BuildName);
dini_Set(rNameFile, string, BuildName);
dini_IntSet(rFile, "TotalCP", BuildCheckPointCount);
Loop(x, 5)
{
format(string, sizeof(string), "BestRacerTime_%d", x);
dini_Set(rFile, string, "0");
format(string, sizeof(string), "BestRacer_%d", x);
dini_Set(rFile, string, "noone");
}
}
}
return 1;
}
function LoadRaceNames()
{
new
rNameFile[64],
string[64]
;
format(rNameFile, sizeof(rNameFile), "/rRaceSystem/RaceNames/RaceNames.txt");
TotalRaces = dini_Int(rNameFile, "TotalRaces");
Loop(x, TotalRaces)
{
format(string, sizeof(string), "Race_%d", x), strmid(RaceNames[x], dini_Get(rNameFile, string), 0, 20, sizeof(RaceNames));
printf(">> Loaded Races: %s", RaceNames[x]);
}
return 1;
}
function LoadAutoRace(rName[])
{
new
rFile[256],
string[256]
;
format(rFile, sizeof(rFile), "/rRaceSystem/%s.RRACE", rName);
if(!dini_Exists(rFile)) return printf("Race \"%s\" doesn't exist!", rName);
strmid(RaceName, rName, 0, strlen(rName), sizeof(RaceName));
RaceVehicle = dini_Int(rFile, "vModel");
RaceType = dini_Int(rFile, "rType");
TotalCP = dini_Int(rFile, "TotalCP");
#if DEBUG_RACE == 1
printf("VehicleModel: %d", RaceVehicle);
printf("RaceType: %d", RaceType);
printf("TotalCheckpoints: %d", TotalCP);
#endif
Loop(x, 2)
{
format(string, sizeof(string), "vPosX_%d", x), RaceVehCoords[x][0] = dini_Float(rFile, string);
format(string, sizeof(string), "vPosY_%d", x), RaceVehCoords[x][1] = dini_Float(rFile, string);
format(string, sizeof(string), "vPosZ_%d", x), RaceVehCoords[x][2] = dini_Float(rFile, string);
format(string, sizeof(string), "vAngle_%d", x), RaceVehCoords[x][3] = dini_Float(rFile, string);
#if DEBUG_RACE == 1
printf("VehiclePos %d: %f, %f, %f, %f", x, RaceVehCoords[x][0], RaceVehCoords[x][1], RaceVehCoords[x][2], RaceVehCoords[x][3]);
#endif
}
Loop(x, TotalCP)
{
format(string, sizeof(string), "CP_%d_PosX", x), CPCoords[x][0] = dini_Float(rFile, string);
format(string, sizeof(string), "CP_%d_PosY", x), CPCoords[x][1] = dini_Float(rFile, string);
format(string, sizeof(string), "CP_%d_PosZ", x), CPCoords[x][2] = dini_Float(rFile, string);
#if DEBUG_RACE == 1
printf("RaceCheckPoint %d: %f, %f, %f", x, CPCoords[x][0], CPCoords[x][1], CPCoords[x][2]);
#endif
}
Position = 0;
FinishCount = 0;
JoinCount = 0;
Loop(x, 2) PlayersCount[x] = 0;
CountAmount = COUNT_DOWN_TILL_RACE_START;
RaceTime = MAX_RACE_TIME;
RaceBusy = 0x01;
CountTimer = SetTimer("CountTillRace", 999, 1);
TimeProgress = 0;
return 1;
}
function LoadRace(playerid, rName[])
{
new
rFile[256],
string[256]
;
format(rFile, sizeof(rFile), "/rRaceSystem/%s.RRACE", rName);
if(!dini_Exists(rFile)) return SendClientMessage(playerid, RED, "<!> Race doesn't exist!"), printf("Race \"%s\" doesn't exist!", rName);
strmid(RaceName, rName, 0, strlen(rName), sizeof(RaceName));
RaceVehicle = dini_Int(rFile, "vModel");
RaceType = dini_Int(rFile, "rType");
TotalCP = dini_Int(rFile, "TotalCP");
#if DEBUG_RACE == 1
printf("VehicleModel: %d", RaceVehicle);
printf("RaceType: %d", RaceType);
printf("TotalCheckpoints: %d", TotalCP);
#endif
Loop(x, 2)
{
format(string, sizeof(string), "vPosX_%d", x), RaceVehCoords[x][0] = dini_Float(rFile, string);
format(string, sizeof(string), "vPosY_%d", x), RaceVehCoords[x][1] = dini_Float(rFile, string);
format(string, sizeof(string), "vPosZ_%d", x), RaceVehCoords[x][2] = dini_Float(rFile, string);
format(string, sizeof(string), "vAngle_%d", x), RaceVehCoords[x][3] = dini_Float(rFile, string);
#if DEBUG_RACE == 1
printf("VehiclePos %d: %f, %f, %f, %f", x, RaceVehCoords[x][0], RaceVehCoords[x][1], RaceVehCoords[x][2], RaceVehCoords[x][3]);
#endif
}
Loop(x, TotalCP)
{
format(string, sizeof(string), "CP_%d_PosX", x), CPCoords[x][0] = dini_Float(rFile, string);
format(string, sizeof(string), "CP_%d_PosY", x), CPCoords[x][1] = dini_Float(rFile, string);
format(string, sizeof(string), "CP_%d_PosZ", x), CPCoords[x][2] = dini_Float(rFile, string);
#if DEBUG_RACE == 1
printf("RaceCheckPoint %d: %f, %f, %f", x, CPCoords[x][0], CPCoords[x][1], CPCoords[x][2]);
#endif
}
Position = 0;
FinishCount = 0;
JoinCount = 0;
Loop(x, 2) PlayersCount[x] = 0;
Joined[playerid] = true;
CountAmount = COUNT_DOWN_TILL_RACE_START;
RaceTime = MAX_RACE_TIME;
RaceBusy = 0x01;
TimeProgress = 0;
SetupRaceForPlayer(playerid);
CountTimer = SetTimer("CountTillRace", 999, 1);
return 1;
}
function SetCP(playerid, PrevCP, NextCP, MaxCP, Type)
{
if(Type == 0)
{
if(NextCP == MaxCP) SetPlayerRaceCheckpoint(playerid, 1, CPCoords[PrevCP][0], CPCoords[PrevCP][1], CPCoords[PrevCP][2], CPCoords[NextCP][0], CPCoords[NextCP][1], CPCoords[NextCP][2], RACE_CHECKPOINT_SIZE);
else SetPlayerRaceCheckpoint(playerid, 0, CPCoords[PrevCP][0], CPCoords[PrevCP][1], CPCoords[PrevCP][2], CPCoords[NextCP][0], CPCoords[NextCP][1], CPCoords[NextCP][2], RACE_CHECKPOINT_SIZE);
}
else if(Type == 3)
{
if(NextCP == MaxCP) SetPlayerRaceCheckpoint(playerid, 4, CPCoords[PrevCP][0], CPCoords[PrevCP][1], CPCoords[PrevCP][2], CPCoords[NextCP][0], CPCoords[NextCP][1], CPCoords[NextCP][2], RACE_CHECKPOINT_SIZE);
else SetPlayerRaceCheckpoint(playerid, 3, CPCoords[PrevCP][0], CPCoords[PrevCP][1], CPCoords[PrevCP][2], CPCoords[NextCP][0], CPCoords[NextCP][1], CPCoords[NextCP][2], RACE_CHECKPOINT_SIZE);
}
return 1;
}
function SetupRaceForPlayer(playerid)
{
CPProgess[playerid] = 0;
TogglePlayerControllable(playerid, false);
CPCoords[playerid][3] = 0;
SetCP(playerid, CPProgess[playerid], CPProgess[playerid]+1, TotalCP, RaceType);
if(IsOdd(playerid)) Index = 1;
else Index = 0;
switch(Index)
{
case 0:
{
if(PlayersCount[0] == 1)
{
RaceVehCoords[0][0] -= (6 * floatsin(-RaceVehCoords[0][3], degrees));
RaceVehCoords[0][1] -= (6 * floatcos(-RaceVehCoords[0][3], degrees));
CreatedRaceVeh[playerid] = CreateVehicle(RaceVehicle, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2, RaceVehCoords[0][3], random(126), random(126), (60 * 60));
SetPlayerPos(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2);
SetPlayerFacingAngle(playerid, RaceVehCoords[0][3]);
PutPlayerInVehicle(playerid, CreatedRaceVeh[playerid], 0);
Camera(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2], RaceVehCoords[0][3], 20);
}
}
case 1:
{
if(PlayersCount[1] == 1)
{
RaceVehCoords[1][0] -= (6 * floatsin(-RaceVehCoords[1][3], degrees));
RaceVehCoords[1][1] -= (6 * floatcos(-RaceVehCoords[1][3], degrees));
CreatedRaceVeh[playerid] = CreateVehicle(RaceVehicle, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2]+2, RaceVehCoords[1][3], random(126), random(126), (60 * 60));
SetPlayerPos(playerid, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2]+2);
SetPlayerFacingAngle(playerid, RaceVehCoords[1][3]);
PutPlayerInVehicle(playerid, CreatedRaceVeh[playerid], 0);
Camera(playerid, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2], RaceVehCoords[1][3], 20);
}
}
}
switch(Index)
{
case 0:
{
if(PlayersCount[0] != 1)
{
CreatedRaceVeh[playerid] = CreateVehicle(RaceVehicle, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2, RaceVehCoords[0][3], random(126), random(126), (60 * 60));
SetPlayerPos(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2);
SetPlayerFacingAngle(playerid, RaceVehCoords[0][3]);
PutPlayerInVehicle(playerid, CreatedRaceVeh[playerid], 0);
Camera(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2], RaceVehCoords[0][3], 20);
PlayersCount[0] = 1;
}
}
case 1:
{
if(PlayersCount[1] != 1)
{
CreatedRaceVeh[playerid] = CreateVehicle(RaceVehicle, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2]+2, RaceVehCoords[1][3], random(126), random(126), (60 * 60));
SetPlayerPos(playerid, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2]+2);
SetPlayerFacingAngle(playerid, RaceVehCoords[1][3]);
PutPlayerInVehicle(playerid, CreatedRaceVeh[playerid], 0);
Camera(playerid, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2], RaceVehCoords[1][3], 20);
PlayersCount[1] = 1;
}
}
}
new
string[128]
;
#if defined RACE_IN_OTHER_WORLD
SetPlayerVirtualWorld(playerid, 10);
#endif
InfoTimer[playerid] = SetTimerEx("TextInfo", 500, 1, "e", playerid);
if(JoinCount == 1) format(string, sizeof(string), "Race: ~w~%s~n~~p~~h~Checkpoint: ~w~%d/%d~n~~b~~h~TimeLeft: ~w~%s~n~~y~Position: ~w~1/1~n~ ", RaceName, CPProgess[playerid], TotalCP, TimeConvert(RaceTime));
else format(string, sizeof(string), "Race: ~w~%s~n~~p~~h~Checkpoint: ~w~%d/%d~n~~b~~h~TimeLeft: ~w~%s~n~~y~Position: ~w~%d/%d~n~ ", RaceName, CPProgess[playerid], TotalCP, TimeConvert(RaceTime), RacePosition[playerid], JoinCount);
TextDrawSetString(RaceInfo[playerid], string);
TextDrawShowForPlayer(playerid, RaceInfo[playerid]);
JoinCount++;
return 1;
}
function CountTillRace()
{
switch(CountAmount)
{
case 0:
{
ForEach(i, MAX_PLAYERS)
{
if(Joined[i] == false)
{
new
string[128]
;
format(string, sizeof(string), "You can't join the \"%s\"", RaceName);
SendClientMessage(i, RED, string);
}
}
StartRace();
}
case 1..5:
{
new
string[10]
;
format(string, sizeof(string), "~b~%d", CountAmount);
ForEach(i, MAX_PLAYERS)
{
if(Joined[i] == true)
{
GameTextForPlayer(i, string, 999, 5);
PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
}
}
}
case 60, 50, 40, 30, 20, 10:
{
new
string[128]
;
format(string, sizeof(string), " \"%d\" seconds untill \"%s\" race starts! Type \"/join\" to join the race.", CountAmount, RaceName);
SendClientMessageToAll(GREEN, string);
}
}
return CountAmount--;
}
function StartRace()
{
ForEach(i, MAX_PLAYERS)
{
if(Joined[i] == true)
{
TogglePlayerControllable(i, true);
PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
GameTextForPlayer(i, "~g~GO", 2000, 5);
SetCameraBehindPlayer(i);
}
}
rCounter = SetTimer("RaceCounter", 900, 1);
RaceTick = GetTickCount();
RaceStarted = 1;
KillTimer(CountTimer);
return 1;
}
function StopRace()
{
KillTimer(rCounter);
RaceStarted = 0;
RaceTick = 0;
RaceBusy = 0x00;
JoinCount = 0;
FinishCount = 0;
TimeProgress = 0;
ForEach(i, MAX_PLAYERS)
{
if(Joined[i] == true)
{
DisablePlayerRaceCheckpoint(i);
DestroyVehicle(CreatedRaceVeh[i]);
Joined[i] = false;
TextDrawHideForPlayer(i, RaceInfo[i]);
CPProgess[i] = 0;
KillTimer(InfoTimer[i]);
}
}
SendClientMessageToAll(YELLOW, "Another race is going to start in a few minutes!");
if(AutomaticRace == true) LoadRaceNames(), LoadAutoRace(RaceNames[random(TotalRaces)]);
return 1;
}
function RaceCounter()
{
if(RaceStarted == 1)
{
RaceTime--;
if(JoinCount <= 0)
{
StopRace();
SendClientMessageToAll(RED, "");
}
}
if(RaceTime <= 0)
{
StopRace();
}
return 1;
}
function TextInfo(playerid)
{
new
string[128]
;
if(JoinCount == 1) format(string, sizeof(string), "Race: ~w~%s~n~~p~~h~Checkpoint: ~w~%d/%d~n~~b~~h~TimeLeft: ~w~%s~n~~y~Position: ~w~1/1~n~", RaceName, CPProgess[playerid], TotalCP, TimeConvert(RaceTime));
else format(string, sizeof(string), "Race: ~w~%s~n~~p~~h~Checkpoint: ~w~%d/%d~n~~b~~h~TimeLeft: ~w~%s~n~~y~Position: ~w~%d/%d~n~", RaceName, CPProgess[playerid], TotalCP, TimeConvert(RaceTime), RacePosition[playerid], JoinCount);
TextDrawSetString(RaceInfo[playerid], string);
TextDrawShowForPlayer(playerid, RaceInfo[playerid]);
}
function Camera(playerid, Float:X, Float:Y, Float:Z, Float:A, Mul)
{
SetPlayerCameraLookAt(playerid, X, Y, Z);
SetPlayerCameraPos(playerid, X + (Mul * floatsin(-A, degrees)), Y + (Mul * floatcos(-A, degrees)), Z+6);
}
function IsPlayerInRace(playerid)
{
if(Joined[playerid] == true) return true;
else return false;
}
function ShowDialog(playerid, dialogid)
{
switch(dialogid)
{
case 599: ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, CreateCaption("Build New Race"), "\
Normal Race\n\
Air Race", "Next", "Exit");
case 600: ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, CreateCaption("Build New Race (Step 1/4)"), "\
Step 1:\n\
********\n\
Welcome to wizard 'Build New Race'.\n\
Before getting started, I need to know the name (e.g. SFRace) of the to save it under.\n\n\
>> Give the NAME below and press 'Next' to continue.", "Next", "Back");
case 601: ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, CreateCaption("Build New Race (Step 1/4)"), "\
ERROR: Name too short or too long! (min. 1 - max. 20)\n\n\n\
Step 1:\n\
********\n\
Welcome to wizard 'Build New Race'.\n\
Before getting started, I need to know the name (e.g. SFRace) of the to save it under.\n\n\
>> Give the NAME below and press 'Next' to continue.", "Next", "Back");
case 602: ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, CreateCaption("Build New Race (Step 2/4)"), "\
Step 2:\n\
********\n\
Please give the ID or NAME of the vehicle that's going to be used in the race you are creating now.\n\n\
>> Give the ID or NAME of the vehicle below and press 'Next' to continue. 'Back' to change something.", "Next", "Back");
case 603: ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, CreateCaption("Build New Race (Step 2/4)"), "\
ERROR: Invalid Vehilce ID/Name\n\n\n\
Step 2:\n\
********\n\
Please give the ID or NAME of the vehicle that's going to be used in the race you are creating now.\n\n\
>> Give the ID or NAME of the vehicle below and press 'Next' to continue. 'Back' to change something.", "Next", "Back");
case 604: ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, CreateCaption("Build New Race (Step 3/4)"),
"\
Step 3:\n\
********\n\
We are almost done! Now go to the start line where the first and second car should stand.\n\
Note: When you click 'OK' you will be free. Use 'KEY_FIRE' to set the first position and second position.\n\
Note: After you got these positions you will automaticly see a dialog to continue the wizard.\n\n\
>> Press 'OK' to do the things above. 'Back' to change something.", "OK", "Back");
case 605: ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, CreateCaption("Build New Race (Step 4/4)"),
"\
Step 4:\n\
********\n\
Welcome to the last stap. In this stap you have to set the checkpoints; so if you click 'OK' you can set the checkpoints.\n\
You can set the checkpoints with 'KEY_FIRE'. Each checkpoint you set will save.\n\
You have to press 'ENTER' button when you're done with everything. You race is aviable then!\n\n\
>> Press 'OK' to do the things above. 'Back' to change something.", "OK", "Back");
case 606: ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, CreateCaption("Build New Race (Done)"),
"\
You have created your race and it's ready to use now.\n\n\
>> Press 'Finish' to finish. 'Exit' - Has no effect.", "Finish", "Exit");
}
return 1;
}
CreateCaption(arguments[])
{
new
string[128 char]
;
format(string, sizeof(string), "RyDeR's Race System - %s", arguments);
return string;
}
stock IsValidVehicle(vehicleid)
{
if(vehicleid < 400 || vehicleid > 611) return false;
else return true;
}
ReturnVehicleID(vName[])
{
Loop(x, 211)
{
if(strfind(vNames[x], vName, true) != -1)
return x + 400;
}
return -1;
}
TimeConvert(seconds)
{
new tmp[16];
new minutes = floatround(seconds/60);
seconds -= minutes*60;
format(tmp, sizeof(tmp), "%d:%02d", minutes, seconds);
return tmp;
}
If you have multiple filterscripts with OnDialogResponse, then OnDialogResponse has to return 0 in the gamemode. If that doesn't work, try to make it return 0 in the filterscripts as well.
Good luck! |
C:\Users\Musikrummet\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc2.pwn(901) : error 001: expected token: ";", but found "return"