[FilterScript] Dynamic Military Landmines System
#21

B) good job abyss
Reply
#22

Update v1.9:
- Added Extended Functions:
PHP код:
ForceRespawnDynamicMine(mobid);
CountDynamicMines();
GetMineObjectID(mobid);
GetMineAreaID(mobid);
GetDynamicMinePos(mobid,&Float:x,&Float:y,&Float:z);
SetDynamicMinePos(mobid,Float:x,Float:y,Float:z);
GetDynamicMineRot(mobid,&Float:rx,&Float:ry,&Float:rz);
SetDynamicMineRot(mobid,Float:rx,Float:ry,Float:rz);
GetDynamicMineDetectionRange(mobid,&Float:detection_range);
SetDynamicMineDetectionRange(mobid,Float:detection_range);
GetDynamicMineExplodeRadius(mobid,&Float:explode_radius);
SetDynamicMineExplodeRadius(mobid,Float:explode_radius);
GetDynamicMineHealth(mobid,&Float:health);
SetDynamicMineHealth(mobid,Float:health);
GetDynamicMineMaxHealth(mobid,&Float:health);
SetDynamicMineMaxHealth(mobid,Float:health);
GetDynamicMineVW(mobid);
SetDynamicMineVW(mobid,worldid);
GetDynamicMineINT(mobid);
SetDynamicMineINT(mobid,interiorid);
GetDynamicMineSD(mobid,&Float:streamdistance);
SetDynamicMineSD(mobid,Float:streamdistance);
GetDynamicMineTeam(mobid);
SetDynamicMineTeam(mobid,teamid);
GetDynamicMineType(mobid);
SetDynamicMineType(mobid,type);
GetDynamicMineRespawntime(mobid);
SetDynamicMineRespawntime(mobid,respawntime); 
- Added Callbacks:
PHP код:
OnMineDetectPlayer(playerid,mobid); 
- Fixed identification mine between scripts
- Added additional param for CreateDynamicMine and CreateDynamicMineEx
PHP код:
detect_type specify which elements are to be detected (MINE_DETECT_TYPE_ALL MINE_DETECT_TYPE_PLAYER MINE_DETECT_TYPE_VEHICLE
- Changed value INVALID_MINE_ID from -1 to 0
- Now support for MoveDynamicObject(GetMineObjectID(mobid),...); and another streamer function
Reply
#23

Update v1.9.1:
- Fix Init Hook
Reply
#24

can you create filterscript plz?
Reply
#25


Just attach include to gamemode and use functions.
Reply
#26

Yes but i always have this message :
fatal error 111: user error: [ADM] You need ATM.inc v1.4.2

i have ATM.inc in includes folder
Reply
#27

do you have in Script?

PHP код:
#include <a_samp> 
#include <streamer> 
#include <ATM>  //<--- this
#include <Mines> 
Now I see that this is not written.
Reply
#28

Yep have it ^^
Reply
#29

This error means that ATM.inc not been included before Mines.inc

Код:
#include <ATM> 
#include <Mines>
Reply
#30

lol work thx awesome job
Reply
#31

but when i create /addmine IG nothing happens?
Reply
#32

The command has several parameters:
PHP код:
/addmine <type> <detection r> <explode r> <hp> <respawn> <stream distance> [obj] [team]
type explosion type //https://sampwiki.blast.hk/wiki/Explosion_List 
detection r detection range player/vehicle 
explode r 
the explosion range (the same as in CreateExplosion
hp mine health
respawn 
respawn time in seconds 
obj 
mine object:
STANDARD
UNDERWATER
LASER
teamid 
player team will be immune to detection range or destroy mine 
Reply
#33

/addmine 2 30 100 0 1 1 1
Reply
#34

hp must be greater than 0
stream distance 1 ? what ?
Код:
/addmine 2 30 100 100 1 300 0
Reply
#35

Nice rep+
Reply
#36

Update v2.0.0:

- Remove ATM.inc, replace with 3DTryg.inc (better compatibility)
- Update functions:
Код:
CreateDynamicMine(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);
CreateDynamicMineEx(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);
OnMineDestroy(mobid,Float:x,Float:y,Float:z,type,killerid,Float:radius,damagerid);
- Removed callback:
PHP код:
OnMineDetectPlayer(playerid,mobid); //how to detect now ? look down 
- New player detection method:
PHP код:
#define MINE_DAMAGE_PLAYER        80.0
#define MINE_DAMAGE_VEHICLE        1000.0
public OnMineDestroy(mobid,Float:x,Float:y,Float:z,type,killerid,Float:radius,damagerid){
    
    new 
Float:plx,Float:ply,Float:plz;
    
Tryg3DForeach(i){
        
GetPlayerPos(i,plx,ply,plz);
        if(
GetDistanceBetweenPoints3D(x,y,z,plx,ply,plz) <= radius){
            if(
IsPlayerInAnyVehicle(killerid)){
                new 
Float:hpvid GetPlayerVehicleID(killerid);
                
GetVehicleHealth(vid,hp);
                
SetVehicleHealth(vid,hp-MINE_DAMAGE_VEHICLE);
            } else {
                new 
Float:hp,Float:ar;
                
GetPlayerHealth(killerid,hp);
                
GetPlayerArmour(killerid,ar);
                
SetPlayerHealth(killerid,hp);
                
SetPlayerArmour(killerid,ar);
            
                
Tryg3D_GivePlayerDamage(killerid,MINE_DAMAGE_PLAYER,damagerid,51,true);
            }
        }
    }
    
    return 
1;

Reply
#37

You should add some kind of ray casting...

Like put a proximity mine on inside a doorway, and point it's ray across the doorway. Instead of constant timers and inefficient looping you could detect every time a player moves at least 0.25 units, and when they do check which mines they are in range of, for each of those mines check if the ray collides the player's collision sphere (1 unit radius since players are 2 units tall).

Just a concept. I'll play with this concept myself to see what I can come up with.
Reply
#38

Quote:
Originally Posted by Crayder
Посмотреть сообщение
You should add some kind of ray casting...

Like put a proximity mine on inside a doorway, and point it's ray across the doorway. Instead of constant timers and inefficient looping you could detect every time a player moves at least 0.25 units, and when they do check which mines they are in range of, for each of those mines check if the ray collides the player's collision sphere (1 unit radius since players are 2 units tall).

Just a concept. I'll play with this concept myself to see what I can come up with.
Or just use areas using the streamer plugin. You can get all the areas a player is in with one of its functions, and explode them all at once.
Reply
#39

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Or just use areas using the streamer plugin. You can get all the areas a player is in with one of its functions, and explode them all at once.
Except that's not how it works.

It's not an area explosion. It explodes in the mine's position still.
It's not as simple as checking an area, these laser tripwire mines can point in any direction, there isn't an area shape in streamer that can check this.

EDIT (9/1/16): Just remembered that I actually already have most of the code for this.
Reply
#40

Its too good Work Dude, But it would be more Better if you Replaced it into includes Section
+Repped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)