Page 1 of 1

Syphon

Posted: Tue Aug 28, 2012 2:19 pm
by Kami
Hello guys, this is a advanced remake of Matties Syphon addon.

It includes:

- Three Syphon modes: Health, Speed, Armor, Money(You can choose which one you want to use)

- Weapon Config (So you can choose which weapons should syphon on kill)

- Config for amount of health, armor or speed you get

The attachment syphon.zip is no longer available


Edit: Added Syphon Money to provide MugMod functionality

- Kami -

Posted: Tue Jul 30, 2013 4:41 am
by Zawmbee
Hey, new here and just trying to figure out how to use SourcePython so I can code for CSGO. Anyways, was looking at your code to learn a bit and found just a small error with just one line that needs to be updating:

if 1 in syphon_mode:

Code: Select all

            Chat(index, '[Syphon] You gained %s health!' % (syphon_health))
            health = player.GetPropInt("CBasePlayer.m_iHealth")
            health + 40
            player.SetPropInt("CBasePlayer.m_iHealth", health + syphon_health)



Changed the + 40 to syphon_health below:
if 1 in syphon_mode:

Code: Select all

            Chat(index, '[Syphon] You gained %s health!' % (syphon_health))
            health = player.GetPropInt("CBasePlayer.m_iHealth")
            health + syphon_health
            player.SetPropInt("CBasePlayer.m_iHealth", health + syphon_health)

Posted: Tue Jul 30, 2013 6:28 am
by satoon101
Actually, that isn't even correct. Also there have been many changes since this script was released:
http://www.sourcepython.com/showthread.php?274-An-update

This script will not work with the current version of SP. We are still in Alpha, so expect this to be the case for the time being.

Satoon

Re: Syphon

Posted: Tue Aug 18, 2020 4:57 pm
by wtfaatp
Cause ya know.. Necro and hoping for an update.

Re: Syphon

Posted: Tue Aug 18, 2020 5:00 pm
by rautamiekka
wtfaatp wrote:Cause ya know.. Necro and hoping for an update.

You need to loosen up that tight hat. This is a Plugin Forum, and someone said something false, therefore necro doesn't exist.

Plus the concept of anti-necro is stupid as it is.

Re: Syphon

Posted: Tue Aug 18, 2020 8:40 pm
by Kami
Hey, I did some quick updates to make this work with the newest version of SourcePython, I hope this helps :)

Syntax: Select all

# =============================================================================
# >> IMPORTS
# =============================================================================

from players.entity import Player
from events import Event
from messages import SayText2

# =============================================================================
# >> CONFIG
# =============================================================================

syphon_announce = 1
# syphon modes: //1: health //2: speed //3: armor //4: money //you can choose different modes together, like [1,3] or [1,2,3]

syphon_mode = [1, 2, 3, 4]

#you can add as many weapons as you want. Example: syphon_weapon = ['knife', 'glock', 'awp']

syphon_weapon = ['knife']

syphon_health = 40

syphon_speed = 10

syphon_armor = 50

syphon_money = 5000


# =============================================================================
# >> GAME EVENTS
# =============================================================================

@Event('round_start')
def round_start(ev):
if syphon_announce == 1:
SayText2('\x04[Syphon] \x03Kill enemys with your \x04knife \x03to gain rewards!').send()

@Event('player_death')
def player_death(ev):
attacker = int(ev['attacker'])
player = Player.from_userid(attacker)
if ev['weapon'] in syphon_weapon:
if 1 in syphon_mode:
SayText2('\x04[Syphon] \x03You gained \x04%s \x03health!' % (syphon_health)).send(player.index)
player.health += syphon_health
if 2 in syphon_mode:
SayText2('\x04[Syphon] \x03You gained \x04%s \x03percent speed!' % (syphon_speed)).send(player.index)
speed_add = syphon_speed / 100
player.speed += speed_add
if 3 in syphon_mode:
SayText2('\x04[Syphon] \x03You gained \x04%s \x03armor!' % (syphon_armor)).send(player.index)
player.armor += syphon_armor
if 4 in syphon_mode:
SayText2('\x04[Syphon] \x03You gained \x04%s \x03money!' % (syphon_money)).send(player.index)
player.cash += syphon_money

Re: Syphon

Posted: Fri Aug 21, 2020 8:01 am
by wtfaatp
Kami wrote:Hey, I did some quick updates to make this work with the newest version of SourcePython, I hope this helps :)

Syntax: Select all

# =============================================================================
# >> IMPORTS
# =============================================================================

from players.entity import Player
from events import Event
from messages import SayText2

# =============================================================================
# >> CONFIG
# =============================================================================

syphon_announce = 1
# syphon modes: //1: health //2: speed //3: armor //4: money //you can choose different modes together, like [1,3] or [1,2,3]

syphon_mode = [1, 2, 3, 4]

#you can add as many weapons as you want. Example: syphon_weapon = ['knife', 'glock', 'awp']

syphon_weapon = ['knife']

syphon_health = 40

syphon_speed = 10

syphon_armor = 50

syphon_money = 5000


# =============================================================================
# >> GAME EVENTS
# =============================================================================

@Event('round_start')
def round_start(ev):
if syphon_announce == 1:
SayText2('\x04[Syphon] \x03Kill enemys with your \x04knife \x03to gain rewards!').send()

@Event('player_death')
def player_death(ev):
attacker = int(ev['attacker'])
player = Player.from_userid(attacker)
if ev['weapon'] in syphon_weapon:
if 1 in syphon_mode:
SayText2('\x04[Syphon] \x03You gained \x04%s \x03health!' % (syphon_health)).send(player.index)
player.health += syphon_health
if 2 in syphon_mode:
SayText2('\x04[Syphon] \x03You gained \x04%s \x03percent speed!' % (syphon_speed)).send(player.index)
speed_add = syphon_speed / 100
player.speed += speed_add
if 3 in syphon_mode:
SayText2('\x04[Syphon] \x03You gained \x04%s \x03armor!' % (syphon_armor)).send(player.index)
player.armor += syphon_armor
if 4 in syphon_mode:
SayText2('\x04[Syphon] \x03You gained \x04%s \x03money!' % (syphon_money)).send(player.index)
player.cash += syphon_money


Are we able to set max health ie can't syphon past 100



//EDIT:
Just wanna make sure this would not cause any issues!

Syntax: Select all

@Event('player_death')
def player_death(ev):
attacker = int(ev['attacker'])
player = Player.from_userid(attacker)
if ev['weapon'] in syphon_weapon:
if (player.health + syphon_health > syphon_max_health):
player.health = syphon_max_health
SayText2('\x04[Syphon] \x03Your health was set to \x04The Mamimum' ).send(player.index)
else:
player.health += syphon_health
SayText2('\x04[Syphon] \x03You gained \x04%s \x03health!' % (syphon_health)).send(player.index)

Re: Syphon

Posted: Fri Aug 21, 2020 10:47 am
by Kami
You were really close!

I also added a maximum check for armor, as it has the same problem as health.

Syntax: Select all

# =============================================================================
# >> IMPORTS
# =============================================================================

from players.entity import Player
from events import Event
from messages import SayText2
from filters.players import PlayerIter

# =============================================================================
# >> CONFIG
# =============================================================================

syphon_announce = 1
# syphon modes: //1: health //2: speed //3: armor //4: money //you can choose different modes together, like [1,3] or [1,2,3]

syphon_mode = [1, 2, 3, 4]

#you can add as many weapons as you want. Example: syphon_weapon = ['knife', 'glock', 'awp']

syphon_weapon = ['knife']

syphon_health = 40

syphon_max_health = 250

syphon_speed = 10

syphon_armor = 20

syphon_max_armor = 120

syphon_money = 5000

# =============================================================================
# >> GAME EVENTS
# =============================================================================

@Event('round_start')
def round_start(ev):
if syphon_announce == 1:
SayText2('\x04[Syphon] \x03Kill enemys with your \x04knife \x03to gain rewards!').send()

@Event('player_death')
def player_death(ev):
attacker = int(ev['attacker'])
player = Player.from_userid(attacker)
if ev['weapon'] in syphon_weapon:
if 1 in syphon_mode:
if (player.health + syphon_health >= syphon_max_health):
player.health = syphon_max_health
SayText2('\x04[Syphon] \x03Your health was set to \x04The Maximum' ).send(player.index)
else:
player.health += syphon_health
SayText2('\x04[Syphon] \x03You gained \x04%s \x03health!' % (syphon_health)).send(player.index)
if 2 in syphon_mode:
SayText2('\x04[Syphon] \x03You gained \x04%s \x03percent speed!' % (syphon_speed)).send(player.index)
speed_add = syphon_speed / 100
player.speed += speed_add
if 3 in syphon_mode:
if (player.armor + syphon_armor >= syphon_max_armor):
player.armor = syphon_max_armor
SayText2('\x04[Syphon] \x03Your armor was set to \x04The Maximum' ).send(player.index)
else:
player.armor += syphon_armor
SayText2('\x04[Syphon] \x03You gained \x04%s \x03armor!' % (syphon_armor)).send(player.index)
if 4 in syphon_mode:
SayText2('\x04[Syphon] \x03You gained \x04%s \x03money!' % (syphon_money)).send(player.index)
player.cash += syphon_money