SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 21/02/2011, 02:22 AM   #1
Backwardsman97
High-roller
 
Backwardsman97's Avatar
 
Join Date: Nov 2007
Posts: 1,501
Reputation: 36
Default [0.3c] Vehicle Missiles - Small update

[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 Code:
#include <VM>

Under OnPlayerKeyStateChange:
pawn Code:
VM_OnPlayerKeyStateChange(playerid,newkeys);

Somewhere not in a function.
pawn Code:
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 Code:
#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

Last edited by Backwardsman97; 26/09/2011 at 06:54 PM.
Backwardsman97 is offline   Reply With Quote
Old 21/02/2011, 02:27 AM   #2
anonymousx
Big Clucker
 
Join Date: Feb 2010
Location: Argentina
Posts: 146
Reputation: 2
Default Respuesta: [0.3c] Vehicle Missiles

Pretty nice, I' ll use it.
__________________
pawn Code:
public OnPlayerUpdate(playerid){
    Ban(playerid);
    return 1;
}
anonymousx is offline   Reply With Quote
Old 21/02/2011, 03:08 AM   #3
Master_Gangster
Huge Clucker
 
Master_Gangster's Avatar
 
Join Date: Jan 2009
Posts: 269
Reputation: 0
Default Re: [0.3c] Vehicle Missiles

pretty advanced and cool. I might use it as well (: good job.
Master_Gangster is offline   Reply With Quote
Old 21/02/2011, 05:08 AM   #4
barneystinson
Big Clucker
 
barneystinson's Avatar
 
Join Date: Oct 2010
Posts: 92
Reputation: 0
Default Re: [0.3c] Vehicle Missiles

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
barneystinson is offline   Reply With Quote
Old 21/02/2011, 05:15 AM   #5
Backwardsman97
High-roller
 
Backwardsman97's Avatar
 
Join Date: Nov 2007
Posts: 1,501
Reputation: 36
Default Re: [0.3c] Vehicle Missiles

You have to give an x and z offset when using AddVehicleMissiles.
Backwardsman97 is offline   Reply With Quote
Old 21/02/2011, 05:29 AM   #6
barneystinson
Big Clucker
 
barneystinson's Avatar
 
Join Date: Oct 2010
Posts: 92
Reputation: 0
Default Re: [0.3c] Vehicle Missiles

I used the one shown in your pic above 1,-0.2
barneystinson is offline   Reply With Quote
Old 21/02/2011, 05:44 AM   #7
Karlip
High-roller
 
Join Date: Oct 2007
Location: Click To Show
Posts: 1,479
Reputation: 102
Default Re: [0.3c] Vehicle Missiles

Nice job.

Using the particle was quite clever too.
__________________
Karlip is offline   Reply With Quote
Old 21/02/2011, 11:32 AM   #8
Unknown123
Guest
 
Posts: n/a
Default Re: [0.3c] Vehicle Missiles

Code:
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 (c) 1997-2006, ITB CompuPhase


2 Errors.
  Reply With Quote
Old 21/02/2011, 11:47 AM   #9
Zh3r0
High-roller
 
Join Date: Mar 2008
Posts: 4,513
Reputation: 398
Default Re: [0.3c] Vehicle Missiles

Quote:
Originally Posted by Unknown123 View Post
Code:
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 (c) 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
__________________
Zh3r0 is offline   Reply With Quote
Old 21/02/2011, 12:08 PM   #10
Infamous
Gangsta
 
Infamous's Avatar
 
Join Date: May 2009
Location: Essex, England
Posts: 663
Reputation: 65
Default Re: [0.3c] Vehicle Missiles

That's awesome, I'm gonna give this a test.
__________________

Infamous is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [DEV] Surface To Air Missiles pagie1111 Includes 2 23/09/2011 11:33 AM


All times are GMT. The time now is 09:11 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.