• Print

Author Topic: Help with a if teamkill code  (Read 13465 times)

0 Members and 1 Guest are viewing this topic.

Offline [?] The Last Centurion

  • Newbie
  • *
  • Posts: 23
  • Karma: 2
Re: Help with a if teamkill code
« Reply #15 on: July 29, 2016, 10:31:59 pm »
Thanks, I'll test it as soon as I figure out how to unban myself because apparently I can't. I've tried unbanning myself via "ulx unban (steamid)" so yeah, i have to wait 40 minutes.

Offline .gdraw

  • Newbie
  • *
  • Posts: 27
  • Karma: 1
    • Steam
Re: Help with a if teamkill code
« Reply #16 on: July 29, 2016, 10:44:23 pm »
I can't edit my posts even though I'm signed in with steam.

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Help with a if teamkill code
« Reply #17 on: July 29, 2016, 11:15:27 pm »
Those are two different names. Did you make a new account?
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline [?] The Last Centurion

  • Newbie
  • *
  • Posts: 23
  • Karma: 2
Re: Help with a if teamkill code
« Reply #18 on: July 29, 2016, 11:29:28 pm »
Those are two different names. Did you make a new account?

Yep, but I just clicked login so here I am, anyway, I think it works, but I will have to see when I get players on.

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Help with a if teamkill code
« Reply #19 on: August 02, 2016, 12:06:45 am »
Code: Lua
  1. function tttTeamKill( victim, inflictor, attacker )
  2.         if not attacker:GetRole() == ROLE_INNOCENT then return end
  3.         if victim:GetRole() == ROLE_INNOCENT or victim:GetRole() == ROLE_DETECTIVE then
  4.                 awarn_warnplayer( nil, attacker, "Autowarned for RDM" )
  5.         end
  6. end
  7. hook.Add( "PlayerDeath", "Warn On RDM", tttTeamKill )
  8.  

This should work. Try it out.

I have another question about this, is there a place to find the other "awarn_" functions?
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Help with a if teamkill code
« Reply #20 on: August 02, 2016, 01:05:20 am »
I have another question about this, is there a place to find the other "awarn_" functions?

Search through AWarn's code?
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Help with a if teamkill code
« Reply #21 on: August 02, 2016, 05:52:13 am »
Search through AWarn's code?
I've not looked, but also perhaps in the Awarn release first post, or it's readme file that usually contains instructions?
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Help with a if teamkill code
« Reply #22 on: August 02, 2016, 07:52:27 pm »
I didn't develop AWarn as an API, so you'll have to look through the code to get the functions if you want to call them directly.

  • Print