SHARE
TWEET

Sandra

a guest Feb 22nd, 2008 201 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. =======================
  3. This Include Is Made By
  4. =======>Sandra<========
  5. =======================
  6. */
  7.  
  8. #include <a_samp>
  9.  
  10. //Countdown
  11. new IsCountdownStarted;
  12. new IsPlayerCountdownStarted[MAX_PLAYERS];
  13. new PlayerCountdownCount[MAX_PLAYERS];
  14. new CountdownCount;
  15. new PlayerCountdownTimer[MAX_PLAYERS];
  16. new CountdownTimer;
  17.  
  18. //PocketMoney:
  19. new IsPocketMoneyEnabled;
  20. new IsPocketMoneyMessageEnabled = 1;
  21. new PocketMoneyAmount;
  22. new PocketMoneyTimer;
  23.  
  24. enum resprayinfo
  25. {
  26.         Float:ResprayX,
  27.         Float:ResprayY,
  28.         Float:ResprayZ,
  29.         Float:ResprayA
  30. }
  31. new ResprayInfo[MAX_VEHICLES][resprayinfo];
  32. enum splayerinfo
  33. {
  34.         Float:SavedX,
  35.         Float:SavedY,
  36.         Float:SavedZ,
  37.         Float:SavedA,
  38.         SavedInterior
  39. }
  40. new SPlayerInfo[MAX_PLAYERS][splayerinfo];
  41.  
  42. /*
  43. native ======CountDown================();
  44. native CreateCountdown(time, sound);
  45. native CreatePlayerCountdown(playerid, time, sound);
  46. native StopCountdown();
  47. native StopPlayerCountdown(playerid);
  48. native ======PocketMoney==============();
  49. native EnablePocketMoney(amount, frequency);
  50. native DisablePocketMoney();
  51. native SetPocketMoneyAmount(amount);
  52. native SetPocketMoneyFrequency(frequency);
  53. native TogglePocketMoneyMessage(toggle);
  54. native ======Other====================();
  55. native SkydivePlayer(playerid, hight);
  56. native Cardive(carid, hight);
  57. native FlipCar(carid);
  58. native ResprayCar(carid);
  59. native SavePlayerPos(playerid);
  60. native LoadPlayerPos(playerid);
  61. */
  62.  
  63.  
  64. stock CreateCountdown(time, sound)
  65. {
  66.         if(IsCountdownStarted == 0)
  67.         {
  68.             for(new i; i<MAX_PLAYERS; i++)
  69.             {
  70.                 if(IsPlayerConnected(i))
  71.                 {
  72.                         if(IsPlayerCountdownStarted[i] == 1)
  73.                         {
  74.                             KillTimer(PlayerCountdownTimer[i]);
  75.                             PlayerCountdownCount[i] = 0;
  76.                             IsPlayerCountdownStarted[i] = 0;
  77.                                 }
  78.                         }
  79.                 }
  80.                 CountdownTimer = SetTimerEx("Countdown", 1000, 1, "d", sound);
  81.                 CountdownCount = time;
  82.                 IsCountdownStarted = 1;
  83.         }
  84. }
  85. stock CreatePlayerCountdown(playerid, time, sound)
  86. {
  87.         if(IsPlayerCountdownStarted[playerid] == 0 && IsCountdownStarted == 0)
  88.         {
  89.                 PlayerCountdownTimer[playerid] = SetTimerEx("PlayerCountdown", 1000, 1, "id", playerid, sound);
  90.                 PlayerCountdownCount[playerid] = time;
  91.                 IsPlayerCountdownStarted[playerid] = 1;
  92.         }
  93. }
  94. stock StopCountdown()
  95. {
  96.         KillTimer(CountdownTimer);
  97.         GameTextForAll(" ", 10, 3);
  98.     CountdownCount = 0;
  99.     IsCountdownStarted = 0;
  100. }
  101. stock StopPlayerCountdown(playerid)
  102. {
  103.         KillTimer(PlayerCountdownTimer[playerid]);
  104.         GameTextForPlayer(playerid, " ", 10, 3);
  105.     PlayerCountdownCount[playerid] = 0;
  106.     IsPlayerCountdownStarted[playerid] = 0;
  107. }
  108.  
  109. stock EnablePocketMoney(amount, frequency)
  110. {
  111.         if(IsPocketMoneyEnabled==0)
  112.         {
  113.             PocketMoneyTimer = SetTimer("PocketMoney", (frequency*1000), 1);
  114.             IsPocketMoneyEnabled = 1;
  115.             PocketMoneyAmount = amount;
  116.  
  117.         }
  118. }
  119. stock DisablePocketMoney()
  120. {
  121.         if(IsPocketMoneyEnabled==1)
  122.         {
  123.             KillTimer(PocketMoneyTimer);
  124.             IsPocketMoneyEnabled = 0;
  125.     }
  126. }
  127. stock SetPocketMoneyAmount(amount)
  128. {
  129.     PocketMoneyAmount = amount;
  130. }
  131.  
  132. stock SetPocketMoneyFrequency(frequency)
  133. {
  134.         KillTimer(PocketMoneyTimer);
  135.         PocketMoneyTimer = SetTimer("PocketMoney", (frequency*1000), 1);
  136. }
  137.  
  138. stock TogglePocketMoneyMessage(toggle)
  139. {
  140.     IsPocketMoneyMessageEnabled = toggle;
  141. }
  142.  
  143. stock SkydivePlayer(playerid, hight)
  144. {
  145.         new Float:SDX, Float:SDY, Float:SDZ;
  146.         GetPlayerPos(playerid, SDX, SDY, SDZ);
  147.         GivePlayerWeapon(playerid, 46, 1);
  148.         SetPlayerPos(playerid, SDX, SDY, (SDZ+hight));
  149. }
  150. stock Cardive(carid, hight)
  151. {
  152.         new Float:SDX, Float:SDY, Float:SDZ;
  153.         GetVehiclePos(carid, SDX, SDY, SDZ);
  154.         SetVehiclePos(carid, SDX, SDY, (SDZ+hight));
  155. }
  156. stock FlipCar(carid)
  157. {
  158.         new Float:FCX, Float:FCY, Float:FCZ, Float:FCA;
  159.         GetVehiclePos(carid, FCX, FCY, FCZ);
  160.         GetVehicleZAngle(carid, FCA);
  161.         SetVehiclePos(carid, FCX, FCY, (FCZ+1.0));
  162.         SetVehicleZAngle(carid, FCA);
  163. }
  164. stock ResprayCar(carid)
  165. {
  166.         GetVehiclePos(carid, ResprayInfo[carid][ResprayX], ResprayInfo[carid][ResprayY], ResprayInfo[carid][ResprayZ]);
  167.         GetVehicleZAngle(carid, ResprayInfo[carid][ResprayA]);
  168.         SetTimerEx("ResprayDone", 4000, 0, "i", carid);
  169.         SetVehiclePos(carid, 1024.8990,-1024.7573,31.7264);
  170.         SetVehicleZAngle(carid, 0);
  171. }
  172.  
  173. stock SavePlayerPos(playerid)
  174. {
  175.         GetPlayerPos(playerid, SPlayerInfo[playerid][SavedX], SPlayerInfo[playerid][SavedY], SPlayerInfo[playerid][SavedZ]);
  176.         GetPlayerFacingAngle(playerid, SPlayerInfo[playerid][SavedA]);
  177.         SPlayerInfo[playerid][SavedInterior] = GetPlayerInterior(playerid);
  178. }
  179. stock LoadPlayerPos(playerid)
  180. {
  181.     SetPlayerInterior(playerid, SPlayerInfo[playerid][SavedInterior]);
  182.         SetPlayerPos(playerid, SPlayerInfo[playerid][SavedX], SPlayerInfo[playerid][SavedY], SPlayerInfo[playerid][SavedZ]);
  183.         SetPlayerFacingAngle(playerid, SPlayerInfo[playerid][SavedA]);
  184. }
  185.  
  186. forward Countdown(sound);
  187. public Countdown(sound)
  188. {
  189.     if(CountdownCount == 0)
  190.         {
  191.             if(sound == 1)
  192.                 {
  193.                     for(new i; i<MAX_PLAYERS; i++)
  194.                     {
  195.                         if(IsPlayerConnected(i))
  196.                         {
  197.                             PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  198.                                 }
  199.                         }
  200.                 }
  201.             GameTextForAll("~r~GoGoGo", 2000, 3);
  202.             KillTimer(CountdownTimer);
  203.             IsCountdownStarted = 0;
  204.         }
  205.         else
  206.         {
  207.             if(sound == 1)
  208.                 {
  209.                     for(new i; i<MAX_PLAYERS; i++)
  210.                     {
  211.                         if(IsPlayerConnected(i))
  212.                         {
  213.                             PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  214.                                 }
  215.                         }
  216.                 }
  217.                 new cdstring[128];
  218.                 format(cdstring, sizeof(cdstring), "~y~%d", CountdownCount);
  219.                 GameTextForAll(cdstring, 1500, 3);
  220.                 CountdownCount--;
  221.         }
  222. }
  223.  
  224. forward PlayerCountdown(playerid, sound);
  225. public PlayerCountdown(playerid, sound)
  226. {
  227.     if(PlayerCountdownCount[playerid] == 0)
  228.         {
  229.             if(sound == 1) PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  230.             GameTextForPlayer(playerid,"~n~~n~~r~GoGoGo", 2000, 3);
  231.             KillTimer(PlayerCountdownTimer[playerid]);
  232.             IsPlayerCountdownStarted[playerid] = 0;
  233.         }
  234.         else
  235.         {
  236.             if(sound == 1) PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
  237.                 new pcdstring[128];
  238.             format(pcdstring, sizeof(pcdstring), "~n~~g~%d", PlayerCountdownCount[playerid]);
  239.                 GameTextForPlayer(playerid, pcdstring, 1500, 3);
  240.                 PlayerCountdownCount[playerid]--;
  241.         }
  242. }
  243.  
  244. forward PocketMoney();
  245. public PocketMoney()
  246. {
  247.     if(IsPocketMoneyMessageEnabled == 1)
  248.     {
  249.                 new pmstring[128];
  250.                 format(pmstring, sizeof(pmstring), "You received $%d,- pocketmoney!",PocketMoneyAmount);
  251.                 SendClientMessageToAll(0xFFFF66AA, pmstring);
  252.         }
  253.         for(new i; i<MAX_PLAYERS; i++)
  254.         {
  255.                 if(IsPlayerConnected(i))
  256.                 {
  257.                         GivePlayerMoney(i,  PocketMoneyAmount);
  258.                 }
  259.         }
  260. }
  261.  
  262. forward ResprayDone(carid);
  263. public ResprayDone(carid)
  264. {
  265.         SetVehiclePos(carid, ResprayInfo[carid][ResprayX], ResprayInfo[carid][ResprayY], ResprayInfo[carid][ResprayZ]);
  266.         SetVehicleZAngle(carid, ResprayInfo[carid][ResprayA]);
  267. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top