Advertisement
OtaconEvil

[INC] Fogata en SA-MP 'Objeto' By OTACON

Jul 18th, 2013
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.93 KB | None | 0 0
  1. /*
  2.              Prohibido TOTALMENTE el Robo de Créditos o la
  3.               Publicación de este INCLUDE sin Mi Permiso.
  4.  
  5.                      FULLY spaces Theft Credit or
  6.            Publication of this INCLUDE without my permission.
  7.  
  8.     SIMPLE INCLUDE --> Campfire in SA-MP 'Object'
  9.     CREDITOS: OTACON ;)
  10.     NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  11.    
  12. native CreateObjectCampfire(&slots, &Float:x, &Float:y, &Float:z, &Float:a); //to create the object of the campfire.
  13. native DestroyObjectCampfire(&slots); //to destroy the object of the campfire.
  14. native IsPlayerInRangeOfFire(playerid, &Float:distance); //to see if the player is close to the object of the campfire.
  15. */
  16. // ========== [ -|- FUNCTION -|- ] ==========
  17. #define MAX_SLOTS (50)
  18. new ObjectCampfire[MAX_SLOTS][8];
  19. stock DestroyObjectCampfire(slots) {
  20.     DestroyObject(ObjectCampfire[slots][0]);
  21.     DestroyObject(ObjectCampfire[slots][1]);
  22.     DestroyObject(ObjectCampfire[slots][2]);
  23.     DestroyObject(ObjectCampfire[slots][3]);
  24.     DestroyObject(ObjectCampfire[slots][4]);
  25.     DestroyObject(ObjectCampfire[slots][5]);
  26.     DestroyObject(ObjectCampfire[slots][6]);
  27.     DestroyObject(ObjectCampfire[slots][7]);
  28. }
  29. stock CreateObjectCampfire(slots, Float:x, Float:y, Float:z, Float:a) {
  30.     ObjectCampfire[slots][0]=CreateObject(841, x, y, z-1, 0.000, 0.000, a);
  31.     ObjectCampfire[slots][1]=CreateObject(841, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000);
  32.     ObjectCampfire[slots][2]=CreateObject(841, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000);
  33.     ObjectCampfire[slots][3]=CreateObject(18688, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000);
  34.     ObjectCampfire[slots][4]=CreateObject(18688, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000);
  35.     ObjectCampfire[slots][5]=CreateObject(18688, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000);
  36.     ObjectCampfire[slots][6]=CreateObject(18688, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000);
  37.     ObjectCampfire[slots][7]=CreateObject(18688, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000);
  38.     AttachObjectToObject(ObjectCampfire[slots][1], ObjectCampfire[slots][0], 0, -0.5, 0, 0, 0, 0, 1);
  39.     AttachObjectToObject(ObjectCampfire[slots][2], ObjectCampfire[slots][0], 0, -0.5, 0, 0, 0, 90, 1);
  40.     AttachObjectToObject(ObjectCampfire[slots][3], ObjectCampfire[slots][0], 0.5, -0.5, -2, 0, 0, 0, 1);
  41.     AttachObjectToObject(ObjectCampfire[slots][4], ObjectCampfire[slots][0], -0.5, -0.5, -2, 0, 0, 0, 1);
  42.     AttachObjectToObject(ObjectCampfire[slots][5], ObjectCampfire[slots][0], 0, -0.5, -2, 0, 0, 0, 1);
  43.     AttachObjectToObject(ObjectCampfire[slots][6], ObjectCampfire[slots][0], 0, -0.5, -2, 0, 0, 0, 1);
  44.     AttachObjectToObject(ObjectCampfire[slots][7], ObjectCampfire[slots][0], 0, -0.5, -2, 0, 0, 0, 1);
  45. }
  46. stock IsPlayerInRangeOfFire(playerid, Float:distance) {
  47.     new Float:posfire[4], Float:playerfire[3];
  48.     for(new slots=0; slots<MAX_SLOTS; slots++) {
  49.         if(!IsValidObject(ObjectCampfire[slots][0])) continue;
  50.         GetPlayerPos(playerid, playerfire[0], playerfire[1], playerfire[2]);
  51.         GetObjectPos(ObjectCampfire[slots][0],posfire[0],posfire[1],posfire[2]);
  52.         posfire[3] = floatsqroot(floatpower(floatabs(floatsub(playerfire[0],posfire[0])),2)+ floatpower(floatabs(floatsub(playerfire[1],posfire[1])),2)+ floatpower(floatabs(floatsub(playerfire[2],posfire[2])),2));
  53.         if(posfire[3] < distance) return true;
  54.     } return false;
  55. }
  56. // ========== [ -|- FUNCTION -|- ] ==========
  57. /*
  58.     #include <a_samp>
  59.     #include <zcmd>
  60.     #include <a_Campfire>
  61.  
  62.     public OnFilterScriptInit() {
  63.         print("\n**************************************");
  64.         print("       Campfire in SA-MP 'Object'       ");
  65.         print("           Date: 16/07/2013             ");
  66.         print("            Author: OTACON              ");
  67.         print("     --* Loaded with Success!!. *--     ");
  68.         print("***************************************\n");
  69.  
  70.         CreateObjectCampfire(0, 664.4656,-1903.3425,3.1809,353.5751);
  71.         return true;
  72.     }
  73.     public OnFilterScriptExit() {
  74.         print("\n**************************************");
  75.         print("       Campfire in SA-MP 'Object'       ");
  76.         print("           Date: 16/07/2013             ");
  77.         print("            Author: OTACON              ");
  78.         print("   --* Downloaded with Success!!. *--   ");
  79.         print("***************************************\n");
  80.  
  81.         DestroyObjectCampfire(0);
  82.         return true;
  83.     }
  84.     COMMAND:fire(playerid, params[]) {
  85.         if(!IsPlayerConnected(playerid)) return true;
  86.         if(IsPlayerInRangeOfFire(playerid, 3.0)) SendClientMessage(playerid, -1, "    [ ! ] you are near a campfire.!.");
  87.         else SendClientMessage(playerid, -1, "    [ ! ] you are not near a campfire!.");
  88.         return true;
  89.     }
  90. */
  91. /*
  92.              Prohibido TOTALMENTE el Robo de Créditos o la
  93.               Publicación de este INCLUDE sin Mi Permiso.
  94.  
  95.                      FULLY spaces Theft Credit or
  96.            Publication of this INCLUDE without my permission.
  97.  
  98.     SIMPLE INCLUDE --> Campfire in SA-MP 'Object'
  99.     CREDITOS: OTACON ;)
  100.     NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  101. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement