[CS:S] Trikz

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

Please request only one plugin per thread.
ae2x
Junior Member
Posts: 9
Joined: Mon Apr 09, 2018 4:26 pm

[CS:S] Trikz

Postby ae2x » Mon Apr 09, 2018 9:43 pm

Hi guys!

Do anyone intrested remake this eventscripts plugin to Source.Python plugin?

http://addons.eventscripts.com/addons/view/crazytrikz
User avatar
satoon101
Project Leader
Posts: 2511
Joined: Sat Jul 07, 2012 1:59 am

Re: [CS:S] Trikz

Postby satoon101 » Tue Apr 10, 2018 2:29 am

I'm not sure if anyone else is working on this, but I had a little bit of time tonight. This is not finished, and I haven't tested any of it. But, it's a place for someone else to start from. If you are working or want to work on this, feel free to use any, all, or none of the following:

Syntax: Select all

# ============================================================================
# >> IMPORTS
# ============================================================================
# Source.Python
from colors import WHITE
from commands.say import SayCommand
from config.manager import ConfigManager
from engines.server import queue_server_command
from entities.hooks import EntityCondition, EntityPreHook
from events import Event
from filters.players import PlayerIter
from mathlib import NULL_VECTOR, Vector
from menus import SimpleMenu, SimpleOption
from players.dictionary import PlayerDictionary
from players.entity import Player
from plugins.manager import plugin_manager


# ============================================================================
# >> GLOBAL VARIABLES
# ============================================================================
info = plugin_manager.get_plugin_info(__name__)

FADED_WHITE = WHITE.with_alpha(100)


# ============================================================================
# >> CONFIGURATION
# ============================================================================
with ConfigManager(info.name, 'trikz_') as config:
enable_ghost = config.cvar(
'enable_ghost', default=0, description='Enable/disable ghosting option.',
)
enable_flash = config.cvar(
'enable_flash', default=0, description='Enable/disable unlimited flashbangs.',
)
unlimited_health = config.cvar(
'unlimited_health', default=0, description='Enable/disable unlimited health.',
)
auto_respawn = config.cvar(
'auto_respawn', default=0, description='Enable/disable auto-respawning on death.',
)

queue_server_command(
'mp_friendlyfire 0;'
'sv_gravity 800;'
'sv_airaccelerate 250;'
'mp_limitteams 0;'
'mp_enableboost 1;'
)


# ============================================================================
# >> CLASSES
# ============================================================================
class TrikzPlayer(Player):
""""""
def __init__(self, index):
super().__init__(index)
self.flash = False
self.ghost = False
self.reset_player()

def reset_player(self):
self.first_checkpoint = NULL_VECTOR
self.second_checkpoint = NULL_VECTOR

def set_ghost(self):
color, noblock = (FADED_WHITE, True) if self.ghost else (WHITE, False)
self.color = color
self.noblock = noblock

player_dict = PlayerDictionary(factory=TrikzPlayer)


# ============================================================================
# >> GAME EVENTS
# ============================================================================
@Event('player_spawn')
def _player_spawn(game_event):
player = player_dict.from_userid(game_event['userid'])
if bool(enable_ghost):
player.set_ghost()
if bool(unlimited_health):
player.health = 1000


@Event('player_hurt')
def _player_hurt(game_event):
if bool(unlimited_health):
player_dict.from_userid(game_event['userid']).health = 1000


@Event('player_death')
def _player_death(game_event):
if bool(auto_respawn):
player_dict.from_userid(game_event['userid']).spawn()


@Event('weapon_fire')
def _weapon_fire(game_event):
if game_event['weapon'] != 'flashbang':
return

player = player_dict.from_userid(game_event['userid'])
if bool(enable_flash) and player.flash:
player.give_named_item('weapon_flashbang')


# ============================================================================
# >> ENTITY PRE-HOOKS
# ============================================================================
@EntityPreHook(
EntityCondition.equals_entity_classname('flashbang_projectile'), 'detonate'
)
def _pre_flashbang_detonate(stack_data):
return False


# ============================================================================
# >> COMMANDS
# ============================================================================
@SayCommand('!trikz')
def _send_menu(command, index, team_only):
main_menu.send(index)


@SayCommand('!switch')
def _switch_ghost(command, index, team_only):
if not bool(enable_ghost):
player = player_dict[index]
player.ghost ^= True
player.set_ghost()


# ============================================================================
# >> MENU CALLBACKS
# ============================================================================
def _main_menu_callback(menu, index, option):
player = player_dict[index]
if option.value == 1:
if player.get_projectile_count('flashbang') in (0, 1):
player.give_named_item('weapon_flashbang')

elif option.value == 2:
if bool(enable_flash):
player.flash ^= True

elif option.value == 3:
if bool(enable_ghost):
player.ghost ^= True
player.set_ghost()

elif option.value == 4:
pass

elif option.value == 5:
if player.dead:
player.spawn()


# ============================================================================
# >> MENU DECLARATION
# ============================================================================
main_menu = SimpleMenu(select_callback=_main_menu_callback)
main_menu.append('Trikz Settings Menu')
main_menu.append('-' * 20)
main_menu.append(SimpleOption(1, 'Give Flash (1)'))
main_menu.append(SimpleOption(2, 'Toggle Auto-Flash'))
main_menu.append(SimpleOption(3, 'Toggle Blocking'))
main_menu.append(SimpleOption(4, 'Checkpoints Menu'))
main_menu.append(SimpleOption(5, 'Respawn'))
main_menu.append('-' * 20)
main_menu.append('0. Close')
Image
ae2x
Junior Member
Posts: 9
Joined: Mon Apr 09, 2018 4:26 pm

Re: [CS:S] Trikz

Postby ae2x » Tue Apr 10, 2018 11:14 am

Thats nice sadly i just learning python so im pretty noob atm .. i hope someone take it and remake it
ae2x
Junior Member
Posts: 9
Joined: Mon Apr 09, 2018 4:26 pm

Re: [CS:S] Trikz

Postby ae2x » Wed Apr 11, 2018 7:59 pm

Well if anyone intrested to make it and have time for that please do it :)
ae2x
Junior Member
Posts: 9
Joined: Mon Apr 09, 2018 4:26 pm

Re: [CS:S] Trikz

Postby ae2x » Mon Apr 16, 2018 3:58 pm

Okay lets do this way.. since no one want to make it ill seach private maker who got time .. send me message here if you are intrested!
User avatar
satoon101
Project Leader
Posts: 2511
Joined: Sat Jul 07, 2012 1:59 am

Re: [CS:S] Trikz

Postby satoon101 » Mon Apr 16, 2018 11:49 pm

My script above should do everything except the Checkpoints (if I remember correctly). Though, again, it is untested. I might have some time to work on it this coming weekend if no one else has added anything to it by then.
Image
ae2x
Junior Member
Posts: 9
Joined: Mon Apr 09, 2018 4:26 pm

Re: [CS:S] Trikz

Postby ae2x » Sat Apr 21, 2018 7:38 pm

satoon101 wrote:My script above should do everything except the Checkpoints (if I remember correctly). Though, again, it is untested. I might have some time to work on it this coming weekend if no one else has added anything to it by then.



wow that would be nice .. i tested it it works but flashbangs dont disappear they stay on the ground and need to add text after you push block or autoflash like "Block is On" "Block is OFF"

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 2 guests