SA-MP Forums Archive
scripts problme ??? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: scripts problme ??? (/showthread.php?tid=512944)



scripts problme ??? - tooq - 13.05.2014

hello, i have a problme in my server soo i have a car spawner system and a weapon system when i add the weapon system first it works good but after i add car spawner system he show me the dialog and when i select a car nothing happens it not spawn ..


Re: scripts problme ??? - iZN - 13.05.2014

Dialog IDs are conflicting, you better change them so they shouldn't conflict with each other. Also check if you have OnDialogResponse returning 0.


Re: scripts problme ??? - tooq - 13.05.2014

i dont exactly how to do that here the code
edit it for me /*
.:[Vehicle Spawner V. 1.2]:. by x96664
Please don't remove my credits!
Use /v to open vehicle dialog.
*/
#include <a_samp>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//Colors
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_WHITE2 {FFFFFF}
#define COLOR_RED 0xff0000a7
#define COLOR_RED2 {FF0000}
//RC vehicles
#define RC_BANDIT 441
#define RC_BARON 464
#define RC_GOBLIN 501
#define RC_RAIDER 465
#define D_TRAM 449
#define RC_TIGER 564
#define RC_CAM 594
//Dialogs I'm using bigger dialog ids to don't make conflict with your server dialogs.
#define Dialog_Unique_Vehicle 10000
#define Dialog_Trailers_Vehicle 10001
#define Dialog_Boats_Vehicle 10002
#define Dialog_Station_Vehicle 10003
#define Dialog_Sport_Vehicle 10004
#define Dialog_Saloon_Vehicle 10005
#define Dialog_Public_Service_Vehicle 10006
#define Dialog_Off-Road_Vehicle 10007
#define Dialog_Low-Rider_Vehicle 10008
#define Dialog_Industry_Vehicle 10009
#define Dialog_Convertable_Vehicle 10010
#define Dialog_Bike_Vehicle 10011
#define Dialog_Helicopters 10012
#define Dialog_Airplanes 10013
#define Dialog_Rc_Vehicle 10014
#define Dialog_Vehicle 10015
//Defines
#define MAX_PLAYERVEHICLES 1
#define VehicleSpawnerLimit 1
//Forward
forward VehicleSpawner(playerid,model);
forward VehicleDeleter(vehicleid);
forward VehicleReseter(vehicleid);
forward VehicleSpawnerLimiter(playerid);
//new
new VehicleSpawn[MAX_PLAYERS];
new PlayerVehicle[MAX_PLAYERS][MAX_PLAYERVEHICLES];
new Turn[MAX_PLAYERS];
//vehicles
new Airplanes[] = { 592, 577, 511, 512, 593, 520, 553, 476, 519, 460, 513 };
new Helicopters[] = { 548, 425, 417, 487, 488, 497, 563, 447, 469 };
new Bikes[] = { 581, 509, 481, 462, 521, 463, 510, 522, 461, 448, 471, 468, 586 };
new Convertibles[] = { 480, 533, 439, 555 };
new Industrials[] = { 499, 422, 482, 498, 609, 524, 578, 455, 403, 414, 582, 443, 514, 413, 515, 440, 543, 605, 459, 531, 408, 552, 478, 456, 554 };
new Lowriders[] = { 536, 575, 534, 567, 535, 566, 576, 412 };
new Offroad[] = { 568, 424, 573, 579, 400, 500, 444, 556, 557, 470, 489, 505, 495 };
new Public[] = { 416, 433, 431, 438, 437, 523, 427, 490, 528, 407, 544, 596, 598, 597, 599, 432, 601, 420 };
new Saloons[] = { 445, 504, 401, 518, 527, 542, 507, 562, 585, 419, 526, 604, 466, 492, 474, 546, 517, 410, 551, 516, 467, 600, 426, 436, 547, 405, 580, 560, 550, 549, 540, 491, 529, 421 };
new Sport[] = { 602, 429, 496, 402, 541, 415, 589, 587, 565, 494, 502, 503, 411, 559, 603, 475, 506, 451, 558, 477 };
new Station[] = { 418, 404, 479, 458, 561 };
new Boats[] = { 472, 473, 493, 595, 484, 430, 453, 452, 446, 454 };
new Trailers[] = { 435, 450, 591, 606, 607, 610, 569, 590, 584, 570, 608, 611 };
new Unique[] = { 485, 537, 457, 483, 508, 532, 486, 406, 530, 538, 434, 545, 588, 571, 572, 423, 442, 428, 409, 574, 449, 525, 583, 539 };
new RC_Vehicles[] = { 441, 464, 465, 501, 564, 594 };

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("|Vehicle spawner by x96664 loaded! |");
print("--------------------------------------\n");
SetTimer("VehicleSpawnLimiter", 1000, true);
return 1;
}

public OnFilterScriptExit()
{ print("\n--------------------------------------");
print("|Vehicle spawner by x96664 unloaded! |");
print("--------------------------------------\n");
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(v, 1,cmdtext);
return 0;
}
dcmd_v(playerid, params[])
{
#pragma unused params
ShowVehicleDialog(playerid);
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{

if(newkeys == KEY_SECONDARY_ATTACK ){
if(!IsPlayerInAnyVehicle(playerid)){
new Float, Float:y, Float:z, vehicle;
GetPlayerPos(playerid, x, y, z );
GetVehicleWithinDistance(playerid, x, y, z, 20.0, vehicle);

if(IsVehicleRc(vehicle)){
PutPlayerInVehicle(playerid, vehicle, 0);
}
}

else {
new vehicleID = GetPlayerVehicleID(playerid);
if(IsVehicleRc(vehicleID) || GetVehicleModel(vehicleID) == RC_CAM){
if(GetVehicleModel(vehicleID) != D_TRAM){
new Float, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x+0.5, y, z+1.0);
}
}
}
}
}
GetVehicleWithinDistance( playerid, Float1, Float:y1, Float:z1, Float:dist, &veh){
for(new i = 1; i < MAX_VEHICLES; i++){
if(GetVehicleModel(i) > 0){
if(GetPlayerVehicleID(playerid) != i ){
new Float, Float:y, Float:z;
new Float2, Float:y2, Float:z2;
GetVehiclePos(i, x, y, z);
x2 = x1 - x; y2 = y1 - y; z2 = z1 - z;
new Float:vDist = (x2*x2+y2*y2+z2*z2);
if( vDist < dist){
veh = i;
dist = vDist;
}
}
}
}
}
IsVehicleRc( vehicleid ){
new model = GetVehicleModel(vehicleid);
switch(model){
case RC_GOBLIN, RC_BARON, RC_BANDIT, RC_RAIDER, RC_TIGER: return 1;
default: return 0;
}

return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid== Dialog_Vehicle)
{
if ( response==1 )
{
if(listitem==0)ShowPlayerDialog( playerid, Dialog_Airplanes, 2, "{ffffff}Airplanes:", "Andromada\nAT-400\nBeagle\nCropduster\nDodo\nHydra {FF0000}(Admin only)\nNevada\nRustler\nShamal\nSkimmer\nStuntplan e", "Spawn", "Back" );
if(listitem==1)ShowPlayerDialog( playerid, Dialog_Helicopters, 2, "{ffffff}Helicopters:", "Cargobob\nHunter {FF0000}(Admin only)\nLeviathan\nMaverick\nNews Maverick\nPolice Maverick\nRaindance\nSeasparrow {FF0000}(Admin only)\nSparrow", "Spawn", "Back" );
if(listitem==2)ShowPlayerDialog( playerid, Dialog_Bike_Vehicle, 2, "{ffffff}Bikes:", "BF-400\nBike\nBMX\nFaggio\nFCR-900\nFreeway\nMountain Bike\nNRG-500\nPCJ-600\nPizzaboy\nQuad\nSanchez\nWayfarer", "Spawn", "Back" );
if(listitem==3)ShowPlayerDialog( playerid, Dialog_Convertable_Vehicle, 2, "{ffffff}Convertibles:", "Comet\nFeltzer\nStallion\nWindsor", "Spawn", "Back" );
if(listitem==4)ShowPlayerDialog( playerid, Dialog_Industry_Vehicle, 2, "{ffffff}Industrial:", "Benson\nBobcat\nBurrito\nBoxville\nBoxburg\nCemen t Truck\nDFT-30\nFlatbed\nLinerunner\nMule\nNewsvan\nPacker\nPe trol Tanker\nPony\nRoadtrain\nRumpo\nSadler\nSadler Shit\nTopfun\nTractor\nTrashmaster\nUtility Van\nWalton\nYankee\nYosemite", "Spawn", "Back" );
if(listitem==5)ShowPlayerDialog( playerid, Dialog_Low-Rider_Vehicle, 2, "{ffffff}Lowriders:", "Blade\nBroadway\nRemington\nSavanna\nSlamvan\nTah oma\nTornado\nVoodoo", "Spawn", "Back" );
if(listitem==6)ShowPlayerDialog( playerid, Dialog_Off-Road_Vehicle, 2, "{ffffff}Off Road:", "Bandito\nBF Injection\nDune\nHuntley\nLandstalker\nMesa\nMonst er\nMonster A\nMonster B\nPatriot\nRancher A\nRancher B\nSandking", "Spawn", "Back" );
if(listitem==7)ShowPlayerDialog( playerid, Dialog_Public_Service_Vehicle, 2, "{ffffff}Public Service Vehicles:", "Ambulance\nBarracks\nBus\nCabbie\nCoach\nCop Bike (HPV-1000)\nEnforcer\nFBI Rancher\nFBI Truck\nFiretruck\nFiretruck LA\nPolice Car (LSPD)\nPolice Car (LVPD)\nPolice Car (SFPD)\nRanger\nRhino {FF0000}(Admin only)\nS.W.A.T\nTaxi", "Spawn", "Back" );
if(listitem==ShowPlayerDialog( playerid, Dialog_Saloon_Vehicle, 2, "{ffffff}Saloons:", "Admiral\nBloodring Banger\nBravura\nBuccaneer\nCadrona\nClover\nElega nt\nElegy\nEmperor\nEsperanto\nFortune\nGlendale Shit\nGlendale\nGreenwood\nHermes\nIntruder\nMajes tic\nManana\nMerit\nNebula\nOceanic\nPicador\nPrem ier\nPrevion\nPrimo\nSentinel\nStafford\nSultan\nS unrise\nTampa\nVincent\nVirgo\nWillard\nWashington ", "Spawn", "Back" );
if(listitem==9)ShowPlayerDialog( playerid, Dialog_Sport_Vehicle, 2, "{ffffff}Sport Vehicles:", "Alpha\nBanshee\nBlista Compact\nBuffalo\nBullet\nCheetah\nClub\nEuros\nFl ash\nHotring Racer\nHotring Racer A\nHotring Racer B\nInfernus\nJester\nPhoenix\nSabre\nSuper GT\nTurismo\nUranus\nZR-350", "Spawn", "Back" );
if(listitem==10)ShowPlayerDialog( playerid, Dialog_Station_Vehicle, 2, "{ffffff}Station Wagons:", "Moonbeam\nPerenniel\nRegina\nSolair\nStratum" , "Spawn", "Back" );
if(listitem==11)ShowPlayerDialog( playerid, Dialog_Boats_Vehicle, 2, "{ffffff}Boats:", "Coastguard\nDinghy\nJetmax\nLaunch\nMarquis\nPred ator\nReefer\nSpeeder\nSquallo\nTropic", "Spawn", "Back" );
if(listitem==12)ShowPlayerDialog( playerid, Dialog_Trailers_Vehicle, 2, "{ffffff}Trailers:", "Article Trailer\nArticle Trailer 2\nArticle Trailer 3\nBaggage Trailer A\nBaggage Trailer B\nFarm Trailer\nFreight Flat Trailer (Train)\nFreight Box Trailer (Train)\nPetrol Trailer\nStreak Trailer (Train)\nStairs Trailer\nUtility Trailer", "Spawn", "Back" );
if(listitem==13)ShowPlayerDialog( playerid, Dialog_Unique_Vehicle, 2, "{ffffff}Unique Vehicles:", "Baggage\nBrownstreak (Train)\nCaddy\nCamper\nCamper A\nCombine Harvester\nDozer\nDumper\nForklift\nFreight (Train)\nHotknife\nHustler\nHotdog\nKart\nMower\nM r Whoopee\nRomero\nSecuricar\nStretch\nSweeper\nTram \nTowtruck\nTug\nVortex", "Spawn", "Back" );
if(listitem==14)ShowPlayerDialog( playerid, Dialog_Rc_Vehicle, 2, "{ffffff}RC Vehicles:", "RC Bandit\nRC Baron\nRC Raider\nRC Goblin\nRC Tiger\nRC Cam", "Spawn", "Back" );
}
}
//Airplanes
if(response)
{
switch(dialogid)
{
case Dialog_Airplanes:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Airplanes[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Airplanes[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Airplanes[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Airplanes[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Airplanes[ listitem ]);
}
case 5: //Hydra
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xff0000a7, "You must be logged-in as administrator to spawn {FFFFFF}Hydra{FF0000} !");
VehicleSpawner(playerid,Airplanes[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Airplanes[ listitem ]);
}
case 7:
{
VehicleSpawner(playerid,Airplanes[ listitem ]);
}
case 8:
{
VehicleSpawner(playerid,Airplanes[ listitem ]);
}
case 9:
{
VehicleSpawner(playerid,Airplanes[ listitem ]);
}
case 10:
{
VehicleSpawner(playerid,Airplanes[ listitem ]);
}
}
}
}
}
//Helicopters
if(response)
{
switch(dialogid)
{
case Dialog_Helicopters:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Helicopters[ listitem ]);
}
case 1:
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xff0000a7, "You must be logged-in as administrator to spawn {FFFFFF}Hunter{FF0000} !");
VehicleSpawner(playerid,Helicopters[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Helicopters[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Helicopters[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Helicopters[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,Helicopters[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Helicopters[ listitem ]);
}
case 7:
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xff0000a7, "You must be logged-in as administrator to spawn {FFFFFF}Seasparrow{FF0000} !");
VehicleSpawner(playerid,Helicopters[ listitem ]);
}
case 8:
{
VehicleSpawner(playerid,Helicopters[ listitem ]);
}
}
}
}
}
//Bikes
if(response)
{
switch(dialogid)
{
case Dialog_Bike_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 7:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 8:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 9:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 10:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 11:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
case 12:
{
VehicleSpawner(playerid,Bikes[ listitem ]);
}
}
}
}
}
//Convertibles
if(response)
{
switch(dialogid)
{
case Dialog_Convertable_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Convertibles[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Convertibles[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Convertibles[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Convertibles[ listitem ]);
}
}
}
}
}
//Industrial
if(response)
{
switch(dialogid)
{
case Dialog_Industry_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 7:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 8:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 9:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 10:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 11:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 12:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 13:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 14:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 15:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 16:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 17:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 18:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 19:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 20:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 21:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 22:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 23:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
case 24:
{
VehicleSpawner(playerid,Industrials[ listitem ]);
}
}
}
}
}
//Lowriders
if(response)
{
switch(dialogid)
{
case Dialog_Low-Rider_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Lowriders[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Lowriders[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Lowriders[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Lowriders[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Lowriders[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,Lowriders[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Lowriders[ listitem ]);
}
case 7:
{
VehicleSpawner(playerid,Lowriders[ listitem ]);
}
}
}
}
}
//Off-road
if(response)
{
switch(dialogid)
{
case Dialog_Off-Road_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 7:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 8:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 9:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 10:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 11:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
case 12:
{
VehicleSpawner(playerid,Offroad[ listitem ]);
}
}
}
}
}
//Public Service
if(response)
{
switch(dialogid)
{
case Dialog_Public_Service_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 7:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 8:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 9:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 10:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 11:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 12:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 13:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 14:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 15:
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xff0000a7, "You must be logged-in as administrator to spawn {FFFFFF}Rhino{FF0000} !");
VehicleSpawner(playerid,Public[ listitem ]);
}
case 16:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
case 17:
{
VehicleSpawner(playerid,Public[ listitem ]);
}
}
}
}
}
//Saloons
if(response)
{
switch(dialogid)
{
case Dialog_Saloon_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 7:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 8:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 9:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 10:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 11:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 12:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 13:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 14:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 15:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 16:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 17:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 18:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 19:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 20:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 21:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 22:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 23:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 24:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 25:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 26:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 27:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 28:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 29:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 30:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 31:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 32:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
case 33:
{
VehicleSpawner(playerid,Saloons[ listitem ]);
}
}
}
}
}
//Sport
if(response)
{
switch(dialogid)
{
case Dialog_Sport_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 7:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 8:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 9:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 10:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 11:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 12:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 13:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 14:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 15:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 16:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 17:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 18:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
case 19:
{
VehicleSpawner(playerid,Sport[ listitem ]);
}
}
}
}
}
//Station
if(response)
{
switch(dialogid)
{
case Dialog_Station_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Station[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Station[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Station[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Station[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Station[ listitem ]);
}
}
}
}
}
//Boats
if(response)
{
switch(dialogid)
{
case Dialog_Boats_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Boats[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Boats[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Boats[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Boats[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Boats[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,Boats[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Boats[ listitem ]);
}
case 7:
{
VehicleSpawner(playerid,Boats[ listitem ]);
}
case 8:
{
VehicleSpawner(playerid,Boats[ listitem ]);
}
case 9:
{
VehicleSpawner(playerid,Boats[ listitem ]);
}
}
}
}
}
//Trailers
if(response)
{
switch(dialogid)
{
case Dialog_Trailers_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
case 7:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
case 8:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
case 9:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
case 10:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
case 11:
{
VehicleSpawner(playerid,Trailers[ listitem ]);
}
}
}
}
}
//Unique
if(response)
{
switch(dialogid)
{
case Dialog_Unique_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 6:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 7:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 8:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 9:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 10:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 11:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 13:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 14:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 15:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 16:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 17:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 18:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 19:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 20:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 21:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 22:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
case 23:
{
VehicleSpawner(playerid,Unique[ listitem ]);
}
}
}
}
}
//RC vehicles
if(response)
{
switch(dialogid)
{
case Dialog_Rc_Vehicle:
{
switch(listitem)
{
case 0:
{
VehicleSpawner(playerid,RC_Vehicles[ listitem ]);
}
case 1:
{
VehicleSpawner(playerid,RC_Vehicles[ listitem ]);
}
case 2:
{
VehicleSpawner(playerid,RC_Vehicles[ listitem ]);
}
case 3:
{
VehicleSpawner(playerid,RC_Vehicles[ listitem ]);
}
case 4:
{
VehicleSpawner(playerid,RC_Vehicles[ listitem ]);
}
case 5:
{
VehicleSpawner(playerid,RC_Vehicles[ listitem ]);
}
}
}
}
}
/*
if(dialogid== Dialog_Rc_Vehicle){
if ( response ){
VehicleSpawner(playerid,RC_Vehicles[ listitem ]);
}else ShowVehicleDialog(playerid);
}*/
return 0;
}

stock ShowVehicleDialog(playerid)
{
ShowPlayerDialog(playerid, Dialog_Vehicle, 2, "{ffffff}Vehicle categories:", "Airplanes\nHelicopters\nBikes\nConvertibles\nIndu strial\nLowriders\nOff Road\nPublic Service Vehicles\nSaloons\nSport Vehicles\nStation Wagons\nBoats\nTrailers\nUnique Vehicles\nRC Vehicles", "Select", "Back" );
}

public VehicleSpawner(playerid,model){
if(IsPlayerInAnyVehicle(playerid)){
SendClientMessage(playerid, COLOR_RED, "Error: You're already in vehicle!");
}
else{
if(VehicleSpawn[playerid]==0){
new Float,Float:y,Float:z,Float:a, vehicleid;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
vehicleid = CreateVehicle(model,x+1,y+1,z,a,-1,-1,-1);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleHealth(vehicleid, 1000.0);
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
for(new i=0;i<MAX_PLAYERVEHICLES;i++){
if(Turn[playerid]==MAX_PLAYERVEHICLES){
VehicleDeleter(PlayerVehicle[playerid][0]);
new b=MAX_PLAYERVEHICLES-1;
for(new c=0;c<b;c++){
new A=c+1;
PlayerVehicle[playerid][c]=PlayerVehicle[playerid][A];
}
PlayerVehicle[playerid][b]=0;
Turn[playerid]--;
}
if(!PlayerVehicle[playerid][i]){
PlayerVehicle[playerid][i]=vehicleid;
Turn[playerid]++;
break;
}
}
}
else{
new string[256];
format(string, sizeof(string), "Please wait %d sec. to spawn again a vehicle!", VehicleSpawn[playerid]);
SendClientMessage(playerid,COLOR_RED, string);
}
}
}
public VehicleDeleter(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++){
new Float:X,Float:Y,Float:Z;
if(IsPlayerInVehicle(i, vehicleid)){
RemovePlayerFromVehicle(i);
GetPlayerPos(i,X,Y,Z);
SetPlayerPos(i,X,Y+3,Z);
}
SetVehicleParamsForPlayer(vehicleid,i,0,1);
}
SetTimerEx("VehicleReseter",2000,0,"i",vehicleid);
}

public VehicleReseter(vehicleid)
{
DestroyVehicle(vehicleid);
}

public VehicleSpawnerLimiter(){
new i;
for(i=0;i<=MAX_PLAYERS;i++){
if(VehicleSpawn[i]>0){
VehicleSpawn[i]--;
}
}
}
public OnVehicleSpawn(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
for(new u=0;u<MAX_PLAYERVEHICLES;u++)
{
if(vehicleid==PlayerVehicle[i][u])
{
VehicleDeleter(vehicleid);
PlayerVehicle[i][u]=0;
Turn[i]--;
}
}
}
return 0;
}