Guest User

Untitled

a guest
Dec 14th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdkhooks>
  3. #include <codmod>
  4.  
  5. new const String:nazwa[] = "Tajemnica Zabojcy";
  6. new const String:opis[] = "Posiadasz 1/LW szans na wyrzucenie broni przeciwnika";
  7.  
  8. new bool:ma_item[65],
  9. wartosc_itemu[65];
  10.  
  11. public Plugin:myinfo =
  12. {
  13. name = nazwa,
  14. author = "Linux`",
  15. description = "Cod Item",
  16. version = "1.0",
  17. url = "http://steamcommunity.com/id/linux2006"
  18. };
  19. public OnPluginStart()
  20. {
  21. cod_register_item(nazwa, opis, 3, 6);
  22. }
  23. public OnClientPutInServer(client)
  24. {
  25. SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  26. }
  27. public OnClientDisconnect(client)
  28. {
  29. SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  30. }
  31. public cod_item_enabled(client, wartosc)
  32. {
  33. ma_item[client] = true;
  34. wartosc_itemu[client] = wartosc;
  35. }
  36. public cod_item_disabled(client)
  37. {
  38. ma_item[client] = false;
  39. }
  40. public Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
  41. {
  42. if(!IsValidClient(attacker) || !ma_item[attacker])
  43. return Plugin_Continue;
  44.  
  45. if(!IsValidClient(client) || GetClientTeam(client) == GetClientTeam(attacker))
  46. return Plugin_Continue;
  47.  
  48. if(GetRandomInt(1, wartosc_itemu[attacker]) == 1)
  49. ClientCommand(client, "drop");
  50.  
  51. return Plugin_Continue;
  52. }
Add Comment
Please, Sign In to add comment