Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. public Action Event_PlayerDeath(Event hEvent, const char[] chName, bool bDontBroadcast)
  2. {
  3. int attacker = GetClientOfUserId(hEvent.GetInt("attacker"));
  4. int victim = GetClientOfUserId(hEvent.GetInt("userid"));
  5.  
  6. char weapon[64];
  7. GetEventString(hEvent, "weapon", weapon, sizeof(weapon));
  8. ReplaceString(weapon, sizeof(weapon), "weapon_", "");
  9.  
  10. if (IsPlayerVIP(attacker))
  11. {
  12. if (!IsValidClient(attacker))
  13. return;
  14.  
  15. if (GetClientTeam(attacker) != GetClientTeam(victim))
  16. {
  17. bool headshot = GetEventBool(hEvent, "headshot");
  18. int PieniadzeGracza = GetEntProp(attacker, Prop_Send, "m_iAccount");
  19. int HP = GetClientHealth(attacker);
  20.  
  21. if (headshot)
  22. {
  23. SetEntProp(attacker, Prop_Send, "m_iAccount", GetConVarInt(g_cvVipHeadShotPieniadze) + PieniadzeGracza);
  24. if (HP + GetConVarInt(g_cvVipHeadShotHP) > GetConVarInt(g_cvMaxHP))SetEntityHealth(attacker, GetConVarInt(g_cvMaxHP));
  25. if (HP + GetConVarInt(g_cvVipHeadShotHP) <= GetConVarInt(g_cvMaxHP))SetEntityHealth(attacker, HP + GetConVarInt(g_cvVipHeadShotHP));
  26. }
  27. else
  28. {
  29. SetEntProp(attacker, Prop_Send, "m_iAccount", GetConVarInt(g_cvVipKillPieniadze) + PieniadzeGracza);
  30. if (HP + GetConVarInt(g_cvVipKillHP) > GetConVarInt(g_cvMaxHP))SetEntityHealth(attacker, GetConVarInt(g_cvMaxHP));
  31. if (HP + GetConVarInt(g_cvVipKillHP) <= GetConVarInt(g_cvMaxHP))SetEntityHealth(attacker, HP + GetConVarInt(g_cvVipKillHP));
  32. }
  33.  
  34. if (StrContains(weapon, "knife", false) != -1 || StrContains(weapon, "bayonet", false) != -1)
  35. {
  36. SetEntProp(attacker, Prop_Send, "m_iAccount", GetConVarInt(g_cvVipKillKnifePieniadze) + PieniadzeGracza);
  37. if (GetConVarBool(g_cvWiadomosciChat))
  38. PrintToChat(attacker, "%s Jako VIP otrzymałeś %i punktów za zabójstwo z noża", VIP_PREFIX);
  39. }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement