Vice Underdogs

Scripting => Script Showroom => Topic started by: Wezsent on December 14, 2011, 10:32:18 am

Title: Vehicle Cmds
Post by: Wezsent on December 14, 2011, 10:32:18 am
I gota Share you some of my commands. they are easy. they won't worth any thing
but i wana share them for good

Vehicle Commands for !fix ,!flip and !eject

!fix
Code: [Select]
if ( cmd == "!fix" )
       {
  if ( !player.Vehicle ) PrivMessage( "[Error] - You need to be

in a vehicle.", player );
           else
           {
              if ( player.Vehicle.Health == 1000 ) PrivMessage( "[Error] -

This vehicle doesn't need to fix.", player );
              else
              {
                player.Vehicle.Health = 1000;
                ClientMessage( "-> Your vehicle has been succesfully fixed.",

player, 984, 252, 777 );
             }
          }
     }
!flip
Code: [Select]
if ( cmd == "!flip" )
       {
          
           if ( !player.Vehicle ) PrivMessage( "[Error] - You need to be

in a vehicle.", player );
           else
           {
             local pos = player.Pos;
local veh = player.Vehicle;

                veh.Health = 1000;
veh.Pos = Vector( pos.x+1,pos.y+1.pos.z+1);
                ClientMessage( "-> Your vehicle has been succesfully

Fliped.", player, 984, 252, 777 );
          
          }
     }          
!eject

Code: [Select]
else if ( cmd == "!eject" )
        {
              
 if ( !player.Vehicle ) PrivMessage("*Error : You must be in Vehicle to

get Ejected",player);
else {
local pos = player.Pos;
PrivMessage("You Have Been Ejected From

["+GetVehicleNameFromModel(player.Vehicle.Model)+"]

ID:"+player.Vehicle.ID,player);
player.Pos = Vector( pos.x + 1 , pos.y +2 , pos.z + 3 );

}
}
Title: Re: Vehicle Cmds
Post by: Metalord on December 15, 2011, 11:23:50 am

                ClientMessage( "-> Your vehicle has been succesfully


Your vehicle has been successfully flipped***

I'm right?
Title: Re: Vehicle Cmds
Post by: Charley on December 15, 2011, 11:38:55 am

                ClientMessage( "-> Your vehicle has been succesfully


Your vehicle has been successfully flipped***

I'm right?

It's on the next line. I guess these commands are alright, although I haven't looked over them properly. The one thing I do notice is that they're a big clunky. I'd use more else if () instead of else { if () just purely from an aesthetic point of view.
Title: Re: Vehicle Cmds
Post by: Crossfire|OutlawZ on December 15, 2011, 11:51:56 am

                ClientMessage( "-> Your vehicle has been succesfully


Your vehicle has been successfully flipped***

I'm right?


It's on the next line. I guess these commands are alright, although I haven't looked over them properly. The one thing I do notice is that they're a big clunky. I'd use more else if () instead of else { if () just purely from an aesthetic point of view.
heh yeah