How to allow just some cars... - 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: How to allow just some cars... (
/showthread.php?tid=598901)
How to allow just some cars... -
AndreiWow - 18.01.2016
Код:
if(dialogid == 687) // Vehicle
{
if(response)
{
new model = strval(inputtext);
if(model < 400)
return ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");
if(model > 611)
return ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");
if(model == 425 || model == 432 || model == 476 || model == 447 || model == 537 || model == 538 || model == 569 || model == 570 || model == 584 || model == 590 || model == 591 || model == 606 || model == 607 || model == 608 || model == 610 || model == 611 || model == 441 || model == 464 || model == 465 || model == 501 || model == 564 || model == 594 || model == 435 || model == 449 || model == 450)
{
SendClientMessage(playerid, 0xE21F1FFF, "Those vehicles are restricted!");
ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");
return 1;
}
SetupHouseInfo[playerid][SetupCarModel] = model;
IsSettingUpVehicle[playerid] = true;
ShowPlayerDialog(playerid, 255, DIALOG_STYLE_MSGBOX, "Vehicle Setup", "Go to the position you want your vehicle to spawn, then type /confirm.", "Select", "Cancel");
return 1;
}
I want to allow like just 3 models not all models.
404
410
436
Re: How to allow just some cars... -
SupperRobin6394 - 18.01.2016
PHP код:
if(dialogid == 687) // Vehicle
{
if(response)
{
new model = strval(inputtext);
if(model < 400)
return ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");
if(model > 611)
return ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");
if(model != 404 || model != 410 || model != 436)
{
SendClientMessage(playerid, 0xE21F1FFF, "Those vehicles are restricted!");
ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");
return 1;
}
SetupHouseInfo[playerid][SetupCarModel] = model;
IsSettingUpVehicle[playerid] = true;
ShowPlayerDialog(playerid, 255, DIALOG_STYLE_MSGBOX, "Vehicle Setup", "Go to the position you want your vehicle to spawn, then type /confirm.", "Select", "Cancel");
return 1;
}