Author Topic: Auto Aiming Missile 1.6  (Read 16288 times)

0 Members and 1 Guest are viewing this topic.

Offline LORD KILLA

  • Camper
  • ***
  • Posts: 254
  • Happie
Re: Auto Aiming Missile 1.0
« Reply #20 on: December 06, 2008, 05:36:35 am »
thx works fine, /o\

Offline |_ancer

  • Soldier
  • **
  • Posts: 153
  • again and again.
Re: Auto Aiming Missile 1.0
« Reply #21 on: January 06, 2009, 12:18:26 am »
Pwning bots with other scripts owns. Imagine real servers and the amount of power you would have.

Offline Eagle

  • Major
  • *
  • Posts: 59
  • PERSONAL TEXT SUCKS, LIKE SIGNATURES!
Re: Auto Aiming Missile 1.0
« Reply #22 on: January 11, 2009, 07:18:21 pm »
Great script!  Really fun to harass zombies with...
SIGNATURES SUCK!

Offline Shard

  • Camper
  • ***
  • Posts: 449
  • yeet
Re: Auto Aiming Missile 1.0
« Reply #23 on: June 15, 2009, 05:08:52 am »
Sorry for dragging up old topics but whats the command to fire the missile. I've looked and cant find it so dont tell me to go and read the post. Link is broken too...

Offline -Vis-

  • Flagrunner
  • ****
  • Posts: 980
  • Zarch
Re: Auto Aiming Missile 1.0
« Reply #24 on: June 15, 2009, 05:18:01 am »
what is commends in this scripts

Reading helps.

Full Description: In version for admin use the /mss command to launch the missile.

You really SHOULD try reading the posts once in a while, Shard. ::)
« Last Edit: June 15, 2009, 03:17:07 pm by -Vis- »


Offline tk

  • Soldier
  • **
  • Posts: 235
Re: Auto Aiming Missile 1.0
« Reply #25 on: June 15, 2009, 06:21:05 am »
Updated first post
Rewrote the whole function, made it more readable, updated to work with 2.6.5 properly.

It's ready made function for scripters, and there's no version for admin anymore.
If it's really needed I'll write it later.
« Last Edit: June 15, 2009, 06:22:45 am by tk »

Offline Shard

  • Camper
  • ***
  • Posts: 449
  • yeet
Re: Auto Aiming Missile 1.6
« Reply #26 on: June 15, 2009, 07:18:14 am »
I must have just skipped over it lol. The download link wont work for me

Offline ~Niko~

  • Rainbow Warrior
  • *****
  • Posts: 2410
Re: Auto Aiming Missile 1.6
« Reply #27 on: June 15, 2009, 11:12:13 am »
I must have just skipped over it lol. The download link wont work for me
Maybe because THERE ISN'T...

Anyways here you go...

Offline demoniac93

  • Veteran
  • *****
  • Posts: 1554
Re: Auto Aiming Missile 1.0
« Reply #28 on: June 15, 2009, 03:15:23 pm »
Hehe I made something very similar to this once.
What would be awesome would be mod-ing say, the law or something to shoot this kind of thing.

GROM (Missile launcher) anyone?
Love it!
b&

Offline Centurion

  • Flagrunner
  • ****
  • Posts: 699
Re: Auto Aiming Missile 1.6
« Reply #29 on: June 15, 2009, 03:55:40 pm »
Get a server running with that script and I will be living on that server 24/7

Offline Shard

  • Camper
  • ***
  • Posts: 449
  • yeet
Re: Auto Aiming Missile 1.6
« Reply #30 on: June 16, 2009, 06:11:21 am »
sweetness, thanks Niko(once again lol)

Offline scarface09

  • Veteran
  • *****
  • Posts: 1153
  • Arsenal Supporter For Life
Re: Auto Aiming Missile 1.6
« Reply #31 on: June 17, 2009, 08:16:46 am »
Very awesome script mate! Nice work, works great!
Football is the other face of the world. If you don't like it, then you can get the hell out!

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: Auto Aiming Missile 1.6
« Reply #32 on: June 17, 2009, 02:01:14 pm »
Hehe I made something very similar to this once.
What would be awesome would be mod-ing say, the law or something to shoot this kind of thing.

GROM (Missile launcher) anyone?
Love it!
It's scriptable. :) Would require you to change LAW to something that doesn't shoot at all (or shots very slow, non-damaging bullets), so it would be "blank" weapon. Then you should add something like this (pseudocode):
Code: [Select]
[inside apponidle]
  for i := 1 to 32 do if getplayerstat(i, 'active') then
    if (getplayerstat(i, 'primary') = 14) and (getkeypress(i, 'shoot')) // i'm not sure if LAW is #14
    and ((getkeypress(i, 'prone')) or (getkeypress(i, 'crouch'))) // players need to crouch to shoot, delete this line to allow shooting while standing
    then [shoot the missile]
It would need some reload restrictions, like setting the timer to 10 seconds after shooting or checking for LAW's reload.

Offline tk

  • Soldier
  • **
  • Posts: 235
Re: Auto Aiming Missile 1.6
« Reply #33 on: June 17, 2009, 03:06:49 pm »
I did it some time ago with modded law. Set flame as bullet style, low damage (like 5?), and speed 0.

inside OnPlayerDamage()
Code: [Select]
if victim = shooter then
  if GetPlayerStat(shooter,'Primary') = 16 then{ i think law is 16}
    if GetPlayerStat(shooter,'Ammo') = 0 then { player has shot }
      if (getkeypress(shooter, 'prone')) or (getkeypress(shooter, 'crouch') then begin
        target:=NearestTarget(...);
        if target = 0 then exit;
        Missile(shooter, target, GetPlayerStat(shooter,'x'), GetPlayerStat(shooter,'y'));
      // or the second possibility
        ThreadFunc([shooter, target, GetPlayerStat(shooter,'x'), GetPlayerStat(shooter,'y')],'Missile');
      end;

Missile can't be called from AppOnIdle() if it's not threaded. All things like GetTargetXY are refreshed in AppOnIdle() only once per second, coords of target don't change while flight of the missile, so it's not able to make curves.
« Last Edit: June 17, 2009, 03:10:42 pm by tk »

Offline zop

  • Major
  • *
  • Posts: 81
Re: Auto Aiming Missile 1.6
« Reply #34 on: June 20, 2009, 10:27:51 am »
Very thanks.
This script works very beautiful.

http://122.116.167.31:23238:23238/galavela/?inc=player&name=%5BTomato+Bird%5D+Cibo[/size=1]

Offline Silnikos

  • Soldier
  • **
  • Posts: 129
Re: Auto Aiming Missile 1.6
« Reply #35 on: July 19, 2009, 05:51:42 am »
Anyone got working launch command?
I tried with:
Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
if GetPiece(Text,' ',0) = '/aim' then begin
Missile(
ID,
GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'ID'),
GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'X'),
GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'Y'),
);
end;
Result := false;
end;
But I keep on getting syntax errors...

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Auto Aiming Missile 1.6
« Reply #36 on: July 19, 2009, 11:21:20 am »
GetPlayerStat(strtoint(GetPiece(Text,' ',1)), 'ID'),

...


you don't get the player's ID from the player... Just do strtoint(GetPiece(Text,' ',1))

Offline Xariki

  • Major(1)
  • Posts: 5
Re: Auto Aiming Missile 1.6
« Reply #37 on: October 18, 2009, 10:39:12 am »
Hello,

im new to scripting, and Im starting new again (last time was 1 1/2 years ago)
so I kinda forgot everything >.>

I have used this script before (the 1.0 version) and it worked fine, you typed /mss and it shot a flaming missile at your nearest target. In 1.6 I type /mss and absolutely nothing happens. Help please?

(sorry for refreshing an old topic but I really need help on this one)

Offline Centurion

  • Flagrunner
  • ****
  • Posts: 699
Re: Auto Aiming Missile 1.6
« Reply #38 on: October 18, 2009, 12:05:13 pm »
How can I test this script? I mean I don't have a server.

Offline tk

  • Soldier
  • **
  • Posts: 235
Re: Auto Aiming Missile 1.6
« Reply #39 on: October 18, 2009, 02:46:57 pm »
Server is only the way to test it.

Here is a simple launcher for those who would like to shoot missiles by using a command.
It finds the nearest target automatically. (command /aim)
Code: [Select]
function lookForTarget(ID: byte; MinDistance, MaxDistance: integer; UsingRaycast: boolean): byte;
var
   i,Team: byte; X,Y,X2,Y2,sqrdist,maxdist: single;
begin
   GetPlayerXY(ID,X,Y);
   maxdist:=MaxDistance*MaxDistance;
   Result:=0;
   Team := GetPlayerStat(ID, 'Team');
   for i:=1 to 32 do
      if i <> ID then
         if GetPlayerStat(i, 'Active') then
            if GetPlayerStat(i, 'Alive') then
               if GetPlayerStat(i, 'team') <> Team then
               begin
                  GetPlayerXY(i,X2,Y2);
                  if UsingRayCast then
                     if not RayCast(X,Y-7,X2,Y2-7,sqrdist,MaxDistance+1) then continue;
                  X2:=X2-X; Y2:=Y2-Y; sqrdist:=X2*X2+Y2*Y2;
                  if (sqrdist < maxdist) and (sqrdist >= MinDistance) then
                  begin
                     Result:=i;
                     maxdist:=sqrdist;
                  end;
               end;
end;


function OnCommand(ID: Byte; Text: string): boolean;
var x, y: single; target: byte;
begin
  if Text = '/aim' then begin
    target := lookForTarget(ID, 0, 700, true);
    if target > 0 then begin
      GetPlayerXY(ID, x, y);
      Missile(ID, target, x, y);
    end;
  end;
  Result := false;
end;