SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 07/02/2016, 10:56 AM   #1
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,212
Reputation: 351
Cool Dynamic Military Landmines System

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://wiki.sa-mp.com/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

Last edited by AbyssMorgan; 09/10/2019 at 06:27 PM. Reason: Update v2.2.0
AbyssMorgan is offline   Reply With Quote
Old 09/02/2016, 02:39 PM   #2
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,212
Reputation: 351
Default Re: Dynamic Military Landmines System

Update 1.1: fixed CreateExplosionForRangePoint (reported by Wizzard2H)
AbyssMorgan is offline   Reply With Quote
Old 09/02/2016, 03:13 PM   #3
Alf21
Little Clucker
 
Join Date: Dec 2013
Location: LS in SA
Posts: 39
Reputation: 10
Default Re: Dynamic Military Landmines System

I like it, small but great idea
Alf21 is offline   Reply With Quote
Old 09/02/2016, 03:17 PM   #4
SystemX
Big Clucker
 
SystemX's Avatar
 
Join Date: Nov 2015
Location: !ncredible !ndia
Posts: 69
Reputation: 17
Default Re: Dynamic Military Landmines System

Nice, Good for COD servers. Rep++
SystemX is offline   Reply With Quote
Old 09/02/2016, 03:28 PM   #5
Crystallize
Banned
 
Join Date: Aug 2013
Posts: 1,504
Reputation: 314
Default Re: Dynamic Military Landmines System

Thanks for this amazing include I love it.Also glad you've fixed my bug report
Crystallize is offline   Reply With Quote
Old 09/02/2016, 05:04 PM   #6
DEATHSTROKE
Big Clucker
 
DEATHSTROKE's Avatar
 
Join Date: Feb 2015
Location: Colombo , Sri Lanka
Posts: 133
Reputation: 21
Default Re: Dynamic Military Landmines System

Awesome job dude.
DEATHSTROKE is offline   Reply With Quote
Old 09/02/2016, 05:12 PM   #7
valych
Big Clucker
 
valych's Avatar
 
Join Date: Aug 2009
Posts: 110
Reputation: 15
Default Re: Dynamic Military Landmines System

Nice one. But you should take a look at this thread: http://forum.sa-mp.com/showthread.php?t=571153 - how to hook a function in pawn, so people won't need to do this steps:
PHP Code:
//to hook functions 
Min_OnFilterScriptInit(); //IN OnFilterScriptInit OR OnGameModeInit 
Min_OnFilterScriptExit(); //IN OnFilterScriptExit OR OnGameModeExit 
Min_OnPlayerShootDynamicObject(playeridweaponidobjectidxyz); //IN OnPlayerShootDynamicObject 
Min_OnPlayerEnterDynamicArea(playeridareaid); //IN OnPlayerEnterDynamicArea 
valych is offline   Reply With Quote
Old 09/02/2016, 05:16 PM   #8
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,212
Reputation: 351
Default Re: Dynamic Military Landmines System

I can, but as a creature of such hooks are many you can get lost
AbyssMorgan is offline   Reply With Quote
Old 09/02/2016, 05:28 PM   #9
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Location: India
Posts: 1,548
Reputation: 170
Default Re: Dynamic Military Landmines System

Nice one!
__________________
Ritzy2K is offline   Reply With Quote
Old 09/02/2016, 07:25 PM   #10
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,212
Reputation: 351
Default Re: Dynamic Military Landmines System

added auto hooks in v1.3
AbyssMorgan 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] Dynamic House System v0.5 (w/Dialog Builder System+Customizable) ABKPot Filterscripts 19 27/01/2015 06:56 PM
[FilterScript] Dynamic Box [Vip System/Help System/2 previous script all in dBox!] JaKe Elite Filterscripts 6 28/11/2014 05:48 AM
[FilterScript] DWS - Dynamic Weapon System (Gun object, Saving system,...More) JusstinRoller Filterscripts 15 31/07/2013 11:02 AM
[Map] [MAP] From The Creators Of Abandoned Military Base: Big Ear Military Camp NiiRV4N4 Maps 2 10/04/2010 07:06 PM


All times are GMT. The time now is 12:41 PM.


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