Advertisement
Guest User

Untitled

a guest
May 27th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. getFreeMorserID()
  2. {
  3. for(new i=0; i<sizeof(Morsa); i++)
  4. {
  5. if(Morsa[i][MorsaID]==-1) return i;
  6. }
  7. return -1;
  8. }
  9.  
  10.  
  11.  
  12. forward KaboomBoom();
  13. public KaboomBoom()
  14. {
  15. MorsaActive = 1;
  16. new id=getFreeMorserID();
  17.  
  18. new Random = random(sizeof(MorsaZeugs));
  19. Morsa[id][MorsaID] = CreateObject(1636,MorsaZeugs[Random][0], MorsaZeugs[Random][1], MorsaZeugs[Random][2], 0.0, 0.0, 96.0);
  20.  
  21. PHY_InitObject(Morsa[id][MorsaID], 1636, 1.0, FLOAT_NAN, PHY_MODE_3D);
  22. PHY_RollObject(Morsa[id][MorsaID], 1);
  23. Morsa[id][Light] = CreateObject(18670,MorsaZeugs[Random][0], MorsaZeugs[Random][1], MorsaZeugs[Random][2], 0.0, 0.0, 96.0,250.0);
  24.  
  25.  
  26. }
  27.  
  28.  
  29.  
  30. //OnObjectMoved
  31.  
  32. for(new i=0; i<sizeof(Morsa); i++)
  33. {
  34. if(Morsa[i][MorsaID]==objectid)
  35. {
  36. new Float:posx,Float:posy,Float:posz;
  37. GetObjectPos(Morsa[i][MorsaID], posx,posy,posz);
  38. CreateExplosion(posx,posy,posz, 7, 10);
  39. DestroyObject(Morsa[i][MorsaID]);
  40. DestroyObject(Morsa[i][Light]);
  41. Morsa[i][MorsaID] =-1;
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement