Pablo_Borsellino

[FIlterscript] pSpaceship

Oct 18th, 2011
396
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*********************************************************** pSpaceship v1.0 ***
  2. *
  3. * Scriptname:
  4. * -» pSpaceship
  5. *
  6. * Author:
  7. * -» Pablo_Borsellino
  8.  
  9. * Changelog:
  10. * • v1.0 (18.10.2011)
  11. * -» Initial Release
  12. *
  13. * Need to use:
  14. * -» Sa:Mp 0.3d RC5-3 or higher
  15. *
  16. * Language:
  17. * -» English
  18. *
  19. * Description:
  20. * -» Watch the Video: http://www.youtube.com/watch?v=rwGb3W9rqoQ
  21. *
  22. * Functions:
  23. * -» n/a
  24. *
  25. * Public's:
  26. * -» n/a
  27. *
  28. * Credit's:
  29. * -» n/a
  30. *                                           Copyright © 2011 by Pablo_Borsellino
  31. *******************************************************************************/
  32.  
  33. //_____________________________________________________________________Include's
  34. #include <a_samp>
  35.  
  36. //__________________________________________________________________Definition's
  37. #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  38. #define forEx(%0,%1) for(new %1=0;%1<%0;%1++)
  39.  
  40. //_____________________________________________________________________Setting's
  41. #define SPACESHIP_SPEED 4 //speed of the spaceship
  42. #define SPACESHIP_CONSUMPTION 0.1 //fuel consumption of spaceship
  43. #define BONUS_SPEED 6 //speed of the bonus
  44. #define BONUS_DISTANCE 25 //distance between the bonus in seconds
  45. #define ATTACKER_SPEED 10 //speed of the attacker
  46. #define ATTACKER_DISTANCE 1 //distance between the attacker in seconds (1@Time)
  47.  
  48. //____________________________________________________________________Variable's
  49. new Text:TD_Spaceship_Background,
  50.     Text:TD_Spaceship_CornerTopLeft,
  51.     Text:TD_Spaceship_CornerTopRight,
  52.     Text:TD_Spaceship_CornerBottomLeft,
  53.     Text:TD_Spaceship_CornerBottomRight,
  54.    
  55.     Text:TD_Spaceship[MAX_PLAYERS],
  56.     Text:TD_Spaceship_Fuel[MAX_PLAYERS],
  57.     Text:TD_Spaceship_Health[MAX_PLAYERS],
  58.     Text:TD_Spaceship_Bonus[MAX_PLAYERS],
  59.     Text:TD_Spaceship_Attacker[MAX_PLAYERS],
  60.     Text:TD_Spaceship_Explosion[MAX_PLAYERS],
  61.  
  62.     _Spaceship_Position[MAX_PLAYERS]=300,
  63.     _Spaceship_Health[MAX_PLAYERS]=100,
  64.     _Spaceship_Explosion[MAX_PLAYERS]=3,
  65.     _Spaceship_BonusX[MAX_PLAYERS],
  66.     _Spaceship_BonusY[MAX_PLAYERS]=-10,
  67.     _Spaceship_AttackerX[MAX_PLAYERS],
  68.     _Spaceship_AttackerY[MAX_PLAYERS]=-10,
  69.  
  70.     Float:_Spaceship_Fuel[MAX_PLAYERS]=100.0,
  71.  
  72.     bool:_Spaceship_PlayerPlays[MAX_PLAYERS]=false,
  73.     bool:_Spaceship_Bonus_ONW[MAX_PLAYERS]=false, //On the way
  74.     bool:_Spaceship_Attacker_ONW[MAX_PLAYERS]=false, //On the way
  75.     bool:_Spaceship_PlayerExplode[MAX_PLAYERS]=false,
  76.     bool:_Spaceship_PlayerLoosed[MAX_PLAYERS]=false;
  77.    
  78. //______________________________________________________________________Public's
  79. public OnFilterScriptInit()
  80. {
  81.     TD_Spaceship_Background=TextDrawCreate(0,0,"LD_DUAL:backgnd");
  82.     TextDrawFont(TD_Spaceship_Background,4);
  83.     TextDrawColor(TD_Spaceship_Background,0xFFFFFFFF);
  84.     TextDrawTextSize(TD_Spaceship_Background,640,480);
  85.  
  86.     TD_Spaceship_CornerTopLeft=TextDrawCreate(0,0,"LD_DUAL:tvcorn");
  87.     TextDrawFont(TD_Spaceship_CornerTopLeft,4);
  88.     TextDrawColor(TD_Spaceship_CornerTopLeft,0xFFFFFFFF);
  89.     TextDrawTextSize(TD_Spaceship_CornerTopLeft,320,240);
  90.  
  91.     TD_Spaceship_CornerTopRight=TextDrawCreate(640,0,"LD_DUAL:tvcorn");
  92.     TextDrawFont(TD_Spaceship_CornerTopRight,4);
  93.     TextDrawColor(TD_Spaceship_CornerTopRight,0xFFFFFFFF);
  94.     TextDrawTextSize(TD_Spaceship_CornerTopRight,-320,240);
  95.  
  96.     TD_Spaceship_CornerBottomLeft=TextDrawCreate(0,450,"LD_DUAL:tvcorn");
  97.     TextDrawFont(TD_Spaceship_CornerBottomLeft,4);
  98.     TextDrawColor(TD_Spaceship_CornerBottomLeft,0xFFFFFFFF);
  99.     TextDrawTextSize(TD_Spaceship_CornerBottomLeft,320,-240);
  100.  
  101.     TD_Spaceship_CornerBottomRight=TextDrawCreate(640,450,"LD_DUAL:tvcorn");
  102.     TextDrawFont(TD_Spaceship_CornerBottomRight,4);
  103.     TextDrawColor(TD_Spaceship_CornerBottomRight,0xFFFFFFFF);
  104.     TextDrawTextSize(TD_Spaceship_CornerBottomRight,-320,-250);
  105.     return true;
  106. }
  107.  
  108. public OnFilterScriptExit()
  109. {
  110.     TextDrawDestroy(TD_Spaceship_Background);
  111.     TextDrawDestroy(TD_Spaceship_CornerTopLeft);
  112.     TextDrawDestroy(TD_Spaceship_CornerTopRight);
  113.     TextDrawDestroy(TD_Spaceship_CornerBottomLeft);
  114.     TextDrawDestroy(TD_Spaceship_CornerBottomRight);
  115.     forEx(MAX_PLAYERS,playerid)
  116.         HideSpaceshipGame(playerid);
  117.     return true;
  118. }
  119.  
  120. public OnPlayerUpdate(playerid)
  121. {
  122.     if(_Spaceship_PlayerPlays[playerid]==true&&_Spaceship_PlayerLoosed[playerid]==false)
  123.     {
  124.         if(_Spaceship_Fuel[playerid]<=0)return PlayerLooseSpaceship(playerid);
  125.         new Keys,UNUSED_KEYS,LeftOrRight;
  126.         GetPlayerKeys(playerid,Keys,UNUSED_KEYS,LeftOrRight);
  127.         if(LeftOrRight>0)//Right
  128.         {
  129.             if(_Spaceship_Position[playerid]>540-SPACESHIP_SPEED)return true;
  130.             _Spaceship_Fuel[playerid]-=SPACESHIP_CONSUMPTION;
  131.             _Spaceship_Position[playerid]=_Spaceship_Position[playerid]+SPACESHIP_SPEED;
  132.         }
  133.         else if(LeftOrRight<0)//Left
  134.         {
  135.             if(_Spaceship_Position[playerid]<60+SPACESHIP_SPEED)return true;
  136.             _Spaceship_Fuel[playerid]-=SPACESHIP_CONSUMPTION;
  137.             _Spaceship_Position[playerid]=_Spaceship_Position[playerid]-SPACESHIP_SPEED;
  138.         }
  139.         TextDrawDestroy(TD_Spaceship[playerid]);
  140.         TD_Spaceship[playerid]=TextDrawCreate(_Spaceship_Position[playerid],360,"LD_DUAL:rockshp");
  141.         TextDrawFont(TD_Spaceship[playerid],4);
  142.         TextDrawColor(TD_Spaceship[playerid],0xFFFFFFFF);
  143.         TextDrawTextSize(TD_Spaceship[playerid],40,40);
  144.         TextDrawShowForPlayer(playerid,TD_Spaceship[playerid]);
  145.  
  146.         TextDrawDestroy(TD_Spaceship_Fuel[playerid]);
  147.         TD_Spaceship_Fuel[playerid]=TextDrawCreate(480,50,"LD_DUAL:health");
  148.         TextDrawFont(TD_Spaceship_Fuel[playerid],4);
  149.         TextDrawColor(TD_Spaceship_Fuel[playerid],0xFFFFFFFF);
  150.         TextDrawTextSize(TD_Spaceship_Fuel[playerid],_Spaceship_Fuel[playerid],5);
  151.         TextDrawShowForPlayer(playerid,TD_Spaceship_Fuel[playerid]);
  152.     }
  153.     return true;
  154. }
  155.  
  156. public OnPlayerCommandText(playerid, cmdtext[])
  157. {
  158.     dcmd(spaceship,9,cmdtext);
  159.     dcmd(exitspaceship,13,cmdtext);
  160.     return false;
  161. }
  162.  
  163. //_____________________________________________________________________Command's
  164. dcmd_exitspaceship(playerid,params[])
  165. {
  166.     #pragma unused params
  167.     if(_Spaceship_PlayerPlays[playerid]==true)
  168.         HideSpaceshipGame(playerid);
  169.     return true;
  170. }
  171.  
  172. dcmd_spaceship(playerid,params[])
  173. {
  174.     #pragma unused params
  175.     if(_Spaceship_PlayerPlays[playerid]==true)return true;
  176.     TogglePlayerControllable(playerid,false);
  177.     forEx(20,i)
  178.         SendClientMessage(playerid,-1,"");
  179.     TD_Spaceship[playerid]=TextDrawCreate(300,360,"LD_DUAL:rockshp");
  180.     TextDrawFont(TD_Spaceship[playerid],4);
  181.     TextDrawColor(TD_Spaceship[playerid],0xFFFFFFFF);
  182.     TextDrawTextSize(TD_Spaceship[playerid],40,40);
  183.    
  184.     TD_Spaceship_Fuel[playerid]=TextDrawCreate(480,50,"LD_DUAL:health");
  185.     TextDrawFont(TD_Spaceship_Fuel[playerid],4);
  186.     TextDrawColor(TD_Spaceship_Fuel[playerid],0xFFFFFFFF);
  187.     TextDrawTextSize(TD_Spaceship_Fuel[playerid],100,5);
  188.    
  189.     TD_Spaceship_Health[playerid]=TextDrawCreate(480,40,"LD_DUAL:power");
  190.     TextDrawFont(TD_Spaceship_Health[playerid],4);
  191.     TextDrawColor(TD_Spaceship_Health[playerid],0xFFFFFFFF);
  192.     TextDrawTextSize(TD_Spaceship_Health[playerid],100,5);
  193.  
  194.     TextDrawShowForPlayer(playerid,TD_Spaceship_Background);
  195.     TextDrawShowForPlayer(playerid,TD_Spaceship_CornerTopLeft);
  196.     TextDrawShowForPlayer(playerid,TD_Spaceship_CornerTopRight);
  197.     TextDrawShowForPlayer(playerid,TD_Spaceship_CornerBottomLeft);
  198.     TextDrawShowForPlayer(playerid,TD_Spaceship_CornerBottomRight);
  199.     TextDrawShowForPlayer(playerid,TD_Spaceship[playerid]);
  200.     TextDrawShowForPlayer(playerid,TD_Spaceship_Fuel[playerid]);
  201.     TextDrawShowForPlayer(playerid,TD_Spaceship_Health[playerid]);
  202.     _Spaceship_PlayerPlays[playerid]=true;
  203.     SetTimerEx("SendBonusToSpaceship",BONUS_DISTANCE*1000,false,"d",playerid);
  204.     SetTimerEx("SendAttackerToSpaceship",ATTACKER_DISTANCE*1000,false,"d",playerid);
  205.     return true;
  206. }
  207.  
  208. //__________________________________________________________________New Public's
  209. forward SendBonusToSpaceship(playerid);
  210. public SendBonusToSpaceship(playerid)
  211. {
  212.     if(_Spaceship_PlayerPlays[playerid]==false)return true;
  213.     if(_Spaceship_Bonus_ONW[playerid]==true)return true;
  214.     _Spaceship_Bonus_ONW[playerid]=true;
  215.     _Spaceship_BonusY[playerid]=-10;
  216.     _Spaceship_BonusX[playerid]=Random(70,520);
  217.     TD_Spaceship_Bonus[playerid]=TextDrawCreate(_Spaceship_BonusX[playerid],_Spaceship_BonusY[playerid],"LD_DUAL:shoot");
  218.     TextDrawFont(TD_Spaceship_Bonus[playerid],4);
  219.     TextDrawColor(TD_Spaceship_Bonus[playerid],0xFFFFFFFF);
  220.     TextDrawTextSize(TD_Spaceship_Bonus[playerid],10,10);
  221.     TextDrawShowForPlayer(playerid,TD_Spaceship_Bonus[playerid]);
  222.     SetTimerEx("SendBonusToSpaceshipTimer",100,false,"d",playerid);
  223.     return true;
  224. }
  225.  
  226. forward SendBonusToSpaceshipTimer(playerid);
  227. public SendBonusToSpaceshipTimer(playerid)
  228. {
  229.     if(_Spaceship_PlayerPlays[playerid]==false)return true;
  230.     if(_Spaceship_BonusY[playerid]>480)
  231.     {
  232.         TextDrawHideForPlayer(playerid,TD_Spaceship_Bonus[playerid]);
  233.         _Spaceship_Bonus_ONW[playerid]=false;
  234.         SetTimerEx("SendBonusToSpaceship",BONUS_DISTANCE*1000,false,"d",playerid);
  235.         return true;
  236.     }
  237.     if(_Spaceship_BonusY[playerid]>360&&_Spaceship_BonusY[playerid]<400)
  238.     {
  239.         if(_Spaceship_BonusX[playerid]>_Spaceship_Position[playerid]&&_Spaceship_BonusX[playerid]<_Spaceship_Position[playerid]+30)
  240.         {
  241.             TextDrawHideForPlayer(playerid,TD_Spaceship_Bonus[playerid]);
  242.             _Spaceship_Fuel[playerid]=100;
  243.             if(_Spaceship_Health[playerid]<=75)_Spaceship_Health[playerid]+=25;
  244.             TextDrawDestroy(TD_Spaceship_Health[playerid]);
  245.             TD_Spaceship_Health[playerid]=TextDrawCreate(480,40,"LD_DUAL:power");
  246.             TextDrawFont(TD_Spaceship_Health[playerid],4);
  247.             TextDrawColor(TD_Spaceship_Health[playerid],0xFFFFFFFF);
  248.             TextDrawTextSize(TD_Spaceship_Health[playerid],_Spaceship_Health[playerid],5);
  249.             TextDrawShowForPlayer(playerid,TD_Spaceship_Health[playerid]);
  250.             _Spaceship_Bonus_ONW[playerid]=false;
  251.             SetTimerEx("SendBonusToSpaceship",BONUS_DISTANCE*1000,false,"d",playerid);
  252.             return true;
  253.         }
  254.     }
  255.     TextDrawDestroy(TD_Spaceship_Bonus[playerid]);
  256.     TD_Spaceship_Bonus[playerid]=TextDrawCreate(_Spaceship_BonusX[playerid],_Spaceship_BonusY[playerid],"LD_DUAL:shoot");
  257.     TextDrawFont(TD_Spaceship_Bonus[playerid],4);
  258.     TextDrawColor(TD_Spaceship_Bonus[playerid],0xFFFFFFFF);
  259.     TextDrawTextSize(TD_Spaceship_Bonus[playerid],10,10);
  260.     TextDrawShowForPlayer(playerid,TD_Spaceship_Bonus[playerid]);
  261.     _Spaceship_BonusY[playerid]+=BONUS_SPEED;
  262.     SetTimerEx("SendBonusToSpaceshipTimer",100,false,"d",playerid);
  263.     return true;
  264. }
  265.  
  266. forward SendAttackerToSpaceship(playerid);
  267. public SendAttackerToSpaceship(playerid)
  268. {
  269.     if(_Spaceship_PlayerPlays[playerid]==false)return true;
  270.     if(_Spaceship_Attacker_ONW[playerid]==true)return true;
  271.     _Spaceship_Attacker_ONW[playerid]=true;
  272.     _Spaceship_AttackerY[playerid]=-10;
  273.     _Spaceship_AttackerX[playerid]=Random(70,520);
  274.     TD_Spaceship_Attacker[playerid]=TextDrawCreate(_Spaceship_AttackerX[playerid],_Spaceship_AttackerY[playerid],"LD_NONE:ship2");
  275.     TextDrawFont(TD_Spaceship_Attacker[playerid],4);
  276.     TextDrawColor(TD_Spaceship_Attacker[playerid],0xFFFFFFFF);
  277.     TextDrawTextSize(TD_Spaceship_Attacker[playerid],50,50);
  278.     TextDrawShowForPlayer(playerid,TD_Spaceship_Attacker[playerid]);
  279.     SetTimerEx("SpaceshipAttackerMoving",50,false,"d",playerid);
  280.     return true;
  281. }
  282.  
  283. forward SpaceshipAttackerMoving(playerid);
  284. public SpaceshipAttackerMoving(playerid)
  285. {
  286.     if(_Spaceship_PlayerPlays[playerid]==false)return true;
  287.     if(_Spaceship_AttackerY[playerid]>480)
  288.     {
  289.         TextDrawHideForPlayer(playerid,TD_Spaceship_Attacker[playerid]);
  290.         _Spaceship_Attacker_ONW[playerid]=false;
  291.         SetTimerEx("SendAttackerToSpaceship",ATTACKER_DISTANCE*1000,false,"d",playerid);
  292.         return true;
  293.     }
  294.     if(_Spaceship_AttackerY[playerid]+50>360&&_Spaceship_AttackerY[playerid]<400)
  295.     {
  296.         if(_Spaceship_AttackerX[playerid]>=_Spaceship_Position[playerid]&&_Spaceship_AttackerX[playerid]<=_Spaceship_Position[playerid]+40||_Spaceship_AttackerX[playerid]+50>=_Spaceship_Position[playerid]&&_Spaceship_AttackerX[playerid]+50<=_Spaceship_Position[playerid]+40)
  297.         {
  298.             TextDrawHideForPlayer(playerid,TD_Spaceship_Attacker[playerid]);
  299.             _Spaceship_Attacker_ONW[playerid]=false;
  300.             _Spaceship_Health[playerid]-=25;
  301.             TextDrawDestroy(TD_Spaceship_Health[playerid]);
  302.             TD_Spaceship_Health[playerid]=TextDrawCreate(480,40,"LD_DUAL:power");
  303.             TextDrawFont(TD_Spaceship_Health[playerid],4);
  304.             TextDrawColor(TD_Spaceship_Health[playerid],0xFFFFFFFF);
  305.             TextDrawTextSize(TD_Spaceship_Health[playerid],_Spaceship_Health[playerid],5);
  306.             TextDrawShowForPlayer(playerid,TD_Spaceship_Health[playerid]);
  307.             CreateSpaceshipExplosion(playerid);
  308.             if(_Spaceship_Health[playerid]<=0)
  309.             {
  310.                 PlayerLooseSpaceship(playerid);
  311.                 return true;
  312.             }
  313.             SetTimerEx("SendAttackerToSpaceship",ATTACKER_DISTANCE*1000,false,"d",playerid);
  314.             return true;
  315.         }
  316.     }
  317.     TextDrawDestroy(TD_Spaceship_Attacker[playerid]);
  318.     TD_Spaceship_Attacker[playerid]=TextDrawCreate(_Spaceship_AttackerX[playerid],_Spaceship_AttackerY[playerid],"LD_NONE:ship2");
  319.     TextDrawFont(TD_Spaceship_Attacker[playerid],4);
  320.     TextDrawColor(TD_Spaceship_Attacker[playerid],0xFFFFFFFF);
  321.     TextDrawTextSize(TD_Spaceship_Attacker[playerid],50,50);
  322.     TextDrawShowForPlayer(playerid,TD_Spaceship_Attacker[playerid]);
  323.     _Spaceship_AttackerY[playerid]+=ATTACKER_SPEED/2;
  324.     SetTimerEx("SpaceshipAttackerMoving",50,false,"d",playerid);
  325.     return true;
  326. }
  327.  
  328. forward ExplodeSpaceshipAnimation(playerid);
  329. public ExplodeSpaceshipAnimation(playerid)
  330. {
  331.     if(_Spaceship_PlayerPlays[playerid]==false)return true;
  332.     TextDrawDestroy(TD_Spaceship_Explosion[playerid]);
  333.     if(_Spaceship_Explosion[playerid]==3)TD_Spaceship_Explosion[playerid]=TextDrawCreate(_Spaceship_Position[playerid],360,"LD_DUAL:ex2");
  334.     else if(_Spaceship_Explosion[playerid]==2)TD_Spaceship_Explosion[playerid]=TextDrawCreate(_Spaceship_Position[playerid],360,"LD_DUAL:ex3");
  335.     else if(_Spaceship_Explosion[playerid]==1)TD_Spaceship_Explosion[playerid]=TextDrawCreate(_Spaceship_Position[playerid],360,"LD_DUAL:ex4");
  336.     else if(_Spaceship_Explosion[playerid]==0)
  337.     {
  338.         _Spaceship_PlayerExplode[playerid]=false;
  339.         TextDrawDestroy(TD_Spaceship_Explosion[playerid]);
  340.         return true;
  341.     }
  342.     SetTimerEx("ExplodeSpaceshipAnimation",75,false,"d",playerid);
  343.     TextDrawFont(TD_Spaceship_Explosion[playerid],4);
  344.     TextDrawColor(TD_Spaceship_Explosion[playerid],0xFFFFFFFF);
  345.     TextDrawTextSize(TD_Spaceship_Explosion[playerid],40,40);
  346.     TextDrawShowForPlayer(playerid,TD_Spaceship_Explosion[playerid]);
  347.     _Spaceship_Explosion[playerid]--;
  348.     return true;
  349. }
  350.  
  351. forward HideSpaceshipGame(playerid);
  352. public HideSpaceshipGame(playerid)
  353. {
  354.     TextDrawHideForPlayer(playerid,TD_Spaceship_Background);
  355.     TextDrawHideForPlayer(playerid,TD_Spaceship_CornerTopLeft);
  356.     TextDrawHideForPlayer(playerid,TD_Spaceship_CornerTopRight);
  357.     TextDrawHideForPlayer(playerid,TD_Spaceship_CornerBottomLeft);
  358.     TextDrawHideForPlayer(playerid,TD_Spaceship_CornerBottomRight);
  359.     TextDrawDestroy(TD_Spaceship[playerid]);
  360.     TextDrawDestroy(TD_Spaceship_Fuel[playerid]);
  361.     TextDrawDestroy(TD_Spaceship_Health[playerid]);
  362.     if(_Spaceship_Bonus_ONW[playerid]==true)TextDrawDestroy(TD_Spaceship_Bonus[playerid]);
  363.     if(_Spaceship_Attacker_ONW[playerid]==true)TextDrawDestroy(TD_Spaceship_Attacker[playerid]);
  364.     _Spaceship_Position[playerid]=300;
  365.     _Spaceship_Health[playerid]=100;
  366.     _Spaceship_Fuel[playerid]=100.0;
  367.     _Spaceship_BonusY[playerid]=-10;
  368.     _Spaceship_AttackerY[playerid]=-10;
  369.     _Spaceship_PlayerLoosed[playerid]=false;
  370.     _Spaceship_PlayerPlays[playerid]=false;
  371.     _Spaceship_PlayerExplode[playerid]=false;
  372.     _Spaceship_Bonus_ONW[playerid]=false;
  373.     _Spaceship_Attacker_ONW[playerid]=false;
  374.     TogglePlayerControllable(playerid,true);
  375.     return true;
  376. }
  377.  
  378. //____________________________________________________________________Function's
  379. CreateSpaceshipExplosion(playerid)
  380. {
  381.     if(_Spaceship_PlayerPlays[playerid]==false)return true;
  382.     if(_Spaceship_PlayerExplode[playerid]==true)return true;
  383.     _Spaceship_PlayerExplode[playerid]=true;
  384.     TD_Spaceship_Explosion[playerid]=TextDrawCreate(_Spaceship_Position[playerid],360,"LD_DUAL:ex1");
  385.     TextDrawFont(TD_Spaceship_Explosion[playerid],4);
  386.     TextDrawColor(TD_Spaceship_Explosion[playerid],0xFFFFFFFF);
  387.     TextDrawTextSize(TD_Spaceship_Explosion[playerid],40,40);
  388.     TextDrawShowForPlayer(playerid,TD_Spaceship_Explosion[playerid]);
  389.     _Spaceship_Explosion[playerid]=3;
  390.     SetTimerEx("ExplodeSpaceshipAnimation",100,false,"d",playerid);
  391.     return true;
  392. }
  393.  
  394. PlayerLooseSpaceship(playerid)
  395. {
  396.     GameTextForPlayer(playerid,"~r~Game Over",3000,3);
  397.     _Spaceship_PlayerLoosed[playerid]=true;
  398.     TextDrawHideForPlayer(playerid,TD_Spaceship[playerid]);
  399.     TextDrawHideForPlayer(playerid,TD_Spaceship_Fuel[playerid]);
  400.     TextDrawHideForPlayer(playerid,TD_Spaceship_Health[playerid]);
  401.     TextDrawHideForPlayer(playerid,TD_Spaceship_Bonus[playerid]);
  402.     TextDrawHideForPlayer(playerid,TD_Spaceship_Attacker[playerid]);
  403.     SetTimerEx("HideSpaceshipGame",3000,false,"d",playerid);
  404.     return true;
  405. }
  406.  
  407. stock Random(min,max)
  408. {
  409.     new a=random(max-min)+min;
  410.     return a;
  411. }
  412.  
RAW Paste Data