Plugins converts from Eventscripts to Source Python

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
Killer0561
Junior Member
Posts: 23
Joined: Tue Aug 26, 2014 5:34 pm
Location: Germany

Plugins converts from Eventscripts to Source Python

Postby Killer0561 » Thu Oct 01, 2015 1:27 pm

Hi Guys,

Is there a possibility of old plugins EventScripts for Source Python rewrite?

  • ✓ download - (done)
  • ✓ noblock - (done)
  • ?! s_sounds - (needed!)
  • ?! serverad - (needed!)
  • ✓ showdamage - (done)
  • ✓ willkommen - (done)


Here all Plugins in 1 zip Archiv - http://www.file-upload.net/download-10945362/Eventscripts-Plugins.zip.html

Thanks in advance for the help :)


Greeting Killer0561
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Fri Oct 23, 2015 6:18 pm

User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Fri Oct 23, 2015 6:19 pm

A noblock plugin:

Syntax: Select all

from events import Event
from entities.constants import CollisionGroup
from players.entity import Player
from players.helpers import index_from_userid

@Event('player_spawn')
def on_player_spawn(event):
userid = event.get_int('userid')
index = index_from_userid(userid)
player = Player(index)
player.collision_group = CollisionGroup.DEBRIS_TRIGGER
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Fri Oct 23, 2015 6:19 pm

A download plugin (shouldn't this be done by each plugin itself?):

Syntax: Select all

from stringtables.downloads import Downloadables

DOWNLOADABLES = [
'sound/s_sounds/saysounds/egu-multigaming.de/aua.wav',
'sound/s_sounds/saysounds/egu-multigaming.de/axel.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/badboys.wav',
'sound/s_sounds/saysounds/egu-multigaming.de/benny.wav',
'sound/s_sounds/saysounds/egu-multigaming.de/blut.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/body.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/cry.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/feelgood.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/frage.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/fu.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/haha.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/hehe.wav',
'sound/s_sounds/saysounds/egu-multigaming.de/hi.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/impossible.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/komm.wav',
'sound/s_sounds/saysounds/egu-multigaming.de/leben.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/lol.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/lucker.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/oops.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/power.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/schnauze.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/silence.wav',
'sound/s_sounds/saysounds/egu-multigaming.de/sry.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/taliban.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/time.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/verbot.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/woohoo.wav',
'sound/s_sounds/saysounds/egu-multigaming.de/wtf.mp3',
'sound/s_sounds/saysounds/egu-multigaming.de/yeah.wav',
'sound/s_sounds/saysounds/egu-multigaming.de/zzz.wav',
]

dl = Downloadables()

for downloadable in DOWNLOADABLES:
dl.add(downloadable)
User avatar
Killer0561
Junior Member
Posts: 23
Joined: Tue Aug 26, 2014 5:34 pm
Location: Germany

Postby Killer0561 » Fri Oct 23, 2015 11:08 pm

Thank you for the first assisted! I will test it this afternoon and give feedback.
User avatar
Killer0561
Junior Member
Posts: 23
Joined: Tue Aug 26, 2014 5:34 pm
Location: Germany

Postby Killer0561 » Sun Oct 25, 2015 12:49 am

esc_ess, esc_team_color and iptocountry_example not longer needed.
download, noblock and welcome already finished.

s_sounds, serverad and showdamage now needed.

- Killer0561
User avatar
Killer0561
Junior Member
Posts: 23
Joined: Tue Aug 26, 2014 5:34 pm
Location: Germany

Postby Killer0561 » Sun Oct 25, 2015 8:35 am

Hello Jerome69, thank you for your showdamage plugin.

- Killer0561
Predz
Senior Member
Posts: 158
Joined: Wed Aug 08, 2012 9:05 pm
Location: Bristol, United Kingdom

Postby Predz » Fri Oct 30, 2015 9:45 am

For adverts use the code below:

You just call send_advert where ever you want it to loop through. e.g. round_start, etc

Syntax: Select all

from ....... import send_advert

send_advert()


Syntax: Select all

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

from messages import SayText2

# ======================================================================
# >> GLOBALS
# ======================================================================

wcs_advert_text = [
'>> \x03Warcraft Source\x01: Type \x03"wcs" \x01in chat or console to access the WCS main menu.',
'>> \x03Warcraft Source\x01: Type \x03"playerinfo" \x01in chat to see other players WCS info.',
'>> \x03Warcraft Source\x01: Bind a key to \x03"ultimate" \x01to use a races ultimate.',
'>> \x03Warcraft Source\x01: Bind keys to \x03"ability 1" \x01and \x03"ability 2" \x01to use races abilities.'
]

wcs_adverts = list(map(SayText2, wcs_advert_text))
wcs_advert_count = len(wcs_adverts)

global wcs_advert
wcs_advert = 0

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

def send_advert():
global wcs_advert

wcs_adverts[wcs_advert].send()

wcs_advert += 1
if wcs_advert == wcs_advert_count:
wcs_advert = 0
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Fri Oct 30, 2015 1:03 pm

That could be even easier if you use itertools.cycle(). :)

Syntax: Select all

# ======================================================================
# >> IMPORTS
# ======================================================================
# Python
import itertools

# Source.Python
from messages import SayText2


# ======================================================================
# >> CONSTANTS
# ======================================================================
ADVERTS = [
'>> \x03Warcraft Source\x01: Type \x03"wcs" \x01in chat or console to access the WCS main menu.',
'>> \x03Warcraft Source\x01: Type \x03"playerinfo" \x01in chat to see other players WCS info.',
'>> \x03Warcraft Source\x01: Bind a key to \x03"ultimate" \x01to use a races ultimate.',
'>> \x03Warcraft Source\x01: Bind keys to \x03"ability 1" \x01and \x03"ability 2" \x01to use races abilities.'
]


# ======================================================================
# >> GLOBAL VARIABLES
# ======================================================================
adverts = itertools.cycle(map(SayText2, ADVERTS))


# ======================================================================
# >> FUNCTIONS
# ======================================================================
def send_advert():
next(adverts).send()
Though, you should have mentioend that it's not a port of the advert plugin he uploaded.

Btw. you don't need the "global wcs_advert" at the global scope, because it already global. You never need the "global" statement at the global scope.
Predz
Senior Member
Posts: 158
Joined: Wed Aug 08, 2012 9:05 pm
Location: Bristol, United Kingdom

Postby Predz » Fri Oct 30, 2015 2:02 pm

Thanks Ayuto, didn't know that existed :)

Seem to have misunderstood slightly the global function :o
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Postby decompile » Fri Oct 30, 2015 8:24 pm

Hey, you already said you don't need iptocountry and esc, but I would actually like them ported to spe :p
User avatar
Killer0561
Junior Member
Posts: 23
Joined: Tue Aug 26, 2014 5:34 pm
Location: Germany

Postby Killer0561 » Mon Nov 02, 2015 9:18 am

Last 3 Plugins needed:

- Saysounds (write the filename in chat and play the file for all)
- Roundendsounds (play a sound at the end of the round)
- Serverad (server live status in chat with game menu to connect)

Thanks in advance

- Killer0561
Predz
Senior Member
Posts: 158
Joined: Wed Aug 08, 2012 9:05 pm
Location: Bristol, United Kingdom

Postby Predz » Mon Nov 02, 2015 3:26 pm

Both sound plugins are going to require a bit of work if you are planning to do them on csgo. If you have a look at my topic on sounds the .n that should give you a good idea of how to do it. :) I will be back tomorrow as have work til late. Will try to post an example tomorrow :D
User avatar
Killer0561
Junior Member
Posts: 23
Joined: Tue Aug 26, 2014 5:34 pm
Location: Germany

Postby Killer0561 » Tue Nov 03, 2015 1:12 pm

I have found this Plugin and write in > Saysounds:


Syntax: Select all

from engines.sound import SOUND_FROM_WORLD
from engines.sound import Sound
from events import Event
from messages import SayText2

_sounds = {
'test': Sound((), SOUND_FROM_WORLD, 'saysounds/test.mp3', download=True),
}

_duplicates = {
'test': 'test1',
}


@Event('player_say')
def player_say(game_event):
"""Play a sound if necessary."""
text = game_event.get_string('text')

if text in _duplicates:
text = _duplicates[text]

if text in _sounds:

_sounds[text].play()


Is there a way, there still to limit the number of played sounds and add a text where available, which is currently playing sound?

Can we avoid overlap of sounds? Add here a warning text?

- Killer0561
User avatar
Killer0561
Junior Member
Posts: 23
Joined: Tue Aug 26, 2014 5:34 pm
Location: Germany

Postby Killer0561 » Mon Nov 16, 2015 8:35 pm

Can me anyone help?

Need it :)
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Nov 16, 2015 8:45 pm

What limit are you looking for? A limit on the number of sounds played per map? Per round? Per player?

Avoiding overlap should be fairly easy. Also, you are using the _duplicates incorrectly. The idea is that you use it for aliases. So, instead of test equaling test1, since test is a key in your _sounds dictionary, you would want test1 to equal test.

Syntax: Select all

from engines.sound import SOUND_FROM_WORLD
from engines.sound import Sound
from events import Event
from listeners.tick import tick_delays
from messages import SayText2
from players.helpers import index_from_userid

_sounds = {
'test': Sound((), SOUND_FROM_WORLD, 'saysounds/test.mp3', download=True),
}

_duplicates = {
'test1': 'test',
}

_current_sound = None


@Event('player_say')
def player_say(game_event):
"""Play a sound if necessary."""
global _current_sound

text = game_event['text']

if text in _duplicates:
text = _duplicates[text]

if text not in _sounds:
return

if _current_sound is not None:

SayText2('A sound is already playing: {0}'.format(_current_sound)).send(index_from_userid(game_event['userid']))
return

sound = _sounds[text]

sound.play()

_current_sound = sound.sample

tick_delays.delay(sound.duration, _reset_sound)


def _reset_sound():
global _current_sound
_current_sound = None
Image
User avatar
Killer0561
Junior Member
Posts: 23
Joined: Tue Aug 26, 2014 5:34 pm
Location: Germany

Postby Killer0561 » Mon Nov 16, 2015 11:31 pm

Hello satoon,

many thanks for the quick response.

What limit are you looking for? A limit on the number of sounds played per map? Per round? Per player?


If it is possible to limit per player. (Maximum 3 Sounds).


- Killer0561
User avatar
Doldol
Senior Member
Posts: 200
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Postby Doldol » Tue Nov 17, 2015 7:14 am

decompile wrote:Hey, you already said you don't need iptocountry and esc, but I would actually like them ported to spe :p


IP to Country? What do you want specifically? I could easily make a threaded library using some web service for this, but I'm guessing you need an actual plugin?

Edit: Actually the old library is not specific to ES, you could probably get away by just using that, if you know how to script a little, getting a working plugin should be not to hard.
User avatar
Killer0561
Junior Member
Posts: 23
Joined: Tue Aug 26, 2014 5:34 pm
Location: Germany

Postby Killer0561 » Wed Nov 18, 2015 4:44 pm

Overlapping is still working. I have test it.

How to fix?


- Killer0561
User avatar
Killer0561
Junior Member
Posts: 23
Joined: Tue Aug 26, 2014 5:34 pm
Location: Germany

Postby Killer0561 » Thu Nov 26, 2015 8:50 am

I desperately needed to fix, because playing multiple and overlapping of sounds is constantly abused.

- Killer0561

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 28 guests