Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

kamikazee mod help


milkjunk87
 Share

Recommended Posts

Hey guys its me again. I can't seem to get my kamikaze mod code to work. First the engine won't turn on if i use Task.ClearAllImmediately(); Also if i spawn a plane far away it just spirals out of control or hydras and helis just float in air and dont perform tasks. Can someone tell me how to get peds to perform tasks immediately without having to trigger it by shooting them, dropping them from a height etc. Also Peds pull up instead of kamikazing straight into me or they avoid buildings and just fly away without continuing with task i have used set ped keep task already and have tried calling the Task Plane Mission in OnTick but it didn't work?

 

Ped childsplaynew2 = Game.Player.Character;

GTA.Math.Vector3 kamekazmespawn2=(childsplaynew2.Position + new Vector3(15f,-300f,275f));

Vehicle Titan2 = World.CreateVehicle(VehicleHash.Titan,kamekazmespawn2); //spawned above player
Ped pilotitan2 = GTA.Native.Function.Call<Ped>(Hash.CREATE_RANDOM_PED_AS_DRIVER, Titan2, true);
GTA.Native.Function.Call(Hash.SET_VEHICLE_ENGINE_ON, Titan2, true, true); //xxx if wrong bitch
pilotitan2.Task.ClearAllImmediately(); //tried made pilot sleep crash
GTA.Native.Function.Call(Hash.TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS, pilotitan2, true);
//GTA.Native.Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, pilotitan2, true, true);
Function.Call(Hash.TASK_PLANE_MISSION, pilotitan2, Titan2, 0, 0, childsplaynew2.Position.X, childsplaynew2.Position.Y, childsplaynew2.Position.Z, 4, 100f, 0f, 90f, 0, -5000f);// kamikaze
Titan2.Speed = 30f;
GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilotitan2);

Edited by milkjunk87
Link to comment
Share on other sites

I don't know what problems your facing, but my code works well:

if(e.KeyCode == Keys.B)            {                Vehicle plane = World.CreateVehicle(VehicleHash.Cuban800, Game.Player.Character.GetOffsetInWorldCoords(new Vector3(0, 5, 0)), Game.Player.Character.Heading - 90);                plane.PrimaryColor = VehicleColor.MatteWhite;                plane.SecondaryColor = VehicleColor.MatteRed;                if (plane == null) return;                Ped pilot = plane.CreateRandomPedOnSeat(VehicleSeat.Driver);                Game.Player.Character.Task.WarpIntoVehicle(plane, VehicleSeat.Passenger);                Wait(2000);                Vector3 vect = new Vector3(200, 200, 200);                Function.Call(Hash.TASK_PLANE_MISSION, pilot, plane, 0, 0, vect.X, vect.Y, vect.Z, 4, 100f, 0f, 90f, 0, 200f);            }

Try it and report if it works. Edit vect to your vector 3 destination. And also wait a few seconds as he doesn't take off right away.

Edited by AHK1221
Link to comment
Share on other sites

well J makes him skydive, H to drop trucks and tanks on targeted entity, N i wanted to make planes fly into you and you have to run away, T is skydiving Tanks, K is angry stripper war

 

using GTA;
using GTA.Native;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using GTA.Math;

public class ScriptTutorial : Script
{
bool toggle = new bool(); //this is to turn my mod on and off
List<Vehicle> trucks=new List<Vehicle>(); //To make a list of the number of vehicles dropped
List<Ped> babyds=new List<Ped>();
List<Ped> myangrydogs = new List<Ped>();
List<Ped> suicidepilots = new List<Ped>();
List <Vehicle> suicidevehicles= new List<Vehicle>();
//RelationshipGroup Indicies
int relgrpA = 0;
int relgrpB = 0;
Ped isisisbest = Game.Player.Character;



//List<Ped> pilotss = new List<Ped>();
//int pilot4exist= new int(0);
//pilot4exist=0;

public ScriptTutorial()
{
Tick += OnTick;
KeyDown += OnKeyDown;
KeyUp += OnKeyUp;
Interval = 25;

//Defining Relationships
//originals
//relgrpA = World.AddRelationshipGroup("A");
//relgrpB = World.AddRelationshipGroup("B");

relgrpA = World.AddRelationshipGroup("A");
relgrpB = World.AddRelationshipGroup("B");
//relgrpB = World.AddRelationshipGroup("cop");
//relgrpB = World.AddRelationshipGroup("army");
relgrpB = World.AddRelationshipGroup("player");

//who hates and likes who
//originales
//World.SetRelationshipBetweenGroups(Relationship.Hate, relgrpA, relgrpB);
//World.SetRelationshipBetweenGroups(Relationship.Respect, relgrpA, relgrpA);
//World.SetRelationshipBetweenGroups(Relationship.Respect, relgrpB, relgrpB);
World.SetRelationshipBetweenGroups(Relationship.Hate, relgrpA, relgrpB);
World.SetRelationshipBetweenGroups(Relationship.Hate, relgrpB, relgrpA);
World.SetRelationshipBetweenGroups(Relationship.Companion, relgrpA, relgrpA);
World.SetRelationshipBetweenGroups(Relationship.Companion, relgrpB, relgrpB);

//Put Player in Team B
Game.Player.Character.RelationshipGroup = relgrpB;
//managedPedsTeamA.Add(Game.Player.Character);
Ped childsplayplay = Game.Player.Character;
}



void OnTick(object sender, EventArgs e)
{

Ped f*ckinposition = Game.Player.Character;

/* if(pilotss.Count>0)
{
for(int pilotsindex=0; pilotsindex < pilotss.Count; pilotsindex++)
{
Entity planepoint2 = Game.Player.GetTargetedEntity();
GTA.Native.Function.Call(Hash.ADD_VEHICLE_SUBTASK_ATTACK_PED, pilotss[pilotsindex], planepoint2);
GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilotss[pilotsindex]);
}
} */
Player player = Game.Player;

if (player.IsDead)
{
for (int yindex = 0; yindex < babyds.Count; yindex++)
{
//babyds.RemoveAt(yindex);
babyds[yindex].Kill();
babyds[yindex].Delete();
//GTA.Native.Function.Call(Hash.DELETE_PED, babyds[yindex]);
}

for (int yindex2 = 0; yindex2 < myangrydogs.Count; yindex2++)
{
myangrydogs[yindex2].Kill();
myangrydogs[yindex2].Delete();
//pilot4exist=0;
//GTA.Native.Function.Call(Hash.DELETE_PED, myangrydogs[yindex2]);
}
}

/* for(int suicidepilotsindex=0; suicidepilotsindex < suicidepilots.Count; suicidepilotsindex++)
{
//suicidepilots[suicidepilotsindex].Task.ClearAllImmediately();
//Function.Call(Hash.TASK_PLANE_MISSION, pilot2, Lazer, 0, 0, f*ckinposition.Position.X, f*ckinposition.Position.Y, f*ckinposition.Position.Z, 4, 100f, 0f, 90f, 0, -5000f);
Function.Call(Hash.TASK_PLANE_MISSION, suicidepilots[suicidepilotsindex], suicidevehicles[suicidepilotsindex], 0, 0, f*ckinposition.Position.X, f*ckinposition.Position.Y, f*ckinposition.Position.Z, 4, 100f, 0f, 90f, 0, -5000f);// kamikaze
} */

}



void OnKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.H)
{
Entity droppoint = Game.Player.GetTargetedEntity(); //create an entity with the position to drop car


GTA.Math.Vector3 spawnlocation = droppoint.Position + (Vector3.RelativeTop * 50); //create a spawn location well above target
GTA.Math.Vector3 spawnlocation2 = droppoint.Position + (Vector3.RelativeTop * 32); // create a spawn location a lil above target
Vehicle biff = World.CreateVehicle(VehicleHash.Biff, spawnlocation); //spawn truck above target
//droppoint.ApplyForce(new GTA.Math.Vector3(0f,0f,10f), new GTA.Math.Vector3(0f,0f,0f)); // x y z force vector1, xangle yangle zangle vector2

trucks.Add(biff); //add to list
string model_name2 = "u_m_y_babyd"; //create string of baby d
Ped companion2 = GTA.World.CreatePed(model_name2, spawnlocation2); //spawn babyd above target
babyds.Add(companion2);
}

if (e.KeyCode == Keys.K)
{
string angrystrippers = "mp_f_stripperlite";
Ped childsplay2 = Game.Player.Character;
GTA.Math.Vector3 stripperdrop = childsplay2.Position;
Ped stripperenemy = GTA.World.CreatePed(angrystrippers, stripperdrop+ new Vector3(0f,-7f,0f));
stripperenemy.RelationshipGroup = relgrpA;
stripperenemy.Weapons.Give(GTA.Native.WeaponHash.RPG, -1, true, true);
//Entity gunisbest = GTA.Native.Function.Call<Entity>(Hash.GET_CURRENT_PED_WEAPON_ENTITY_INDEX, stripperenemy);
//stripperenemy.Weapons.Give(GTA.Native.WeaponHash.SMG, 30, true, true);
//stripperenemy.ApplyForce(childsplay2.Position, new GTA.Math.Vector3(0f,0f,2f));
myangrydogs.Add(stripperenemy);
//int strippergroup = GTA.Native.Function.Call<int>(Hash.GET_PED_GROUP_INDEX, myangrydogs[0]);
//GTA.Native.Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, stripperenemy, strippergroup);
//GTA.Native.Function.Call(Hash.SET_PED_AS_ENEMY, stripperenemy, true);
//stripperenemy.Task.ClearAllImmediately();
//GTA.Native.Function.Call(Hash.SET_PED_ALERTNESS, stripperenemy, 55)

/* string angrystrippers2 = "csb_stripper_01";
//Ped childsplay2 = Game.Player.Character;
//GTA.Math.Vector3 stripperdrop = childsplay2.Position;
Ped stripperenemy2 = GTA.World.CreatePed(angrystrippers2, stripperdrop + new Vector3(0f,7f,0f));
stripperenemy2.RelationshipGroup = relgrpB;
stripperenemy2.Weapons.Give(GTA.Native.WeaponHash.AssaultRifle, -1, true, true);
stripperenemy2.Weapons.Give(GTA.Native.WeaponHash.Bat, 0, true, true);
myangrydogs.Add(stripperenemy2);
//int strippergroup = GTA.Native.Function.Call<int>(Hash.GET_PED_GROUP_INDEX, myangrydogs[0]);
// GTA.Native.Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, stripperenemy, strippergroup);



float radius=50F;
int mer=46;
GTA.Native.Function.Call(Hash.SET_PED_COMBAT_ATTRIBUTES, stripperenemy, mer, true);
GTA.Native.Function.Call(Hash.SET_PED_COMBAT_ATTRIBUTES, stripperenemy2, mer, true); */
/* GTA.Native.Function.Call(Hash.SET_PED_ALERTNESS, stripperenemy, 100);
GTA.Native.Function.Call(Hash.SET_PED_COMBAT_RANGE, stripperenemy, 2);
//GTA.Native.Function.Call(Hash.TASK_COMBAT_HATED_TARGETS_AROUND_PED, stripperenemy, radius, mer);
GTA.Native.Function.Call(Hash.SET_PED_AS_ENEMY, stripperenemy, true);
//GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, stripperenemy);
GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, stripperenemy); */

Vehicle Lazerk = World.CreateVehicle(VehicleHash.Lazer, childsplay2.Position + new Vector3(6f,6f,50f));
Lazerk.Speed = 43f;
trucks.Add(Lazerk);
Ped pilot2k = GTA.Native.Function.Call<Ped>(Hash.CREATE_RANDOM_PED_AS_DRIVER, Lazerk, true);
//GTA.Native.Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, pilot2, true, true);

Entity shootmebuzz = Game.Player.GetTargetedEntity();
pilot2k.RelationshipGroup = relgrpB;
//Lazerk.ApplyForce(new GTA.Math.Vector3(0f,0f,7f), new GTA.Math.Vector3(0f,0f,60f));

Vehicle Buzzardk = World.CreateVehicle(VehicleHash.Buzzard, stripperdrop + new Vector3(6f,3f,10f));
GTA.Native.Function.Call(Hash.SET_HELI_BLADES_FULL_SPEED, Buzzardk);
trucks.Add(Buzzardk);
Ped pilot4k = GTA.Native.Function.Call<Ped>(Hash.CREATE_RANDOM_PED_AS_DRIVER, Buzzardk, true);
//GTA.Native.Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, pilot4, true, true);
pilot4k.RelationshipGroup = relgrpB;
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_HELI_PROTECT,pilot4k,Buzzardk,childsplay2,30f, 5, 5000f, 30, 0);
GTA.Native.Function.Call(Hash.ADD_VEHICLE_SUBTASK_ATTACK_PED,pilot4k,stripperenemy);
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_SHOOT_AT_PED,pilot4k,stripperenemy,200f);
//Buzzard.ApplyForce(Buzzard.Position, 0f, 0f, 27f);
//Buzzardk.ApplyForce(Buzzardk.Position, new GTA.Math.Vector3(0f,10f,0f));

/* Vehicle Buzzardk2 = World.CreateVehicle(VehicleHash.Buzzard, stripperdrop + new Vector3(-6f,-3f,10f));
GTA.Native.Function.Call(Hash.SET_HELI_BLADES_FULL_SPEED, Buzzardk2);
trucks.Add(Buzzardk2);
Ped pilot4k2 = GTA.Native.Function.Call<Ped>(Hash.CREATE_RANDOM_PED_AS_DRIVER, Buzzardk2, true);
//GTA.Native.Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, pilot4, true, true);
pilot4k2.RelationshipGroup = relgrpA; */

//Buzzard.ApplyForce(Buzzard.Position, 0f, 0f, 27f);
//Buzzardk.ApplyForce(Buzzardk.Position, new GTA.Math.Vector3(0f,10f,0f));
//GTA.Native.Function.Call(Hash.SET_VEHICLE_SHOOT_AT_TARGET, pilot4k, Buzzardk2);
GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilot4k);
//GTA.Native.Function.Call(Hash.SET_VEHICLE_SHOOT_AT_TARGET, pilot4k2, childsplay2);
//GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilot4k2);
//GTA.Native.Function.Call(Hash.SET_VEHICLE_SHOOT_AT_TARGET, pilot2k, pilot4k2);
GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilot2k);

}

}

void OnKeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.H)
{
toggle = !toggle;
Ped childsplay = Game.Player.Character;
GTA.Math.Vector3 spawnLoc = childsplay.Position + (Vector3.RelativeTop * 33);
string model_name = "a_c_shepherd";
string model_name2 = "u_m_y_babyd";
if (toggle == false)
{
Ped companion = GTA.World.CreatePed(model_name, spawnLoc);
myangrydogs.Add(companion);
}

if (toggle == true)
{
Ped companion2 = GTA.World.CreatePed(model_name2, spawnLoc);
babyds.Add(companion2);
}

}

if (toggle == true)
{
Ped childsplay = Game.Player.Character;
Entity droppoint = Game.Player.GetTargetedEntity();
GTA.Math.Vector3 driveloc = childsplay.Position;
GTA.Math.Vector3 spawnlocation = droppoint.Position + (Vector3.RelativeTop * 27);
Vehicle tankman = World.CreateVehicle(VehicleHash.Rhino, spawnlocation);
//GTA.Tasks.DriveTo(biff, droppoint.Position, 10F, 33F);
//Ped driver = GTA.Native.Function.Call<Ped>(Hash.CREATE_PED_INSIDE_VEHICLE, tankman,int 4, Hash modelHash,int -1, false, false);
Ped driver = GTA.Native.Function.Call<Ped>(Hash.CREATE_RANDOM_PED_AS_DRIVER, tankman, true);
driver.RelationshipGroup=relgrpA;
//Ped driver = GTA.Native.Function.Call<Ped>(Hash.GET_PED_IN_VEHICLE_SEAT, tankman, -1);
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE, driver, tankman, driveloc.X, driveloc.Y, driveloc.Z, 16777216, 10f);
trucks.Add(tankman);
myangrydogs.Add(driver);
}

if (e.KeyCode == Keys.J)

{
//pilot4exist=0;
for(int deadbaby = 0;deadbaby < babyds.Count; deadbaby++)
{
babyds[deadbaby].Delete();
}

for(int deaddog = 0;deaddog < myangrydogs.Count; deaddog++)
{
myangrydogs[deaddog].Kill();
myangrydogs[deaddog].Delete();
}

for (int myindex = 0; myindex < trucks.Count; myindex++)
{
trucks[myindex].Explode();
trucks[myindex].Delete();
}

/* for (int myindex2 = 0; myindex2 < babyds.Count; myindex2++)
{
babyds.RemoveAt(myindex2);
} */
GTA.Native.Function.Call(Hash.WAIT, 20000);
Ped childsplay = Game.Player.Character;
GTA.Math.Vector3 vehicleskyspawn = childsplay.Position + (Vector3.RelativeTop*1000);
childsplay.Position = childsplay.Position + Vector3.RelativeTop*1000;
for (int myindex3 = 1; myindex3 < 13; myindex3++)
{
Random myrandom = new Random();
int randbottom = myrandom.Next(5, 33);
int randright = myrandom.Next(-10, 5);
int randfront = myrandom.Next(-7, 5);
GTA.Math.Vector3 skydivepoint = vehicleskyspawn + Vector3.RelativeBottom*randbottom;
skydivepoint = skydivepoint + Vector3.RelativeFront*randfront;
skydivepoint = skydivepoint + Vector3.RelativeRight*randright;
Vehicle biff = World.CreateVehicle(VehicleHash.Biff, skydivepoint);
trucks.Add(biff);
}
string model_name2 = "u_m_y_babyd"; //create string of baby d

for (int myindex4 = 1; myindex4 < 15; myindex4++)
{
//Random myrandom = new Random();
//int randbottom = myrandom.Next(5, 33);
//int randright = myrandom.Next(-5, 5);
//int randfront = myrandom.Next(-5, 5);
//GTA.Math.Vector3 skydivepoint = vehicleskyspawn + Vector3.RelativeBottom * randbottom;
//skydivepoint = skydivepoint + Vector3.RelativeFront * randfront;
//skydivepoint = skydivepoint + Vector3.RelativeRight * randright;
Ped companion2 = GTA.World.CreatePed(model_name2, vehicleskyspawn + Vector3.RelativeBottom*20);
babyds.Add(companion2);
}

//GTA.Native.Function.Call(Hash.WAIT, 500);
//childsplay.Position = vehicleskyspawn;
GTA.Native.Function.Call(Hash.WAIT, 15000);
}

if (e.KeyCode == Keys.K)
{
string angrydogs = "a_c_shepherd";
string hornycougar = "a_c_mtlion";
Ped childsplay2 = Game.Player.Character;
GTA.Math.Vector3 dogdrop = childsplay2.Position + (Vector3.RelativeFront*10);
for (int myindex5 = 0; myindex5 < 1; myindex5++)
{
Ped enemy = GTA.World.CreatePed(angrydogs, dogdrop);
myangrydogs.Add(enemy);
//enemy.Task.ClearAllImmediately();
GTA.Native.Function.Call(Hash.SET_PED_AS_ENEMY, enemy, true);
Ped enemy2 = GTA.World.CreatePed(hornycougar, dogdrop);
//Ped enemy2 = GTA.Native.Function.Call<Ped>(Hash.CREATE_PED, 28,New Model(PedHash.MountainLion),Vector3.X,Vector3.Y,Vector3.Z,0.0f,false true);
myangrydogs.Add(enemy2);
enemy2.Task.ClearAllImmediately();
float radius = 50F;
int mer = 46;
GTA.Native.Function.Call(Hash.SET_PED_COMBAT_ATTRIBUTES, enemy2, mer, true);
GTA.Native.Function.Call(Hash.SET_PED_ALERTNESS, enemy2, 100);
GTA.Native.Function.Call(Hash.SET_PED_COMBAT_RANGE, enemy2, 2);
GTA.Native.Function.Call(Hash.SET_PED_AS_ENEMY, enemy2, true);
GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, enemy2);

}
}
if (e.KeyCode == Keys.T)
{
Ped childsplay = Game.Player.Character;
GTA.Math.Vector3 tankspawnlocation = childsplay.Position + (Vector3.RelativeTop * 1000);
Vehicle tankman = World.CreateVehicle(VehicleHash.Rhino, tankspawnlocation);
GTA.Native.Function.Call(Hash.SET_PED_INTO_VEHICLE, childsplay, tankman, -1);
trucks.Add(tankman);
for (int myindexs = 0; myindexs < 3; myindexs++)
{

Random myrandom2 = new Random();
int randbottom2 = myrandom2.Next(-15, 23);
int randright2 = myrandom2.Next(-20, 15);
int randfront2 = myrandom2.Next(-17, 10);
GTA.Math.Vector3 tankskydivepoint = tankspawnlocation + Vector3.RelativeBottom * randbottom2;
tankskydivepoint = tankskydivepoint + Vector3.RelativeFront * randfront2;
tankskydivepoint = tankskydivepoint + Vector3.RelativeRight * randright2;
Vehicle tankman2 = World.CreateVehicle(VehicleHash.Rhino, tankskydivepoint);
Ped driver = GTA.Native.Function.Call<Ped>(Hash.CREATE_RANDOM_PED_AS_DRIVER, tankman2, true);
trucks.Add(tankman2);
myangrydogs.Add(driver);
}
}
if (e.KeyCode == Keys.N)
{

Ped childsplaynew2 = Game.Player.Character;
GTA.Math.Vector3 kamekazmespawn2=(childsplaynew2.Position + new Vector3(15f,-300f,275f));
Entity planepoint = Game.Player.GetTargetedEntity(); //create an entity with the position to drop car

bool isentityped = GTA.Native.Function.Call<bool>(Hash.IS_ENTITY_A_PED, planepoint);
if(isentityped==true)
{
//Ped myenemyped = planepoint;
//myenemyped.RelationshipGroup = relgrpA;
}
GTA.Math.Vector3 finaldestination=planepoint.Position;
GTA.Math.Vector3 startplanespawnloc = planepoint.Position + (Vector3.RelativeTop * 250); //create a spawn location well above targeted entity
Random myrandomplane = new Random();
int randbottom3 = myrandomplane.Next(-10, 8);
int randright3 = myrandomplane.Next(-30, 20);
int randfront3 = myrandomplane.Next(-40, 35);
GTA.Math.Vector3 planespawnloc = startplanespawnloc + Vector3.RelativeBottom*randbottom3;
planespawnloc = planespawnloc + Vector3.RelativeFront*randfront3;
planespawnloc = planespawnloc + Vector3.RelativeRight*randright3;
Vehicle Titan = World.CreateVehicle(VehicleHash.Titan, planespawnloc, Game.Player.Character.Heading - 180); //spawned above targeted entity
planespawnloc = planespawnloc+ Vector3.RelativeRight*55;
Vehicle Titan2 = World.CreateVehicle(VehicleHash.Titan, kamekazmespawn2); //spawned above player

trucks.Add(Titan);
trucks.Add(Titan2);
Ped pilot = GTA.Native.Function.Call<Ped>(Hash.CREATE_RANDOM_PED_AS_DRIVER, Titan, true);
//pilot.Task.ClearAllImmediately(); //tried made pilot sleep crash
GTA.Native.Function.Call(Hash.TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS, pilot, true);
Function.Call(Hash.TASK_PLANE_MISSION, pilot, Titan, 0, 0, childsplaynew2.Position.X, childsplaynew2.Position.Y, childsplaynew2.Position.Z, 4, 100f, 0f, 90f, 0, -5000f);// kamikaze
Ped pilotitan2 = GTA.Native.Function.Call<Ped>(Hash.CREATE_RANDOM_PED_AS_DRIVER, Titan2, true);
GTA.Native.Function.Call(Hash.SET_VEHICLE_ENGINE_ON, Titan2, true, true); //xxx if wrong bitch
pilotitan2.Task.ClearAllImmediately(); //tried made pilot sleep crash
GTA.Native.Function.Call(Hash.TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS, pilotitan2, true);
//GTA.Native.Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, pilotitan2, true, true);
Function.Call(Hash.TASK_PLANE_MISSION, pilotitan2, Titan2, 0, 0, childsplaynew2.Position.X, childsplaynew2.Position.Y, childsplaynew2.Position.Z, 4, 100f, 0f, 90f, 0, -5000f);// kamikaze
Titan.Speed=30f;
Titan2.Speed = 30f;
GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilotitan2);
GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilot);
//suicidepilots.Add(pilotitan2);
suicidepilots.Add(pilot);
suicidevehicles.Add(Titan);
//GTA.Native.Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, pilot, true, true);
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE, pilot, Titan, finaldestination.X, finaldestination.Y, finaldestination.Z, 16777216, 0f);
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE, pilot, Titan, finaldestination.X, finaldestination.Y, finaldestination.Z, 786603, 0f);
myangrydogs.Add(pilot);


Random myrandomplane2 = new Random();
int randbottom4 = myrandomplane2.Next(10, 15);
int randright4 = myrandomplane2.Next(-60, -40);
int randfront4 = myrandomplane2.Next(-50, 35);
GTA.Math.Vector3 planespawnloc2 = startplanespawnloc + Vector3.RelativeBottom*randbottom4;
planespawnloc2 = planespawnloc2 + Vector3.RelativeFront*randfront4;
planespawnloc2 = planespawnloc2 + Vector3.RelativeRight*randright4;
planespawnloc2=planespawnloc2 + Vector3.RelativeBottom*100;
GTA.Math.Vector3 kamekazmespawn=(childsplaynew2.Position + new Vector3(55f,55f,400f));
Vehicle Lazer = World.CreateVehicle(VehicleHash.Lazer, planespawnloc2, Game.Player.Character.Heading - 180);
//Lazer.ApplyForce(new Vector3(0f,0f,0f), new GTA.Math.Vector3((float)(Math.Atan2(Plane.Position.X, Game.Player.Character.Position.X) * 180.0 / Math.PI), (float)(Math.Atan2(Plane.Position.Y, Game.Player.Character.Position.Y) * 180.0 / Math.PI), (float)(Math.Atan2(Plane.Position.Z, Game.Player.Character.Position.Z) * 180.0 / Math.PI)));

Lazer.Speed = 30f;
trucks.Add(Lazer);
suicidevehicles.Add(Lazer);
//int playergroup2 = GTA.Native.Function.Call<int>(Hash.GET_PED_GROUP_INDEX, childsplaynew2);
Ped pilot2 = GTA.Native.Function.Call<Ped>(Hash.CREATE_RANDOM_PED_AS_DRIVER, Lazer, true);
GTA.Native.Function.Call(Hash.SET_VEHICLE_ENGINE_ON, Lazer, true, true); //xxx if wrong bitch
pilot2.Task.ClearAllImmediately(); //tried made pilot sleep crash
GTA.Native.Function.Call(Hash.TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS, pilot2, true);
//GTA.Native.Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, pilot2, true, true);
pilot2.RelationshipGroup = relgrpB;
Function.Call(Hash.TASK_PLANE_MISSION, pilot2, Lazer, 0, 0, childsplaynew2.Position.X, childsplaynew2.Position.Y, childsplaynew2.Position.Z, 4, 100f, 0f, 90f, 0, -5000f);
//Lazer.ApplyForce(Lazer.Position, new GTA.Math.Vector3(-10f,0f,0f));
//GTA.Native.Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, pilot2, playergroup2);
//GTA.Native.Function.Call(Hash.TASK_COMBAT_HATED_TARGETS_IN_AREA, pilot2, 50000, 0);
GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilot2);
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE, pilot, Lazer, finaldestination.X, finaldestination.Y, finaldestination.Z, 16777216, 0f);
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE, pilot, Titan, finaldestination.X, finaldestination.Y, finaldestination.Z, 786603, 0f);
myangrydogs.Add(pilot2);
suicidepilots.Add(pilot2);


Random myrandomplane3 = new Random();
int randbottom5 = myrandomplane3.Next(17,17);
int randright5 = myrandomplane3.Next(25,25);
int randfront5 = myrandomplane3.Next(40,40);
GTA.Math.Vector3 planespawnloc3 = startplanespawnloc + Vector3.RelativeBottom*randbottom5;
planespawnloc3 = planespawnloc3 + Vector3.RelativeFront*randfront5;
planespawnloc3 = planespawnloc3 + Vector3.RelativeRight*randright5;
Vehicle Hydra = World.CreateVehicle(VehicleHash.Hydra, planespawnloc3, Game.Player.Character.Heading - 180);
Hydra.Speed=59f;
trucks.Add(Hydra);
Ped childsplaynew3 = Game.Player.Character;
int playergroup3 = GTA.Native.Function.Call<int>(Hash.GET_PED_GROUP_INDEX, childsplaynew3);
Ped pilot3 = GTA.Native.Function.Call<Ped>(Hash.CREATE_RANDOM_PED_AS_DRIVER, Hydra, true);
//GTA.Native.Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, pilot3, true, true);
pilot3.RelationshipGroup = relgrpA;
GTA.Native.Function.Call(Hash.TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS, pilot3, true);
Function.Call(Hash.TASK_PLANE_MISSION, pilot3, Hydra, 0, 0, childsplaynew2.Position.X, childsplaynew2.Position.Y, childsplaynew2.Position.Z, 4, 100f, 0f, 90f, 0, -5000f);
GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilot3);

//Hydra.ApplyForce(planepoint.Position, new GTA.Math.Vector3(0,0f,-10f));
//ped.Weapons.Give(GTA.Native.WeaponHash.AssaultRifle, 30, true, true);
//ped.Weapons.Give(GTA.Native.WeaponHash.Bat, 0, true, true);
//GTA.Native.Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, pilot3, playergroup3);
//GTA.Native.Function.Call(Hash.TASK_COMBAT_HATED_TARGETS_IN_AREA, pilot3, 50000, 0);
//GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilot3);
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE, pilot, Titan, finaldestination.X, finaldestination.Y, finaldestination.Z, 16777216, 0f);
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE, pilot, Titan, finaldestination.X, finaldestination.Y, finaldestination.Z, 786603, 0f);
myangrydogs.Add(pilot3);


Random myrandomplane4 = new Random();
int randbottom6 = myrandomplane4.Next(-10, 8);
int randright6 = myrandomplane4.Next(-40, 20);
int randfront6 = myrandomplane4.Next(-50, 35);
GTA.Math.Vector3 planespawnloc4 = startplanespawnloc + Vector3.RelativeBottom*200;
planespawnloc = planespawnloc4 + Vector3.RelativeFront*randfront6;
planespawnloc = planespawnloc4 + Vector3.RelativeRight*randright6;
Vehicle Buzzard = World.CreateVehicle(VehicleHash.Buzzard, planespawnloc4);
GTA.Native.Function.Call(Hash.SET_HELI_BLADES_FULL_SPEED, Buzzard);
trucks.Add(Buzzard);
Ped pilot4 = GTA.Native.Function.Call<Ped>(Hash.CREATE_RANDOM_PED_AS_DRIVER, Buzzard, true);
//GTA.Native.Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, pilot4, true, true);
pilot4.RelationshipGroup = relgrpB;
//Buzzard.ApplyForce(Buzzard.Position, 0f, 0f, 27f);
Buzzard.ApplyForce(Buzzard.Position, new GTA.Math.Vector3(0f,10f,0f));
//pilot4exist=1;
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_CHASE, pilot4, planepoint);
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE, pilot, Titan, finaldestination.X, finaldestination.Y, finaldestination.Z, 16777216, 0f);
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE, pilot, Titan, finaldestination.X, finaldestination.Y, finaldestination.Z, 786603, 0f);
myangrydogs.Add(pilot4);
//pilotss.Add(pilot4);
Ped childsplaynew = Game.Player.Character;
//int playergroup = GTA.Native.Function.Call<int>(Hash.GET_PED_GROUP_INDEX, childsplaynew);
//pilot4.Task.ClearAllImmediately();
//GTA.Native.Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, pilot4, playergroup);
//GTA.Native.Function.Call(Hash.TASK_COMBAT_HATED_TARGETS_IN_AREA, pilot4, 50000, 0);
//GTA.Native.Function.Call(Hash.TASK_VEHICLE_SHOOT_AT_PED, pilot4, planepoint, 100f);
//GTA.Native.Function.Call(Hash.ADD_VEHICLE_SUBTASK_ATTACK_PED, pilot4, planepoint);
//GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilot4);
}
}

}

Edited by milkjunk87
Link to comment
Share on other sites

Make another project for testing purposes and do something like this to see if game mechanics work: (Note: The last parameter for the native is -5000f cause that will make him fly directly into target):

if(e.KeyCode == Keys.X){    Ped player = Game.Player.Character;       Vector3 thatOneSpawnPos = player.Position.Around(15f) + player.UpVector * 30f;    Vehicle suicedalPlane = World.CreateVehicle(VehicleHash.Titan, thatOneSpawnPos);    Ped pilot = suicedalPlane.CreateRandomPedOnSeat(VehicleSeat.Driver);    Function.Call(Hash.TASK_PLANE_MISSION, Driver, closestVehicle, 0, 0, player.X, player.Y, player.Z, 4, 100f, 0f, 90f, 0, -5000f);}
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...
if (item == angryLazer)                {                    Ped player = Game.Player.Character;                    Vector3 planeSpawnPos = (player.Position + new Vector3(15f, -300f, 275f));                    Vehicle crazyLazer = World.CreateVehicle(VehicleHash.Lazer, planeSpawnPos);                    Ped lazerPilot = crazyLazer.CreateRandomPedOnSeat(VehicleSeat.Driver);                    Vector3 pos = Game.Player.Character.Position;                    Function.Call(Hash.TASK_PLANE_MISSION, lazerPilot, crazyLazer, 0, player, pos.X , pos.Y, pos.Z, 4, 100f, 0f, 90f, 0, -5000f);                }

How did you end up getting this to work? My current code simply spawns them and they fall, they don't even fly!

Edited by Pentine
Link to comment
Share on other sites

  • 2 weeks later...
if (item == angryLazer)                {                    Ped player = Game.Player.Character;                    Vector3 planeSpawnPos = (player.Position + new Vector3(15f, -300f, 275f));                    Vehicle crazyLazer = World.CreateVehicle(VehicleHash.Lazer, planeSpawnPos);                    Ped lazerPilot = crazyLazer.CreateRandomPedOnSeat(VehicleSeat.Driver);                    Vector3 pos = Game.Player.Character.Position;                    Function.Call(Hash.TASK_PLANE_MISSION, lazerPilot, crazyLazer, 0, player, pos.X , pos.Y, pos.Z, 4, 100f, 0f, 90f, 0, -5000f);                }

How did you end up getting this to work? My current code simply spawns them and they fall, they don't even fly!

 

i put some code in the ontick function:

 for (int suicidepilotsindex = 0; suicidepilotsindex < suicidepilotslazer.Count; suicidepilotsindex++)        {            Function.Call(Hash.TASK_PLANE_MISSION, suicidepilotslazer[suicidepilotsindex], suicidevehicleslazer[suicidepilotsindex], 0, 0, f*ckinposition.Position.X, f*ckinposition.Position.Y, f*ckinposition.Position.Z, 4, 300f, 0f, 90f, -10f, -5000f);// kamikaze        }

i also used the following :

 GTA.Native.Function.Call(Hash.TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS, pilotmeow, true);            Function.Call(Hash.TASK_PLANE_MISSION, pilotmeow, Lazermeow, 0, 0, Game.Player.Character.Position.X, Game.Player.Character.Position.Y, Game.Player.Character.Position.Z, 4, 300f, 0f, 90f, -10f, -5000f);            GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_KEEP_TASK, pilotmeow);

you can look at my code here:

https://www.gta5-mods.com/scripts/kamikaze-mod

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.