Advertisement
CamerDisco

Untitled

Jun 20th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdkhooks>
  3. #include <sdktools>
  4. #include <cstrike>
  5. #include <codmod>
  6.  
  7. new const String:nazwa[] = "Chorąży [OD 200LVL]";
  8. new const String:opis[] = "Bardzo szybki, mag7 i tec9 po +10DMG(+int)";
  9. new const String:bronie[] = "#weapon_mag7#weapon_tec9";
  10. new const inteligencja = 5;
  11. new const zdrowie = 10;
  12. new const obrazenia = 0;
  13. new const wytrzymalosc = 20;
  14. new const kondycja = 65;
  15.  
  16. bool ma_klase[MAXPLAYERS + 1];
  17.  
  18. public OnPluginStart()
  19. {
  20. CreateConVar(nazwa, "1.0", "Linux`");
  21. CreateTimer(0.3, zaladuj);
  22. }
  23.  
  24. public Action zaladuj(Handle timer)
  25. {
  26. cod_register_class(nazwa, opis, bronie, inteligencja, zdrowie, obrazenia, wytrzymalosc, kondycja);
  27. }
  28.  
  29. public cod_class_enabled(client)
  30. {
  31. new bool:ma_poziom = false;
  32. new poziom_dozwolony = 200;
  33. for(new i = 1; i <= cod_get_classes_num(); i ++)
  34. {
  35. if(cod_get_user_level(client, i) >= poziom_dozwolony)
  36. {
  37. ma_poziom = true;
  38. break;
  39. }
  40. }
  41. if(ma_poziom)
  42. {
  43. ma_klase[client] = true;
  44. }
  45. else
  46. {
  47. if(cod_get_user_class(client))
  48. cod_set_user_class(client, 0, 1);
  49.  
  50. if(cod_get_user_item(client))
  51. cod_set_user_item(client, 0, 0, 0);
  52.  
  53. CPrintToChat(client, "[COD:MW]{RED} Wybrana klasa dostepna jeśli na którejś klasie masz conajmniej %i Lvl!", poziom_dozwolony);
  54. }
  55. }
  56. public cod_class_disabled(client)
  57. {
  58. ma_klase[client] = false;
  59. }
  60.  
  61. public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
  62. {
  63. if(!IsValidClient(victim) || !IsValidClient(attacker))
  64. return Plugin_Continue;
  65.  
  66. if(GetClientTeam(victim) == GetClientTeam(attacker))
  67. return Plugin_Continue;
  68.  
  69. if(!ma_klase[attacker])
  70. return Plugin_Continue;
  71.  
  72. if(cod_get_user_item(victim) == cod_get_itemid("Betonowa Głowa") && damagetype & CS_DMG_HEADSHOT)
  73. return Plugin_Continue;
  74.  
  75. if(odporny(victim))
  76. return Plugin_Handled;
  77.  
  78. if(damagetype & DMG_BULLET)
  79. {
  80. int obrazenia_gracza = 10+RoundToZero((cod_get_user_intelligence(attacker, 1, 1, 1)*0.5));
  81. cod_inflict_damage(victim, attacker, 0, obrazenia_gracza);
  82. }
  83.  
  84. return Plugin_Changed;
  85. }
  86.  
  87.  
  88. public OnClientPutInServer(client)
  89. {
  90. SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  91. }
  92.  
  93. public OnClientDisconnect(client)
  94. {
  95. SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement