Vaild vehicle ID...
#1

Hey again, I need help with my script, here it is:

Код:
if(vehicle < 400 ||  vehicle > 611) return  SendClientMessage(playerid, red, "ERROR: Invalid vehicle model or you cannot spawn this vehicle!");
Here I can spawn all vehicles (i'm not going to add all command). But, I want disable some vehicles:

425
430
432
441
447
449
464
465
476
501
520
537
538
564
569
570
577
590
592
594

Here are the "forbidden" vehicle IDs for my server. Can you help and disable it? I know how to make it, but it's too much and it's too hard to make for me (when I am adding, IDK what am I doing).
Reply
#2

pawn Код:
if(vehicle < 400 ||  vehicle > 611 || vehicle == 425 || vehicle == 430 ||
vehicle == 432 || vehicle == 441 || vehicle == 447 || vehicle == 449 ||
vehicle == 464 || vehicle == 465 || vehicle == 476 || vehicle == 501 ||
vehicle == 520 || vehicle == 537 || vehicle == 538 || vehicle == 564 ||
vehicle == 569 || vehicle == 570 || vehicle == 577 || vehicle == 590 ||
vehicle == 592 || vehicle == 594)
{
    //your stuff
}
Reply
#3

or
pawn Код:
stock Disabled(veh)
{
    if(!(400 <= veh <= 611)) return 1;
    switch(veh) {case 425,430,432,441,447,449,464,465,476,501,520,537,538,564,569,570,577,590,592,594: return 1;}
    return 0;
}
if(Disabled(vehicle)) return  SendClientMessage(playerid, red, "ERROR: Invalid vehicle model or you cannot spawn this vehicle!");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)