[FilterScript] Air Bomb
#1

Hello guys, i did a filterscript and i found very interesting because i used a plugin MapAndreas what he does is very simple, it takes the Z coordinate dynamically using a map with high levels, you should download it HERE.

Code:

pawn Код:
/*
 _____   _   _____      _____   _____   ___   ___   _____
|  _  | | | |  _  |    |  _  | |  _  | |   | |   | |  _  |
| |_| | | | | |_| |    | |_| | | | | | |   |_|   | | |_| |
|  _  | | | |  _  \    |  _  \ | | | | |  _   _  | |  _  \
| | | | | | | | | |    | |_| | | |_| | | | | | | | | |_| |
|_| |_| |_| |_| |_|    |_____| |_____| |_| |_| |_| |_____|

..-=====-...-=====-...-=====-...-=====-...-=====-...-=====-..

All Rights Reserved, let the credits in the appropriate places, does not need to put in commands
Just leave the main() or OnFilterScriptInit...

Warning: This plugin uses the filterscript MapAndreas, you need to download it.

AProject Author: BlueX, thanks: Kalcor & Mauzen by MapAndreas

*/

#define FILTERSCRIPT

#define FS_V "v1"
#define FS_C "BlueX"
#define FS_D "18/4/2012"
#define FS_SOLTS (500) //Info: Edit the slots of your server.
#define FS_AMMO (25) //Info: Edit the maximum for each aircraft missiles

#include <a_samp>
#include <mapandreas>
#include <zcmd>

#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

new bomb[FS_SOLTS];
new ammo[MAX_VEHICLES] = FS_AMMO;
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    printf(" AIR BOMB %s",FS_V);
    printf(" CREDITOS: %s",FS_C);
    printf(" SOLTS: %d",FS_SOLTS);
    printf(" Release: %s",FS_D);
    print("--------------------------------------\n");
    MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_FIRE)){
        cmd_fire(playerid);
    }
    return 1;
}
CMD:fire(playerid){
    if(IsPlayerInAnyVehicle(playerid)){
            new Float:X,Float:Y,Float:Z,Float:A, car = GetPlayerVehicleID(playerid),model = GetVehicleModel(car);
        if(ammo[car] == 0) return SendClientMessage(playerid,-1,"sem muniзгo, use /ammo");
        if(model != 553) return 1;
        GetPlayerPos(playerid,X,Y,Z);
        GetVehicleZAngle(GetPlayerVehicleID(playerid),A);
        bomb[playerid] = CreateObject(345,X,Y,Z,A,0,0,0.0);
       
        MapAndreas_FindZ_For2DCoord(X,Y,Z);
        MoveObject(bomb[playerid],X,Y,Z,100.0,A,0.0,0.0);
        CreateExplosion(X,Y,Z,10,20.0);
        ammo[car] --;
        DestroyObject(bomb[playerid]);
    }
    return 1;
}
//Info: Command used to drop bombs, you can use the ALT key and can use the command /fire

CMD:ammo(playerid){
    new car = GetPlayerVehicleID(playerid);
    //if(IsPlayerInRangeOfPoint(playerid,10.0,X,Y,Z)){ ammo[car] = FS_AMMO };
    ammo[car] = 25;
    return 1;
}

//Info: You can put the command /ammo to work in a particular area just change the X, Y and Z
    //Remember that if you want to use IsPlayerInRangeOfPoint will have to eliminate the ammo[car]


/*CMD:nevada(playerid){
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    CreateVehicle(553,X,Y,Z+1,0,1,2,10000);
    return 1;
}*/


//Info: This command is used to create a nevada which is the vehicle that throws bombs ...
Description: What the FilterScript does is to send bombs, you press the ALT key and it goes dropping bombs, when you do not more bombs you must load it using /ammo, this FilterScript is very useful for servers of war.

ChangeLog:
  • v1 - Version released
Warnings:
  • This FilterScript was made in version 0.3eRC6, but I think that works in version 0.3d
  • Not recorded video because I was busy at the moment, but I took a photo just click HERE
  • Keep the credits in the content of the script does not cost anything, does not need to put in commands, just be in the code.
  • Sorry for my english and i hope you enjoyed.
Credits:
  • ~BlueX
    • Author of the Project
  • ~Kalcor
    • Creator of MapAndreas
  • ~Mauzen
    • Creator of MapAndreas v1.1
Reply


Messages In This Thread
Air Bomb - by RebeloX - 18.04.2012, 18:31
Re: Air Bomb - by paulor - 18.04.2012, 18:40
Re: Air Bomb - by Đeagle - 18.04.2012, 22:52
Re: Air Bomb - by Abhishek. - 19.04.2012, 00:27
Re: Air Bomb - by Soi_salva - 19.04.2012, 02:39
Re: Air Bomb - by Faisal_khan - 19.04.2012, 07:30
Re: Air Bomb - by Moh_ - 19.04.2012, 07:50
Re: Air Bomb - by RebeloX - 19.04.2012, 11:37
Re: Air Bomb - by dPlaYer_ - 23.04.2012, 19:47
Re : Air Bomb - by cazanova - 12.08.2012, 02:57
Re: Air Bomb - by [HP]Napola - 12.08.2012, 03:38

Forum Jump:


Users browsing this thread: 3 Guest(s)