Advertisement
Guest User

Untitled

a guest
Oct 7th, 2011
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.31 KB | None | 0 0
  1. #include <sdktools>
  2. #include <sourcemod>
  3. #include <colors>
  4.  
  5. #define MAX_FILE_LEN 256
  6.  
  7. public Plugin:myinfo =
  8. {
  9. name = "*~ Plugin DV ~*",
  10. author = "Delachambre",
  11. description = "Annonce la DV",
  12. version = "1.0",
  13. url = "http://vip-magnetik.fr/"
  14. }
  15.  
  16. public OnPluginStart()
  17. {
  18. HookEvent("player_death", Event_PlayerDeath);
  19.  
  20. RegConsoleCmd("sm_dv", Cmd_Dv);
  21. }
  22.  
  23. public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
  24. {
  25. new victim = GetClientOfUserId(GetEventInt(event, "userid"));
  26. if (GetClientTeam(victim) == 2)
  27. {
  28. decl Ts;
  29. for(new i=1; i < MaxClients; i++)
  30. {
  31. if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2)
  32. {
  33. Ts++;
  34. }
  35. }
  36. if (Ts == 1)
  37. {
  38. PrintCenterTextAll("==========> DERNIERE VOLONTEE <==========");
  39. {
  40. CPrintToChatAll("{red}======== DERNIERE VOLONTEE ========");
  41. CPrintToChatAll("{red}Le dernier T a accès a sa DV");
  42. CPrintToChatAll("{red}Il peut tapé !dv");
  43. CPrintToChatAll("{red}======== DERNIERE VOLONTEE ========");
  44. ServerCommand("sm_tsay pink => DV <=");
  45. }
  46. }
  47. }
  48. }
  49.  
  50. public Action:Cmd_Dv(client, args)
  51. {
  52. new Ts;
  53. for(new i=1; i <= GetMaxClients(); i++)
  54. {
  55. if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2)
  56. {
  57. Ts++;
  58. }
  59. }
  60. if ((GetClientTeam(client) == 2) && (IsPlayerAlive(client)) && (IsClientInGame(client)) && (Ts == 1))
  61. {
  62. new Handle:menu = CreateMenu(dvmenu);
  63. SetMenuTitle(menu, "Choisis ta DV :");
  64. AddMenuItem(menu, "Cut", "Combat de Cut");
  65. AddMenuItem(menu, "Roulette", "Roulette");
  66. AddMenuItem(menu, "Isoloir", "Isoloire");
  67. AddMenuItem(menu, "Planchepirate", "Planche pirate");
  68. AddMenuItem(menu, "Roulettechinoise", "Roulette chinoise");
  69. AddMenuItem(menu, "Cutaquatique", "Cut aquatique");
  70. DisplayMenu(menu, client, 15);
  71. }
  72. else
  73. {
  74. CPrintToChat(client, "{green}[JailMod] : {lightgreen}Vous n'avez pas accès a cette commande.");
  75. }
  76. }
  77.  
  78. public dvmenu(Handle:menu, MenuAction:action, client, param2)
  79. {
  80. if (action == MenuAction_Select)
  81. {
  82. new String:info[32];
  83. GetMenuItem(jail_menu, param2, info, sizeof(info));
  84.  
  85. for (new i = 1; i < MaxClients; i++)
  86. {
  87. if (StrEqual(info, "Cut"))
  88. {
  89. CPrintToChatAll("{green}[Dernière volontée] : {lightgreen}Le terroriste a choisis un combat de cut.");
  90. PrintCenterTextAll("=====> DV : CUT <=====");
  91.  
  92. new Float:origincut[3]
  93. origincut[0] = -2774.0
  94. origincut[1] = -1255.7
  95. origincut[2] = 128.0
  96.  
  97. if ((GetClientTeam(client) == 2) && IsPlayerAlive(client))
  98. {
  99. SetEntityHealth(client, 200);
  100. TeleportEntity(client, origincut, NULL_VECTOR, NULL_VECTOR);
  101. }
  102. TeleportEntity(i, origincut, NULL_VECTOR, NULL_VECTOR);
  103. SetEntityHealth(i, 200);
  104. }
  105.  
  106. if (StrEqual(info, "Roulette"))
  107. {
  108. CPrintToChatAll("{green}[Dernière volontée] : {lightgreen}Le terroriste a choisis une roulette normal.");
  109. PrintCenterTextAll("=====> DV : ROULETTE <=====");
  110.  
  111. new Float:originrou[3]
  112. originrou[0] = -337.7
  113. originrou[1] = 195.5
  114. originrou[2] = 128.0
  115.  
  116. if ((GetClientTeam(client) == 2) && (IsPlayerAlive(client)) && (IsClientInGame(client)))
  117. {
  118. GivePlayerItem(client, "weapon_deagle");
  119. SetEntityHealth(client, 100);
  120. TeleportEntity(client, originrou, NULL_VECTOR, NULL_VECTOR);
  121. }
  122.  
  123. TeleportEntity(i, originrou, NULL_VECTOR, NULL_VECTOR);
  124. GivePlayerItem(i, "weapon_deagle");
  125. SetEntityHealth(i, 100);
  126. }
  127.  
  128. if (StrEqual(info, "Isoloir"))
  129. {
  130. CPrintToChatAll("{green}[Dernière volontée] : {lightgreen}Le terroriste a choisis un isoloire.");
  131. PrintCenterTextAll("=====> DV : ISOLOIRE <=====");
  132. new Float:originiso[3]
  133.  
  134. originiso[0] = -1429.7
  135. originiso[1] = -723.7
  136. originiso[2] = 129.0
  137.  
  138. if ((GetClientTeam(client) == 2) && (IsPlayerAlive(client)) && (IsClientInGame(client)))
  139. {
  140. GivePlayerItem(client, "weapon_m249");
  141. SetEntityHealth(client, 400);
  142. TeleportEntity(client, originiso, NULL_VECTOR, NULL_VECTOR);
  143. }
  144. TeleportEntity(i, originiso, NULL_VECTOR, NULL_VECTOR);
  145. SetEntityHealth(i, 400);
  146. }
  147.  
  148. if (StrEqual(info, "Planchepirate"))
  149. {
  150. CPrintToChatAll("{green}[Dernière volontée] : {lightgreen}Le terroriste a choisis une planche pirate.");
  151. PrintCenterTextAll("=====> DV : PLANCHE PIRATE <=====");
  152.  
  153. new Float:origin[3]
  154. origin[0] = -285.8
  155. origin[1] = 2240.6
  156. origin[2] = 128.0
  157.  
  158. if ((GetClientTeam(client) == 2) && (IsPlayerAlive(client)) && (IsClientInGame(client)))
  159. {
  160. GivePlayerItem(client, "weapon_deagle");
  161. SetEntityHealth(client, 100);
  162. TeleportEntity(client, origin, NULL_VECTOR, NULL_VECTOR);
  163. }
  164.  
  165. TeleportEntity(i, origin, NULL_VECTOR, NULL_VECTOR);
  166. SetEntityHealth(i, 100);
  167. GivePlayerItem(i, "weapon_deagle");
  168. }
  169.  
  170. if (StrEqual(info, "Roulettechinoise"))
  171. {
  172. CPrintToChatAll("{green}[Dernière volontée] : {lightgreen}Le terroriste a choisis une roulette chinoise.");
  173. PrintCenterTextAll("=====> DV : ROULETTE CHINOISE <=====");
  174.  
  175. new Float:originchi[3]
  176. originchi[0] = -1193.1
  177. originchi[1] = 260.7
  178. originchi[2] = 264.0
  179.  
  180. if ((GetClientTeam(client) == 2) && (IsPlayerAlive(client)) && (IsClientInGame(client)))
  181. {
  182. GivePlayerItem(client, "weapon_deagle");
  183. SetEntityHealth(client, 100);
  184. TeleportEntity(client, originchi, NULL_VECTOR, NULL_VECTOR);
  185. }
  186. TeleportEntity(i, originchi, NULL_VECTOR, NULL_VECTOR);
  187. SetEntityHealth(i, 100);
  188. GivePlayerItem(i, "weapon_deagle");
  189. }
  190.  
  191. if (StrEqual(info, "Cutaquatique"))
  192. {
  193. CPrintToChatAll("{green}[Dernière volontée] : {lightgreen}Le terroriste a choisis un cut aquatique.");
  194. PrintCenterTextAll("=====> DV : CUT AQUATIQUE <=====");
  195. new Float:originaqua[3]
  196. originaqua[0] = -191.6
  197. originaqua[1] = 2527.0
  198. originaqua[2] = 274.3
  199. if ((GetClientTeam(client) == 2) && (IsPlayerAlive(client)) && (IsClientInGame(client)))
  200. {
  201. TeleportEntity(client, originaqua, NULL_VECTOR, NULL_VECTOR);
  202. }
  203. TeleportEntity(i, originaqua, NULL_VECTOR, NULL_VECTOR);
  204. }
  205. }
  206. }
  207. else if (action == MenuAction_End)
  208. {
  209. CloseHandle(menu);
  210. }
  211. }
  212.  
  213.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement