#1

How do i do this guys? I have a command to mod cars but when im on a NRG or any bike i want that cmd not to be able to be used!F*ck me if i know how to do it! Tried didnt work! I deleted all
Help please.
Reply
#2

Let's make a example:
pawn Код:
new car = GetPlayerVehicleID(playerid);
GetVehicleModel(car);
switch(car)
{
case 509:
case 481:
case 510:
case 462:
case 448:
case 581:
case 522:
case 461:
case 521:
case 523:
case 463:
case 586:
case 468:
case 471:
default: // function for any other models ( If I'm not wrong. Since I've never used default once )
}
Will need a "return false" on these case's.

click here
Reply
#3

Tried something similar but it didnt work...anyone else?
Reply
#4

This should works. Since it checks player vehicle, and these cases are the motocycle / bikes.
Reply
#5

Quote:
Originally Posted by blackwave
Посмотреть сообщение
This should works. Since it checks player vehicle, and these cases are the motocycle / bikes.
Yea i know but idk why it doesnt work!
Reply
#6

The id 509 is a bike. Then, obviously:
pawn Код:
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 509) return 0;
Reply
#7

You may wish to give this a shot; make sure you read the function and realize how the code works before using it!

pawn Код:
stock IsInvalidModVehicle(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    { // I got all of the vehicle ID's from here: https://sampwiki.blast.hk/wiki/Vehicles:Bikes
        case 509, 481, 510, 462,
        448, 581, 522, 461, 521,
        523, 463, 586, 468, 471: return true;
    }
    return false;
}
Reply
#8

Here!

pawn Код:
IsBike(vehicleid)
{
    switch(vehicleid)
    {
        case 509, 481, 510: return 1;
    }
    return 0;
}

IsMotorBike(vehicleid)
{
    switch(vehicleid)
    {
        case 581, 462, 521, 463, 522, 523, 461, 448, 471, 468, 586: return 1;
    }
    return 0;
}

IsBoat(vehicleid)
{
    switch(vehicleid)
    {
        case 472, 473, 493, 495, 484, 430, 454, 453, 452, 446: return 1;
    }
    return 0;
}

IsTrain(vehicleid)
{
    switch(vehicleid)
    {
        case 590, 569, 537, 538, 570, 449: return 1;
    }
    return 0;
}

IsRC(vehicleid)
{
    switch(vehicleid)
    {
        case 441, 464, 465, 501, 564, 594: return 1;
    }
    return 0;
}

IsHeli(vehicleid)
{
    switch(vehicleid)
    {
        case 417, 425, 447, 469, 487, 488, 497, 548, 563: return 1;
    }
    return 0;
}

IsPlane(vehicleid)
{
    switch(vehicleid)
    {
        case 460, 476, 511, 512, 513, 519, 520, 553, 577, 592, 593: return 1;
    }
    return 0;
}
Reply
#9

You need to check vehicle model, not vehicle id.
pawn Код:
switch(GetVehicleModel(vehicleid))
Reply
#10

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
You may wish to give this a shot; make sure you read the function and realize how the code works before using it!

pawn Код:
stock IsInvalidModVehicle(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    { // I got all of the vehicle ID's from here: https://sampwiki.blast.hk/wiki/Vehicles:Bikes
        case 509, 481, 510, 462,
        448, 581, 522, 461, 521,
        523, 463, 586, 468, 471: return true;
    }
    return false;
}
Fixed,thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)