Help with my /nos command
#1

Yo so, I've made a /nos command that applys it to vehicles, But when somone types it like on a bike the game crashes S:

I can't have this i want it to say sorry u can't install nitro to this vehicle or somthing thanks


XtremE_
Reply
#2

hi jay iam [UGP]Oscar
Reply
#3

Quote:
Originally Posted by [UGP
Oscar ]
hi jay iam [UGP]Oscar
Off topic: Yo oscar, You can script lol?
Reply
#4

[quote=[XS]XtremE_ ]
Quote:
Originally Posted by [UGP
Oscar ]
hi jay iam [UGP]Oscar
Off topic: Yo oscar, You can script lol?
[/quote
nah
Reply
#5

Donґt go offtopic please.
Topic: If yoou want show us your /nos command
Reply
#6

pawn Код:
if(strcmp("/nos", cmdtext, true) == 0)
   {
     if(IsPlayerInVehicle(playerid))
     {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == ... ); // Check the model of the vehicle. Write the IDs of the bikes here.
        {
          SendClientMessage(playerid, COLOR_RED, "Sorry, you can't install NOS on this vehicle.");
        }
        else
        {
          // Add the NOS here.
        }
     }
     else
     {
        SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle.");
     }
     return 1;
   }
Reply
#7

Quote:
Originally Posted by LTomi
pawn Код:
if(strcmp("/nos", cmdtext, true) == 0)
   {
     if(IsPlayerInVehicle(playerid))
     {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == ... ); // Check the model of the vehicle. Write the IDs of the bikes here.
        {
          SendClientMessage(playerid, COLOR_RED, "Sorry, you can't install NOS on this vehicle.");
        }
        else
        {
          // Add the NOS here.
        }
     }
     else
     {
        SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle.");
     }
     return 1;
   }
Can't i only put one model ID in there?

Quote:

if(GetVehicleModel(GetPlayerVehicleID(playerid)) == ... ); // Check the model of the vehicle. Write the IDs of the bikes here.

Reply
#8

Well?
Reply
#9

Well, yeah. it;s only for the models.
Reply
#10

You can put as many IDs as you want:

pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == ID1 || GetVehicleModel(GetPlayerVehicleID(playerid)) == ID2 || GetVehicleModel(GetPlayerVehicleID(playerid)) == ID3 ... );
But you have to put the MODEL IDs here, NOT the VEHICLE IDs.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)