Guest User

Strip System

a guest
Oct 14th, 2012
816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. stock CreateStrip(Float:x,Float:y,Float:z,Float:Angle)
  2. {
  3. for(new i = 0; i < sizeof(SpikeInfo); i++)
  4. {
  5. if(SpikeInfo[i][sCreated] == 0)
  6. {
  7. SpikeInfo[i][sCreated]=1;
  8. SpikeInfo[i][sX]=x;
  9. SpikeInfo[i][sY]=y;
  10. SpikeInfo[i][sZ]=z-0.7;
  11. SpikeInfo[i][sObject] = CreateObject(2899, x, y, z-0.9, 0, 0, Angle-90);
  12. return 1;
  13. }
  14. }
  15. return 0;
  16. }
  17.  
  18.  
  19. stock DeleteAllStrip()
  20. {
  21. for(new i = 0; i < sizeof(SpikeInfo); i++)
  22. {
  23. if(SpikeInfo[i][sCreated] == 1)
  24. {
  25. SpikeInfo[i][sCreated]=0;
  26. SpikeInfo[i][sX]=0.0;
  27. SpikeInfo[i][sY]=0.0;
  28. SpikeInfo[i][sZ]=0.0;
  29. DestroyObject(SpikeInfo[i][sObject]);
  30. }
  31. }
  32. return 0;
  33. }
  34.  
  35.  
  36. stock DeleteClosestStrip(playerid)
  37. {
  38. for(new i = 0; i < sizeof(SpikeInfo); i++)
  39. {
  40. if(IsPlayerInRangeOfPoint(playerid, 2.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
  41. {
  42. if(SpikeInfo[i][sCreated] == 1)
  43. {
  44. SpikeInfo[i][sCreated]=0;
  45. SpikeInfo[i][sX]=0.0;
  46. SpikeInfo[i][sY]=0.0;
  47. SpikeInfo[i][sZ]=0.0;
  48. DestroyObject(SpikeInfo[i][sObject]);
  49. return 1;
  50. }
  51. }
  52. }
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment