31.08.2016, 19:53
Update v2.0.0:
- Remove ATM.inc, replace with 3DTryg.inc (better compatibility)
- Update functions:
- Removed callback:
- New player detection method:
- 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);
PHP код:
OnMineDetectPlayer(playerid,mobid); //how to detect now ? look down
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: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;
}