[FilterScript] Dynamic Military Landmines System
#1

Hello, I would like to present a dynamic system landmines.

Video:
https://www.youtube.com/watch?v=SXwb26E-kkU
https://www.youtube.com/watch?v=_E3tw_qYzhI

Functions:
PHP Code:
Mines::Create(type,Float:detection_range,Float:explode_radius,Float:health,respawntime,Float:x,Float:y,Float:z,worldid,interiorid,playerid,Float:streamdistance,mine_object MINE_OBJECT_STANDARD,teamid ANY_TEAM,detect_type MINE_DETECT_TYPE_ALL,byplayerid INVALID_PLAYER_ID,Float:damage=-1.0,Float:vehicle_damage=-1.0);

type explosion type //https://sampwiki.blast.hk/wiki/Explosion_List
Float:detection_range detection range player/vehicle
Float
:explode_radius the explosion range (the same as in CreateExplosion)
Float:health mine health (set MINE_INFINITY_HEALTH to be indestructible)
respawntime respawn time in seconds
Float
:xFloat:yFloat:zworldidinterioridplayeridFloat:streamdistance the same as in CreateDynamicObject
mine_object 
mine object
teamid 
player team will be immune to detection range or destroy mine
detect_type 
specify which elements are to be detected (MINE_DETECT_TYPE_ALL MINE_DETECT_TYPE_PLAYER MINE_DETECT_TYPE_VEHICLE)
Float:damage player damage on explosion created
Float
:vehicle_damage vehicle damage on explosion created

Mines
::CreateEx(objectid,type,Float:detection_range,Float:explode_radius,Float:health,respawntime,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,worldid,interiorid,playerid,Float:streamdistance,teamid ANY_TEAM,detect_type MINE_DETECT_TYPE_ALL,byplayerid INVALID_PLAYER_ID,Float:damage=-1.0,Float:vehicle_damage=-1.0);

Mines::Destroy(mobid);

Mines::GetExplodeVisibility();
Mines::SetExplodeVisibility(Float:explode_stream); 
Callbacks:
PHP Code:
OnMineDestroy(mobid,Float:x,Float:y,Float:z,type,killerid,Float:radius,damagerid);

types:
MINE_DESTROY_TYPE_DETECT  //When mine has been destroyed by detection range
MINE_DESTROY_TYPE_KILL    //When mine has been destroyed by player shoot 
Mine Object:
PHP Code:
MINE_OBJECT_STANDARD //default
MINE_OBJECT_UNDERWATER
MINE_OBJECT_LASER
MINE_OBJECT_PIZZA 
Example Pawn Code:
PHP Code:
#include <a_samp>
#include <streamer>
#include <ADM/3DTryg>
#include <Mines>

public OnFilterScriptInit(){
    
    
    
/*
    simply enter the coordinates of /save
    AddPlayerClass(71,-0.3440,0.2275,3.1172,65.1647,0,0,0,0,0,0); // 
    and select other parameters
    */
    
    // not recommended set worldid and interiorid -1
    
    
    
Mines::Create(MINE_TYPE_EXPLODE_HUGE2.00.1200.06010.0,0.0,3.11720,0,-1300.0MINE_OBJECT_STANDARD);
    
    
Mines::Create(MINE_TYPE_EXPLODE_SMALL1.50.01100.0150.00.03.11720,0, -1200.0,MINE_OBJECT_PIZZA);
    
    
Mines::Create(MINE_TYPE_EXPLODE_HUGE6.00.012000.012071.8122175.3036, -0.55470,0,-1,200.0MINE_OBJECT_UNDERWATER);

    return 
1;

Example Command:
PHP Code:
CMD:addmine(playerid,params[]){
    if(!
IsPlayerAdmin(playerid)) return 0;
    
    new 
buffer[128], typeFloat:detection_rangeFloat:explode_radiusFloat:healthrespawntime,
        
Float:xFloat:yFloat:zworldidinterioridFloat:streamdistancemine_object MINE_OBJECT_STANDARDteamid ANY_TEAM;
    
GetPlayerPos(playerid,x,y,z);
    
worldid GetPlayerVirtualWorld(playerid);
    
interiorid GetPlayerInterior(playerid);
    if(
sscanf(params,"dfffdfD(-1)D(-1)",type,detection_range,explode_radius,health,respawntime,streamdistance,mine_object,teamid)) return SendClientMessage(playerid,-1,"/addmine <type> <detection r> <explode r> <hp> <respawn> <stream distance> [obj] [team]");
    
    if(
mine_object == -1mine_object MINE_OBJECT_STANDARD;
    if(
teamid == -1teamid ANY_TEAM;
    
    new 
mobid Mines::Create(type,detection_range,explode_radius,health,respawntime,x,y,z,worldid,interiorid,-1,streamdistance,mine_object,teamid);
    
format(buffer,sizeof buffer,"Added mine id %d",mobid);
    
SendClientMessage(playerid,-1,buffer);
    
    
/*
    Mines::SetSpecialWeapon(mobid,GRENADE_SPECIAL_WEAPON_TEARGAS);
    Mines::SetEffectID(mobid,GRENADE_EFFECT_HUGE_SMOKE_1);
    Mines::SetEffectDMG(mobid,1.0);
    Mines::SetEffectVDMG(mobid,0.0);
    Mines::SetEffectTime(mobid,25);
    */
    
    
return 1;
}

CMD:delmine(playerid,params[]){
    if(!
IsPlayerAdmin(playerid)) return 0;
    new 
buffer[128], mobid INVALID_MINE_ID;
    if(
sscanf(params,"d",mobid)) return SendClientMessage(playerid,-1,"/delmine <mobid>");
    
    if(
MineComponent[mobid][mine_status] != MINE_STATUS_UNACTIVE){
        
Mines::Destroy(mobid);
        
format(buffer,sizeof buffer,"Removed mine id %d",mobid);
        
SendClientMessage(playerid,-1,buffer);
    } else {
        
format(buffer,sizeof buffer,"Mine id %d not exist",mobid);
        
SendClientMessage(playerid,-1,buffer);
    }
    return 
1;

Download:
Mines.inc
3DTryg.inc Thread
ExtendedGrenade.inc Thread

Notice:

Filterscript not exist because filterscripts have limits.

This has been replaced by include, having automatic installation, efficient GameMode/FilterScript.


Non-Registered Users:
Bug Report
Reply


Messages In This Thread
Dynamic Military Landmines System - by AbyssMorgan - 07.02.2016, 09:56
Re: Dynamic Military Landmines System - by AbyssMorgan - 09.02.2016, 13:39
Re: Dynamic Military Landmines System - by Alf21 - 09.02.2016, 14:13
Re: Dynamic Military Landmines System - by SystemX - 09.02.2016, 14:17
Re: Dynamic Military Landmines System - by Crystallize - 09.02.2016, 14:28
Re: Dynamic Military Landmines System - by DEATHSTROKE - 09.02.2016, 16:04
Re: Dynamic Military Landmines System - by valych - 09.02.2016, 16:12
Re: Dynamic Military Landmines System - by AbyssMorgan - 09.02.2016, 16:16
Re: Dynamic Military Landmines System - by Ritzy2K - 09.02.2016, 16:28
Re: Dynamic Military Landmines System - by AbyssMorgan - 09.02.2016, 18:25
Re: Dynamic Military Landmines System - by K0P - 09.02.2016, 18:40
Re: Dynamic Military Landmines System - by FreAkeD - 09.02.2016, 20:03
Re: Dynamic Military Landmines System - by Pottus - 10.02.2016, 00:20
Re: Dynamic Military Landmines System - by AbyssMorgan - 10.02.2016, 11:57
Re: Dynamic Military Landmines System - by AbyssMorgan - 10.02.2016, 18:36
Re: Dynamic Military Landmines System - by AbyssMorgan - 16.06.2016, 16:51
Re: Dynamic Military Landmines System - by samp_boy - 17.06.2016, 03:04
Re: Dynamic Military Landmines System - by AbyssMorgan - 17.06.2016, 13:35
Re: Dynamic Military Landmines System - by AbyssMorgan - 18.06.2016, 19:05
Re: Dynamic Military Landmines System - by AbyssMorgan - 19.06.2016, 20:35
Re: Dynamic Military Landmines System - by Xdrime - 20.06.2016, 13:44
Re: Dynamic Military Landmines System - by AbyssMorgan - 23.06.2016, 12:02
Re: Dynamic Military Landmines System - by AbyssMorgan - 06.07.2016, 18:04
Re: Dynamic Military Landmines System - by Recko - 06.07.2016, 18:44
Re: Dynamic Military Landmines System - by AbyssMorgan - 06.07.2016, 18:52
Re: Dynamic Military Landmines System - by Recko - 06.07.2016, 19:00
Re: Dynamic Military Landmines System - by AbyssMorgan - 06.07.2016, 19:05
Re: Dynamic Military Landmines System - by Recko - 06.07.2016, 19:06
Re: Dynamic Military Landmines System - by AbyssMorgan - 06.07.2016, 19:11
Re: Dynamic Military Landmines System - by Recko - 06.07.2016, 19:16
Re: Dynamic Military Landmines System - by Recko - 06.07.2016, 19:22
Re: Dynamic Military Landmines System - by AbyssMorgan - 06.07.2016, 19:25
Re: Dynamic Military Landmines System - by Recko - 06.07.2016, 19:28
Re: Dynamic Military Landmines System - by AbyssMorgan - 06.07.2016, 19:31
Re: Dynamic Military Landmines System - by quochuy - 07.07.2016, 18:16
Re: Dynamic Military Landmines System - by AbyssMorgan - 31.08.2016, 19:53
Re: Dynamic Military Landmines System - by Crayder - 31.08.2016, 20:06
Re: Dynamic Military Landmines System - by SickAttack - 31.08.2016, 20:10
Re: Dynamic Military Landmines System - by Crayder - 31.08.2016, 22:15
Re: Dynamic Military Landmines System - by Zorono - 01.09.2016, 00:28
Re: Dynamic Military Landmines System - by AbyssMorgan - 02.09.2016, 18:43
Re: Dynamic Military Landmines System - by Crayder - 02.09.2016, 19:02
Re: Dynamic Military Landmines System - by AbyssMorgan - 21.08.2017, 16:06

Forum Jump:


Users browsing this thread: 7 Guest(s)