Guest User

DM FS

a guest
Nov 26th, 2011
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. //DMFS by JustLuca
  2.  
  3. #define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. forward SpawnShield(playerid);
  8.  
  9. #if defined FILTERSCRIPT
  10.  
  11. public OnFilterScriptInit()
  12. {
  13. print("\n--------------------------------------");
  14. print(" DM FilterScript LOADED by JustLuca");
  15. print("--------------------------------------\n");
  16. return 1;
  17. }
  18.  
  19. public OnFilterScriptExit()
  20. {
  21. return 1;
  22. }
  23. public OnPlayerConnect(playerid)
  24. {
  25. SendClientMessage(playerid, 0xFF0000FF, "This server use the DM Filterscript by JustLuca (Luca_Tanara).");
  26. return 1;
  27. }
  28.  
  29. public OnPlayerUpdate(playerid)
  30. {
  31. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
  32. {
  33. Ban(playerid);
  34. SendClientMessage(playerid, 0xFF0000FF, "Sorry, you can't use Jetpack here. [BANNED]");
  35. }
  36. return 1;
  37. }
  38.  
  39. public OnPlayerSpawn(playerid)
  40. {
  41. SetTimerEx("SpawnShield", 5000, false,"i");
  42. SetPlayerHealth(playerid, 9999);
  43. SendClientMessage(playerid, 0xFF0000FF, "You are immortal for 5 second, you have the spawn shield.");
  44. return 1;
  45. }
  46.  
  47. public SpawnShield(playerid)
  48. {
  49. SendClientMessage(playerid, 0xFF0000FF, "Your spawn shield is finish. Now you are not more immortal.");
  50. SetPlayerHealth(playerid, 100);
  51. PlayerPlaySound(playerid, 1056, 0, 0, 0);
  52.  
  53. }
  54.  
  55. public OnPlayerCommandText(playerid, cmdtext[])
  56. {
  57. if (strcmp("/buygun", cmdtext, true, 6) == 0)
  58. {
  59. ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Select a gun","M4a1 5000$\r\nDesert Eagle 2000$\r\nDouble Colt 500$\r\nPump Shotgun 1500$","Select", "Cancel");
  60. return 1;
  61. }
  62. return 0;
  63. }
  64.  
  65. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  66. {
  67. if(dialogid == 1)
  68. {
  69. switch(dialogid)
  70. {
  71. case 1:
  72. {
  73. if(!response)
  74. {
  75. SendClientMessage(playerid, 0xFF0000FF, "You canceled the select of gun.");
  76. return 1;
  77. }
  78. switch(listitem)
  79. {
  80. case 0:
  81. {
  82. SendClientMessage(playerid, 0xFF0000FF, "You have bought a M4a1, you pay {00FF00}5000$");
  83. GivePlayerMoney(playerid, -5000); //Edit the price how you want
  84. GivePlayerWeapon(playerid, 31, 1000);
  85. }
  86. case 1:
  87. {
  88. SendClientMessage(playerid, 0xFF0000FF, "You have bought a Desert Eagle, you pay {00FF00}2000$");
  89. GivePlayerMoney(playerid, -2000); //Edit the price how you want.
  90. GivePlayerWeapon(playerid, 24, 1000);
  91. }
  92. case 2:
  93. {
  94. SendClientMessage(playerid, 0xFF0000FF, "You have bought a Double Colt, you pay {00FF00}500$");
  95. GivePlayerMoney(playerid, -500); //Edit the price how you want
  96. GivePlayerWeapon(playerid, 22, 1000);
  97. }
  98. case 3:
  99. {
  100. SendClientMessage(playerid, 0xFF0000FF, "You have bought a Pump Shotgun, you pay {00FF00}1500$");
  101. GivePlayerMoney(playerid, -1500); //Edit the price how you want
  102. GivePlayerWeapon(playerid, 25, 1000);
  103. }
  104. }
  105.  
  106. }
  107. }
  108. }
  109. return 0;
  110. }
  111. #endif
  112.  
Advertisement
Add Comment
Please, Sign In to add comment