Advertisement
Guest User

Untitled

a guest
Mar 5th, 2014
845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.69 KB | None | 0 0
  1. //////////////////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // trablon's RolePlay tazer system for cops //
  4. // Coder: trablon(Onur AKAN) //
  5. // Tester: Woods //
  6. // //
  7. // //
  8. // //
  9. // //
  10. /////////////////////////////////////////////////////////////////////////////////////////
  11. // DIPNOT: System haven't tested YET..
  12. // =========== [ include ] ============== //
  13. #include <a_samp>
  14. // =========== [ define ] ============== //
  15. #define FILTERSCRIPT
  16. // =========== [ pragma ] ============== //
  17. // =========== [ enum ] ============== //
  18. // =========== [ new ] ============== //
  19. new tazerout[MAX_PLAYERS];
  20. new tazerin[MAX_PLAYERS];
  21. // ============================================================= //
  22. #if defined FILTERSCRIPT
  23.  
  24. public OnFilterScriptInit()
  25. {
  26. print("\n--------------------------------------");
  27. print(" ...trablon tazer system loaded...");
  28. print("--------------------------------------\n");
  29. return 1;
  30. }
  31.  
  32. public OnFilterScriptExit()
  33. {
  34. print("\n--------------------------------------");
  35. print(" ...trablon tazer system unloaded...");
  36. print("--------------------------------------\n");
  37. return 1;
  38. }
  39.  
  40. #else
  41. #endif
  42. public OnPlayerConnect(playerid)
  43. {
  44. tazerout[playerid] = 0; tazerin[playerid] = 0;
  45. return 1;
  46. }
  47. public OnPlayerDisconnect(playerid)
  48. {
  49. tazerout[playerid] = 0; tazerin[playerid] = 0;
  50. return 1;
  51. }
  52. public OnPlayerCommandText(playerid, cmdtext[])
  53. {
  54. new cmd[256];
  55. if(strcmp(cmd, "/tazer", true) == 0)
  56. {
  57. // if(DIPNOT: If player is police condition here) != 1) return SendClientMessage(playerid,-1,"Only police-men can type this command.");
  58. if(tazerout[playerid] == 0)
  59. {
  60. GivePlayerWeapon(playerid, 23, 99999);
  61. SendClientMessage(playerid,-1,"You have successfuly take off your tazer weapon from your equipment belt.");
  62. tazerout[playerid] = 1;
  63. return 1;
  64. }
  65.  
  66. if(tazerin[playerid] == 1)
  67. {
  68. GivePlayerWeapon(playerid, 22, 150);
  69. SendClientMessage(playerid,-1,"You have successfuly take on your tazer weapon from your equipment belt.");
  70. tazerin[playerid] = 0;
  71. return 1;
  72. }
  73. return 1;
  74. }
  75.  
  76. return 0;
  77. }
  78. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  79. {
  80. if(issuerid != INVALID_PLAYER_ID)
  81. {
  82. new Float:armour, Float:health; GetPlayerArmour(playerid, armour); GetPlayerHealth(playerid, health);
  83. if(weaponid == 23)
  84. {
  85. if(IsPlayerInAnyVehicle(playerid))
  86. {
  87. return 1;
  88. }
  89. if(0 != 0 && 1 == GetPlayerSkin(issuerid))
  90. {
  91. new string[66];
  92. format(string, sizeof(string), "* You have been shocked by %s, you have %i time to gain power !",GameTextForPlayer(issuerid, string, 2500, 3),10);
  93. SendClientMessage(playerid,-1,string);
  94. format(string, sizeof(string), "* You have been shocked by %s, you have %i time to gain power !", GameTextForPlayer(playerid,string, 2500, 3),10);
  95. SendClientMessage(issuerid,-1,string);
  96. format(string, sizeof(string), "~r~%s", "BEEN SHOCKED"); GameTextForPlayer(playerid, string, 2500, 3); TogglePlayerControllable(playerid, 0);
  97. ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  98. SetTimerEx("uf",10*1000, false, "i", playerid);
  99. return 1;
  100. }
  101. else
  102. {
  103. new string[66];
  104. format(string, sizeof(string), "* You have been shocked by %s, you have %i time to gain power !", GetPlayerNameEx(issuerid),10); SendClientMessage(playerid,-1,string);
  105. format(string, sizeof(string), "* You have been shocked by %s, you have %i time to gain power !", GetPlayerNameEx(playerid),10); SendClientMessage(issuerid,-1,string);
  106. format(string, sizeof(string), "~r~%s", "BEENSHOCKED"); GameTextForPlayer(playerid, string, 2500, 3); TogglePlayerControllable(playerid, 0);
  107. ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); SetTimerEx("uf",10*1000, false, "i", playerid);
  108. return 1;
  109. }
  110. }
  111. }
  112. return 1;
  113. }
  114. //==================== [ stock ] =========================//
  115. stock GetPlayerNameEx(playerid)
  116. {
  117. new string[24];
  118. GetPlayerName(playerid,string,24);
  119. new str[24];
  120. strmid(str,string,0,strlen(string),24);
  121. for(new i = 0; i < MAX_PLAYER_NAME; i++)
  122. {
  123. if (str[i] == '_') str[i] = ' ';
  124. }
  125. return str;
  126. }
  127. // =========== [ forward ] ============== //
  128. // =========== [ END ] ============== //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement