SA-MP Forums Archive
My NOS script... - 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: My NOS script... (/showthread.php?tid=97759)



My NOS script... - Goobiiify - 16.09.2009

Hello, I'll need some help as I'm really new on doing script for SAMP. I would like to do that nobody can add NOS into bikes as that cause crashes.

This is how my script looks right now.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if (newkeys == KEY_SUBMISSION){
   
    if (GetPlayerMoney(playerid)>1049){
    AddVehicleComponent(vehicleid, 1010); // Nitro
    GivePlayerMoney(playerid,-1050);
  SendClientMessage(playerid,COLOR_GREEN,"Nitro added to vehicle ((Cost:1050$))");}
 
  else{
  SendClientMessage(playerid,COLOR_RED,"You don't have money for nitro, earn some first! (cost 1050$)");
    }}


    return 1;
}
Thanks!


Re: My NOS script... - Calgon - 16.09.2009

Use these, taken from Carlitos Roleplay (credits to Norn):

pawn Код:
public IsAPlane(vehicleid)
{  new model = GetVehicleModel(vehicleid);
    if(model == 592 || model == 577 || model == 511 || model == 512 || model == 593 || model == 520 || model == 553 || model == 476 || model == 519 || model == 460 || model == 513)
    {
        return 1;
    }
    return 0;
}
public IsAHelicopter(vehicleid)
{  new model = GetVehicleModel(vehicleid);
    if(model == 548 || model == 525 || model == 417 || model == 487 || model == 488 || model == 497 || model == 563 || model == 447 || model == 469)
    {
        return 1;
    }
    return 0;
}
public IsABike(vehicleid)
{  new model = GetVehicleModel(vehicleid);
    if(model == 581 || model == 509 || model == 481 || model == 462 || model == 521 || model == 463 || model == 510 || model == 522 || model == 461 || model == 448 || model == 471 || model == 468 || model == 586)
    {
        return 1;
    }
    return 0;
}



Re: My NOS script... - Goobiiify - 16.09.2009

Quote:
Originally Posted by Calgon
Use these, taken from Carlitos Roleplay (credits to Norn):

pawn Код:
public IsAPlane(vehicleid)
{ new model = GetVehicleModel(vehicleid);
    if(model == 592 || model == 577 || model == 511 || model == 512 || model == 593 || model == 520 || model == 553 || model == 476 || model == 519 || model == 460 || model == 513)
    {
        return 1;
    }
    return 0;
}
public IsAHelicopter(vehicleid)
{ new model = GetVehicleModel(vehicleid);
    if(model == 548 || model == 525 || model == 417 || model == 487 || model == 488 || model == 497 || model == 563 || model == 447 || model == 469)
    {
        return 1;
    }
    return 0;
}
public IsABike(vehicleid)
{ new model = GetVehicleModel(vehicleid);
    if(model == 581 || model == 509 || model == 481 || model == 462 || model == 521 || model == 463 || model == 510 || model == 522 || model == 461 || model == 448 || model == 471 || model == 468 || model == 586)
    {
        return 1;
    }
    return 0;
}
Thank you! :]


Re: My NOS script... - Calgon - 16.09.2009

Just add IsABike(vehicleid); bla bla, etc. Good luck scripting.