First Mod !

Hey Guyz I am Back So....




Lets Begin!



Now Open Notepad....


Now You Must Be Wondering....




C# in Notepad?

Yep.



Now Lets Start......


We Are Going To Make a HELI SPAWNER!

Now...FIRST THINGS FIRST.... well in notepad

I Will Put Code IN This Font  (With Bold and Underlined)

huh.... let it be...

First You Need TO PUT THIS!

And The Things With // Is For Explanation....not Needed To Type For You Guys..but if You Do

No PROBLEM!

Code:

------------------------------------------------------------------------------------------------------------


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GTA;

------------------------------------------------------------------------------------------------------------

Yeah That Code ^
                           |


And Now Lets Do Some Coding...


Code:

------------------------------------------------------------------------------------------------------------



namespace tutorialScriptVS         -> THAT tutorialScriptVS Can Be Renamed As You Want!
{
   public class tutScriptVS : Script                            
   {

       public tutScriptVS()
       {

           //bind keydown event.
           this.KeyDown += new GTA.KeyEventHandler(testKeyDown);  
         


           //key down handler
           public void testKeyDown(object sender, GTA.KeyEventArgs e)
           {
               if (Keys.Q == e.Key)     -> Here (Key.Q == e.Key) Is The HotKey...It Delcares Q As Hotkey
               {
                   //get position to put vehicle
                   Vector3 vehPos = Player.Character.Position.Around(10.0f);
                 
                   //create vehicle
                   World.CreateVehicle(new Model("ANNIHILATOR"), vehPos);
               }
           }

  }
}


------------------------------------------------------------------------------------------------------------


Note: You Can Change The Hotkey Too By:

if (Keys.X == e.Key)  It Would Declare X as The Hotkey

So Here's Your Final Code!


Code:

------------------------------------------------------------------------------------------------------------


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GTA;

namespace tutorialScriptVS
{
   public class tutScriptVS : Script
   {

       public tutScriptVS()
       {

           //bind keydown event.
           this.KeyDown += new GTA.KeyEventHandler(testKeyDown);
         


           //key down handler
           public void testKeyDown(object sender, GTA.KeyEventArgs e)
           {
               if (Keys.Q == e.Key)
               {
                   //get position to put vehicle
                   Vector3 vehPos = Player.Character.Position.Around(10.0f);
                 
                   //create vehicle
                   World.CreateVehicle(new Model("ANNIHILATOR"), vehPos);
               }
           }

  }
}


------------------------------------------------------------------------------------------------------------

And Now Goto Save As....And Save The File As Follows


Get It :

File Name: AnyThingYouWant.cs  (.cs IS IMPORTANT AT THE END!)
Save as type: All Files (*.*)


Here You GO! With Your FIRST MOD...Put it in Your Scripts Folder And LOO!

Bye! If Any Problems Message Me At : dsweb007@gmail.com

And Say That: gta4mm.blogspot.in Problem (Tutorial)


No comments:

Post a Comment