[Include] [0.3c] Vehicle Missiles
#1

[0.3c] Vehicle Missiles

Info:
This is a pretty simple include that allows you to add two missiles to a vehicle. After I put up a video of this, people seemed to like it and wanted the code so here you go.

Functions:
  • native IsVehicleHot(vehicleid)
  • native AddVehicleMissiles(vehicleid,Floatffsetx,Float ffsetz)
  • native RemoveVehicleMissiles(vehicleid)
Callbacks:
  • VM_OnVehicleFire(vehicleid,slot)
Media:

Offsets: 1.1, -0.2


Offsets: 1, -0.2


Offsets: 1.2, 0.1




[ame]http://www.youtube.com/watch?v=TwDCXVj1_WQ[/ame]

Instructions:
For this include to work, you must add the following to your script.

Top of your script.
pawn Код:
#include <VM>
Under OnPlayerKeyStateChange:
pawn Код:
VM_OnPlayerKeyStateChange(playerid,newkeys);
Somewhere not in a function.
pawn Код:
public VM_OnVehicleFire(vehicleid,slot)
{
    return 1;
}
Download:
Pastebin(Copy and paste into VM.inc)

Notes:

You can change certain things about the include with the defines. Just open VM.inc and edit the following lines.
pawn Код:
#define MISSILE_DETONATE_TIME 500   //milliseconds
#define MISSILE_EXPLODE_TYPE 10
#define MISSILE_EXPLODE_RADIUS 10.0
#define MISSILE_SPEED 40.0
#define MISSILE_FIRE_KEY 1
You may also want to call the RemoveVehicleMissiles function whenever you destroy a vehicle.

Have fun.

UPDATE: There was a bug. Updated as of 9/26/2011. Thanks for pointing that out Pablo Borsellino. Also, here's an example script. http://pastebin.com/AJN5qGUJ
Reply
#2

Pretty nice, I' ll use it.
Reply
#3

pretty advanced and cool. I might use it as well (: good job.
Reply
#4

Hmm maybe cos its late and im so tired but all i get is -

warning 202: number of arguments does not match definition

guess i will try another time when im not so tired
Reply
#5

You have to give an x and z offset when using AddVehicleMissiles.
Reply
#6

I used the one shown in your pic above 1,-0.2
Reply
#7

Nice job.

Using the particle was quite clever too.
Reply
#8

Код:
C:\Users\Unknown\Documents\Server\pawno\include\vehiclemissiles.inc(125) : error 004: function "VM_OnVehicleFire" is not implemented
C:\Users\Unknown\Documents\Server\pawno\include\vehiclemissiles.inc(151) : error 004: function "VM_OnVehicleFire" is not implemented
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#9

Quote:
Originally Posted by Unknown123
Посмотреть сообщение
Код:
C:\Users\Unknown\Documents\Server\pawno\include\vehiclemissiles.inc(125) : error 004: function "VM_OnVehicleFire" is not implemented
C:\Users\Unknown\Documents\Server\pawno\include\vehiclemissiles.inc(151) : error 004: function "VM_OnVehicleFire" is not implemented
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Add the public somewhere into your gamemode/filterscript whatever.


Good job backwardsman! I saw this on the videos secshun, loved it
Reply
#10

That's awesome, I'm gonna give this a test.
Reply
#11

Haha, Looks cool.
Reply
#12

Thats fucking cool!!
Reply
#13

Whoah NICEEEE!!
Reply
#14

I like the tuning sound!
Reply
#15

There actually was an error in the include. I've fixed it and updated it now.
Reply
#16

That looks quite good! I'll try it out later.
Reply
#17

What is the command?Because I do not work!How will the car of the weapon?Please write more about the use of.
Reply
#18

Thats a proper riot that m8, great fun.

Peace...
Reply
#19

I've got 2 errors within the include
Код:
C:\Users\Owen\Desktop\samp03\pawno\include\vm.inc(57) : error 001: expected token: ",", but found "]"
C:\Users\Owen\Desktop\samp03\pawno\include\vm.inc(57) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Any Help?
Reply
#20

Awesome!!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)