dumb! - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: dumb! (
/showthread.php?tid=210286)
dumb! -
ColdXX - 12.01.2011
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.
Re: dumb! -
blackwave - 12.01.2011
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
Re: dumb! -
ColdXX - 12.01.2011
Tried something similar but it didnt work...anyone else?
Re: dumb! -
blackwave - 12.01.2011
This should works. Since it checks player vehicle, and these cases are the motocycle / bikes.
Re: dumb! -
ColdXX - 12.01.2011
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!
Re: dumb! -
blackwave - 12.01.2011
The id 509 is a bike. Then, obviously:
pawn Код:
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 509) return 0;
Re: dumb! -
Scenario - 12.01.2011
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;
}
Re: dumb! -
iMonk3y - 12.01.2011
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;
}
Re: dumb! -
Stylock - 12.01.2011
You need to check vehicle model, not vehicle id.
pawn Код:
switch(GetVehicleModel(vehicleid))
Re: dumb! -
ColdXX - 12.01.2011
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