Syphon

Release your plugins here!
User avatar
Kami
Global Moderator
Posts: 263
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Syphon

Postby Kami » Tue Aug 28, 2012 2:19 pm

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 -
Attachments
syphon.zip
(1.04 KiB) Downloaded 514 times
Zawmbee
Junior Member
Posts: 4
Joined: Tue Jul 30, 2013 4:19 am

Postby Zawmbee » Tue Jul 30, 2013 4:41 am

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)
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Tue Jul 30, 2013 6:28 am

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
wtfaatp
Junior Member
Posts: 8
Joined: Fri Jan 31, 2014 1:53 pm

Re: Syphon

Postby wtfaatp » Tue Aug 18, 2020 4:57 pm

Cause ya know.. Necro and hoping for an update.
rautamiekka
Junior Member
Posts: 11
Joined: Mon Feb 15, 2016 6:53 pm
Location: Ulvila, Finland
Contact:

Re: Syphon

Postby rautamiekka » Tue Aug 18, 2020 5:00 pm

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.
User avatar
Kami
Global Moderator
Posts: 263
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Re: Syphon

Postby Kami » Tue Aug 18, 2020 8:40 pm

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
wtfaatp
Junior Member
Posts: 8
Joined: Fri Jan 31, 2014 1:53 pm

Re: Syphon

Postby wtfaatp » Fri Aug 21, 2020 8:01 am

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)
User avatar
Kami
Global Moderator
Posts: 263
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Re: Syphon

Postby Kami » Fri Aug 21, 2020 10:47 am

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

Return to “Plugin Releases”

Who is online

Users browsing this forum: No registered users and 24 guests