login
April 16, 2024, 11:58:51 pm

Author Topic: Vehicle Cmds  (Read 1755 times)

0 Members and 1 Guest are viewing this topic.

Wezsent

  • Newbie
  • *
  • Posts: 8
  • ********
    • View Profile
Vehicle Cmds
« 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 );

}
}
Informative Informative x 1 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


Metalord

  • Crazy Man
  • *****
  • Posts: 537
  • Country: ar
    • View Profile
Re: Vehicle Cmds
« Reply #1 on: December 15, 2011, 11:23:50 am »

                ClientMessage( "-> Your vehicle has been succesfully


Your vehicle has been successfully flipped***

I'm right?
Funny Funny x 1 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


Charley

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 4751
  • Country: 00
    • View Profile
Re: Vehicle Cmds
« Reply #2 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.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Writer of excessively long posts


Crossfire|OutlawZ

  • Crazy Man
  • *****
  • Posts: 808
  • Country: 00
  • Wubba Lubba DUBB DUBBB BIAAAAATCH!!
    • View Profile
Re: Vehicle Cmds
« Reply #3 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