20.06.2016, 13:44
B) good job abyss
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);
OnMineDetectPlayer(playerid,mobid);
detect_type - specify which elements are to be detected (MINE_DETECT_TYPE_ALL / MINE_DETECT_TYPE_PLAYER / MINE_DETECT_TYPE_VEHICLE)
#include <a_samp>
#include <streamer>
#include <ATM> //<--- this
#include <Mines>
#include <ATM> #include <Mines>
/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:
0 - STANDARD
1 - UNDERWATER
3 - LASER
teamid - player team will be immune to detection range or destroy mine
/addmine 2 30 100 100 1 300 0
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);
OnMineDetectPlayer(playerid,mobid); //how to detect now ? look down
#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:hp, vid = 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;
}
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.
|