SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 25/12/2009, 04:37 PM   #1
pagie1111
Huge Clucker
 
Join Date: Dec 2008
Posts: 480
Reputation: 20
Exclamation SA:MP Surface-to-Air-Missile 0.4.1 Release

DISCONTINUED SCRIPT


What is it?

This include is a dynamic system of Surface-to-Air-Missile batteries. Better known the Anti-Air guns at Area 69. With this include you can place one of these systems ANYWHERE around San Andreas.

How does it work?

The system is built with timers that update the SAM's and the missiles. When you trigger the SAM site it will fire what looks to be a missile, which is actually a hydra flare. The missile travels at selected speed and once it gets close to you it triggers 3 explosions and destroys your plane/helicopter. The system works on ALL aircraft, civilian and military.


How to install?

Extract the SamSites.rar file into your server directory and all the correct files will go into the correct folders. It is important that you keep the filterscript file as the same name, as it will be used to restart the system.

How to add SAM Sites?

There is ONLY ONE way to create a Sam Site now. The system has been reduce to ONE function for creation, simply to stop confusion.

pawn Code:
native AddStaticSAM(Float:X, Float:Y, Float:Z, Float:srange=DEFAULT_SAM_RANGE, Float:sspeed=DEFAULT_SAM_SPEED, bool:CSO=false, Float:rX, Float:rY, Float:zZ);

The following parameters with an * are mandatory to the function, any other parameter you DON NOT need to add.
Quote:
*Float:X = X co-ordinate of your Sam Site
*Float:Y = Y co-ordinate of your Sam Site
*Float:Z = Z co-ordinate of your Sam Site
Floatrange = range of your samsite
Floatspeed = speed of your Missile
bool:CSO = If you need to create a SAM Site object, then you must put true here. ** Scroll down to see important information
Float:rX = Rotation X co-ordinate of your Sam Site object
Float:rY = Rotation Y co-ordinate of your Sam Site object
Float:rZ = Rotation Z co-ordinate of your Sam Site object

** To keep srange and sspeed as their defaults, but you want to create a Sam Site object, you must have this layout:

AddStaticSam(X,Y,Z,_,_,true);

Placing a '_' in a parameter will make sure it is assigned to the value its given in the function calling.
pawn Code:
AddStaticSAM(237.5797,1698.6908,23.8673,400.000,108.00); // example of custom range and speed values
AddStaticSAM(15.3281,1720.9646,23.8673,_,_,true); // example of creating a Sam Site object, but keeping default range and speed
AddStaticSAM(188.2694,2083.4644,23.9063_,_,true,1.0,1.0,0.0); // example of creating Sam Site object, keeping default range and speed and also adding in custom rotation values
AddStaticSAM(354.5453,2030.3062,23.8750); // example of creating a system ontop of one of the Area 69 SAM Turrets with no custom range or speed values

To change how many SAMS this system can handle, Find System Config and change

pawn Code:
#define MAX_SAMS 32

to what ever it is you want. I suggest not going for an extreme number.

Team Compatibility:

WARNING: As of v0.3 the default team compatibility has been removed, see below.

The callback "OnSamSiteUpdate" allows for you to cancel a SAM from firing. This can now host any team script like gTeam.

You must use return 0; to cancel a SAM from firing now. SAM_cancel(); NO LONGER EXISTS!

Example:
pawn Code:
public OnSamSiteUpdate(samid, playerid)
{
   if(samid == 1)
   {
       if(gTeam[playerid] == TEAM_ARMY)
       {
         return 0;
       }
   }
   return 1;
}

SAM Site Labels

Now it is possible to add 3D Text labels to your SAM Sites through the script, basically no work at all.

Simply add under SAM_start(); in OnGameModeInit()

pawn Code:
CreateSamLabel(samid, label[], color, Float:DrawDistance, LOS);

Area 69 SAM locations:

pawn Code:
AddStaticSAM(237.5797,1698.6908,23.8673);
AddStaticSAM(15.3281,1720.9646,23.8673);
AddStaticSAM(188.2694,2083.4644,23.9063);
AddStaticSAM(354.5453,2030.3062,23.8750);

Dead Sam Bug

In v0.4 there is an attempt to fix the SAMS from dying after a while.

This is why you need to run it into a filterscript. The system will automatically restart the filterscript every 30 minutes my default, though you can change this by changing RESTART_TIME, remember it is in milliseconds.

Also, if you need to change the name of the filterscript for whatever reason, change RESTART_STRING to the correct string or the system will fail.

In the near future, I do hope that I can make this system mutli-script compatible, so you can communicate the system with filterscripts and gamemode at the same time.. this unfortunately will have to wait right now.

Download:
(Some older versions removed)

v0.4.1
(No pastebin will be offered)

SA:MP SamSites 0_4_1.rar << DIRECT DOWNLOAD ONLY!

v0.4
SA:MP SAMSites0.4.inc << DIRECT DOWNLOAD
SA:MP SAMSites0.4.inc << PASTEBIN

Changelog
Code:
0.1
- First Release
0.1.1 
- Now doesn't fire missiles after you are dead from the first missile
- Now there is a "Drag" feature, if the missile is alive for more than 25 seconds, it will blow up.
0.1.2 
- Now the missiles DO NOT stay at the place where the detonated.
---
0.2 
- Added new functions.
- Added SAM Sites based on Team.
- Added ability to set custom Range and Speed of missiles per samid.
- Added functions that create a SAM Site object - Level to the ground.
---
0.3 BETA 
- Added callback OnSamSiteUpdate
- Attempted to fix the missile chase id (should chase correct vehicle)
- Removed default team script
- Added new function
- Removed a function
0.3.1
- Variables cannot be samid's
- Fixed the Array error
- Fixed the Callback
0.3.2
- Variables can now be used as reference to the samid
- Fixed the tracking of missiles, missiles now SHOULD chase the right vehicle
- Added a restart timer, this restarts the SAMS system in attempt to stop a bug
- Added Sam Labels
0.3.3
- Fixed the buged SAMS at 0.0,0.0,0.0 - Credit to rs2fun111 for finding this bug
0.4
- Added new callback OnSamSiteRestarted
- Attempted fix of "Dead Sam Bug"
- Added 'under the radar' checking
- Updated the Default limit to SPEED and MAX_SAMS
0.4.1
- Removed 3 functions and merged them into 1
- Attempted a new fix to "Dead Sam Bug"
- Changed OnSamSiteUpdate usage for stopping friendly fire
- Removed SAM_cancel();

4 April 2012 - Script Development Discontinued until futher notice.
Bugs
Code:
- Sam Sites stop working after a period of time (Since 0.1) (Fix not yet confirmed)
Credits:

If you can add credits to me for this, and not re-release it under your own name it would be appreciated.

[hr]
Please post any bugs that you may encounter. I unfortunately can't guarantee a fully bug-free script with this first release. None have been found so far.

Thank-you to Μαστερμινδ, lrZ^ aka LarzI and [HiC]TheKiller who helped with an array error.
__________________
BockScar
+1 rep
Hunger Games Coming soon!


________________________________________________

Last edited by pagie1111; 04/05/2012 at 03:42 AM. Reason: Updates
pagie1111 is offline   Reply With Quote
Old 25/12/2009, 05:04 PM   #2
Striker_Moe
Gangsta
 
Join Date: Apr 2009
Posts: 615
Reputation: 1
Default Re: [INC] SA:MP Surface-to-Air-Missile - SAM v0.1

Suggestion: Add AddStaticSamEx(ID,X,Z,Y,RANGE,MISSILESPEED,NotShoo tingAt);

At NotShootingAt you could for example define "gTeam == 1" and the SAMs would not shoot players with gTeam 1.

Then I┤d use it.
Striker_Moe is offline   Reply With Quote
Old 25/12/2009, 05:08 PM   #3
pagie1111
Huge Clucker
 
Join Date: Dec 2008
Posts: 480
Reputation: 20
Default Re: [INC] SA:MP Surface-to-Air-Missile - SAM v0.1

Quote:
Originally Posted by Mo3
Suggestion: Add AddStaticSamEx(ID,X,Z,Y,RANGE,MISSILESPEED,NotShoo tingAt);

At NotShootingAt you could for example define "gTeam == 1" and the SAMs would not shoot players with gTeam 1.

Then I┤d use it.
Thanks for the suggestion, I will maybe add it to another version, I am going to leave it as is. But you are welcome to edit it for your own likings.
__________________
BockScar
+1 rep
Hunger Games Coming soon!


________________________________________________
pagie1111 is offline   Reply With Quote
Old 25/12/2009, 08:31 PM   #4
rs2fun111
Huge Clucker
 
Join Date: Aug 2009
Posts: 251
Reputation: 0
Default Re: [INC] SA:MP Surface-to-Air-Missile - SAM v0.1

can u please upload it to MediaFire?
rs2fun111 is offline   Reply With Quote
Old 25/12/2009, 09:03 PM   #5
rs2fun111
Huge Clucker
 
Join Date: Aug 2009
Posts: 251
Reputation: 0
Default Re: [INC] SA:MP Surface-to-Air-Missile - SAM v0.1

i stayd 10 minutes on samsite with hydra but nothing
rs2fun111 is offline   Reply With Quote
Old 25/12/2009, 09:14 PM   #6
Dark_Kostas
Gangsta
 
Join Date: Dec 2007
Location: Greece, Athens
Posts: 772
Reputation: 14
Default Re: [INC] SA:MP Surface-to-Air-Missile - SAM v0.1

Looks nice! Can you upload it to pastebin? Also i have 2 suggestions. One would be to make it possible to return the id with new. Like
pawn Code:
new sam1 = AddStaticSAM(X,Y,Z);
And the second, add a variable true/false so you can choose if you want to create an object or not.
pawn Code:
AddStaticSAM(X,Y,Z,1);//It will create sam object
AddStaticSAM(X,Y,Z,0);//It will NOT create sam object
__________________
Quote:
Help != Scripting for you.

Give a man a fish he eats for a day, teach a man to fish he eats for a life time.
Dark_Kostas is offline   Reply With Quote
Old 26/12/2009, 02:44 AM   #7
pagie1111
Huge Clucker
 
Join Date: Dec 2008
Posts: 480
Reputation: 20
Default Re: [INC] SA:MP Surface-to-Air-Missile - SAM v0.1

Quote:
Originally Posted by rs2fun111
can u please upload it to MediaFire?
I had problems uploading to mediafire. Check first post for a pastebin..
__________________
BockScar
+1 rep
Hunger Games Coming soon!


________________________________________________
pagie1111 is offline   Reply With Quote
Old 26/12/2009, 04:38 AM   #8
pagie1111
Huge Clucker
 
Join Date: Dec 2008
Posts: 480
Reputation: 20
Default Re: [INC] SA:MP Surface-to-Air-Missile - SAM v0.1

Quote:
Originally Posted by rs2fun111
i stayd 10 minutes on samsite with hydra but nothing
Did you place SAM_start(); in OnGameModeInit?
__________________
BockScar
+1 rep
Hunger Games Coming soon!


________________________________________________
pagie1111 is offline   Reply With Quote
Old 26/12/2009, 06:56 AM   #9
Snyper18
Huge Clucker
 
Join Date: Oct 2007
Posts: 364
Reputation: 0
Default Re: [INC] SA:MP Surface-to-Air-Missile - SAM v0.1

It's nice, but it kept shooting missles when I died.
Snyper18 is offline   Reply With Quote
Old 26/12/2009, 07:07 AM   #10
pagie1111
Huge Clucker
 
Join Date: Dec 2008
Posts: 480
Reputation: 20
Default Re: [INC] SA:MP Surface-to-Air-Missile - SAM v0.1

Quote:
Originally Posted by Bruzer18
It's nice, but it kept shooting missles when I died.
Once you blow up, it sets the Fired to 0. This may be because you are still in the range.

I will make a fix. 0.1.1
__________________
BockScar
+1 rep
Hunger Games Coming soon!


________________________________________________
pagie1111 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
[FilterScript] [FS] Missile sasuke78200 Franšais/French 3 16/09/2011 08:59 PM


All times are GMT. The time now is 11:44 AM.


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