Advertisement
RaFaeLs

RaFaeL - (Dymanic) Exploding include

Oct 4th, 2012
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.90 KB | None | 0 0
  1. /*
  2.     * By RaFaeL zilberman (c) 2012
  3.     * This include have writed for Simple usage
  4.     *
  5. */
  6.  
  7. #if defined _Explode_included
  8.   #endinput
  9. #endif
  10.  
  11. #define _Explode_included
  12.  
  13. /*
  14. native CreatePlayerExplosion(playerid, type, Float:radius, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
  15. native CreateVehicleExplosion(vehicleid, type, Float:radius, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
  16. native CreateObjectExplosion(objectid, type, Float:radius, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
  17. */
  18.  
  19. new Float:exPos[3];
  20.  
  21. //==============================================================================================================================
  22.  
  23. stock CreatePlayerExplosion(playerid, type, Float:radius, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0) {
  24.     if(playerid == INVALID_PLAYER_ID || !IsPlayerConnected(playerid)) return false;
  25.    
  26.     GetPlayerPos(playerid, exPos[0], exPos[1], exPos[2]);
  27.     CreateExplosion(exPos[0]+offsetx, exPos[1]+offsety, exPos[2]+offsetz, type, radius);
  28.    
  29.     return true;
  30. }
  31. stock CreateVehicleExplosion(vehicleid, type, Float:radius, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0) {
  32.     if(GetVehicleModel(vehicleid) <= 0) return false;
  33.    
  34.     GetVehiclePos(vehicleid, exPos[0], exPos[1], exPos[2]);
  35.     CreateExplosion(exPos[0]+offsetx, exPos[1]+offsety, exPos[2]+offsetz, type, radius);
  36.    
  37.     return true;
  38. }
  39. stock CreateObjectExplosion(objectid, type, Float:radius, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0) {
  40.     if(!IsValidDynamicObject(objectid)) return false;
  41.    
  42.     GetDynamicObjectPos(objectid, exPos[0], exPos[1], exPos[2]);
  43.     CreateExplosion(exPos[0]+offsetx, exPos[1]+offsety, exPos[2]+offsetz, type, radius);
  44.    
  45.     return true;
  46. }
  47.  
  48. //==============================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement