Search found 1256 matches

by L'In20Cible
Sat May 17, 2014 12:03 pm
Forum: Plugin Development Support
Topic: Nesting damage
Replies: 6
Views: 6343

Thats because PlayerEntity.isdead is broken use PlayerEntity.pl.deadflag instead.
by L'In20Cible
Mon May 12, 2014 10:14 am
Forum: Plugin Development Support
Topic: Radar possebilities?
Replies: 15
Views: 12660

Something like this should works: from entities import EntityGenerator from filters.players import PlayerIter from listeners.tick import Tick for player_manager in EntityGenerator('cs_player_manager'): break @Tick def tick_listener(): for index in PlayerIter('alive...
by L'In20Cible
Thu May 08, 2014 6:58 pm
Forum: Plugin Development Support
Topic: listeners Tick
Replies: 4
Views: 4538

About _globals, I just ended up putting the GlobalVars singleton into core.py, unless you have a better place to put it, I don't see any benefit having a package for a single variable. As for _constants, most of them will be moved into players/entities.constants and the remaining will stay into cons...
by L'In20Cible
Thu May 08, 2014 4:59 am
Forum: Plugin Development Support
Topic: listeners Tick
Replies: 4
Views: 4538

Syntax: Select all

from listeners.tick import Tick
by L'In20Cible
Tue May 06, 2014 10:46 pm
Forum: News & Announcements
Topic: Syntax Highlighting is back!!!
Replies: 11
Views: 12215

Just noticed an issue, tho. Every 55 characters, there is 2 extra spaces added into Python blocks. Example here. If you go into Edit Mode, you will see the code is correct but there is extra spaces when displayed.
by L'In20Cible
Tue May 06, 2014 10:41 pm
Forum: Code examples / Cookbook
Topic: Stripping weapons
Replies: 45
Views: 118934

No need of a signature. from entities.helpers import edict_from_index from players.entity import PlayerEntity from players.helpers import index_from_userid from tools import ServerTools def give_item(player, item): '''Give an item to the given player.''' # Ghosts can&...
by L'In20Cible
Mon May 05, 2014 10:30 pm
Forum: Code examples / Cookbook
Topic: Stripping weapons
Replies: 45
Views: 118934

Weapon functionalities are not updated yet. Also, I'd rather suggest you using PlayerIter instead of PlayerGenerator . from filters.players import PlayerIter for index in PlayerIter(return_types='index'): print('A player was found at index {0}!'.format(index))
by L'In20Cible
Mon May 05, 2014 10:24 pm
Forum: News & Announcements
Topic: Syntax Highlighting is back!!!
Replies: 11
Views: 12215

What a nice feeling to my eyes!!!
by L'In20Cible
Mon May 05, 2014 9:32 pm
Forum: Plugin Development Support
Topic: Where did conversions_c move to?
Replies: 2
Views: 3299

Here is a list of where things has been moved: basetypes_c -> basetypes bot_c -> bots command_c -> _commands -> commands constants_c -> constants conversions_c -> _conversions -> players/entity.helpers cvar_c -> _cvars -> cvars datamap_c -> datamaps dump_c -> _dump effects_c -> _effects -> effects e...
by L'In20Cible
Mon May 05, 2014 9:24 pm
Forum: Code examples / Cookbook
Topic: Damaging a player
Replies: 12
Views: 16273

Hit group is an integer:

Code: Select all

#define   HITGROUP_GENERIC   0
#define   HITGROUP_HEAD      1
#define   HITGROUP_CHEST      2
#define   HITGROUP_STOMACH   3
#define HITGROUP_LEFTARM   4   
#define HITGROUP_RIGHTARM   5
#define HITGROUP_LEFTLEG   6
#define HITGROUP_RIGHTLEG   7
#define HITGROUP_GEAR      10
by L'In20Cible
Sat May 03, 2014 9:21 pm
Forum: Plugin Development Support
Topic: Handling unicode characters
Replies: 7
Views: 6494

This will open your file in UTF-8 but it won't change the encoding of the strings it contains. Since the default encoding used by print is sys.stdout.encoding (which is set to cp850), you will rather have to encode it into UTF8 to then decode it back in order to print it...
by L'In20Cible
Sat May 03, 2014 8:23 pm
Forum: Plugin Development Support
Topic: Handling unicode characters
Replies: 7
Views: 6494

Syntax: Select all

>>> data = pickle.load(open('playerdict.txt','rb'), encoding='utf-8')
by L'In20Cible
Sat May 03, 2014 5:53 pm
Forum: Plugin Development Support
Topic: Handling unicode characters
Replies: 7
Views: 6494

Well, it is hard to say what is the main problem without any code to reproduce it. I made some testing on my side and it is working just fine...
by L'In20Cible
Thu Apr 17, 2014 8:56 pm
Forum: Plugin Development Support
Topic: Values returning 'None' for variables
Replies: 6
Views: 5888

satoon101 wrote:Actually, you just need to change __init__ to __new__ with the super line.
He will also need to add "self" as first argument since __new__ is a static method.
by L'In20Cible
Thu Apr 17, 2014 9:12 am
Forum: General Discussion
Topic: gamethread
Replies: 7
Views: 6427

Well, your syntax for gamethread is wrong. It should be:

Code: Select all

import gamethread

gamethread.delayed(delay_time, myCallback, args)
Anyways, to answer your question, yes there is:

Code: Select all

from tick.delays import TickDelays

TickDelays.delay(delay_time, myCallback, *args)
by L'In20Cible
Thu Apr 17, 2014 5:10 am
Forum: Plugin Development Support
Topic: Values returning 'None' for variables
Replies: 6
Views: 5888

Well, replace the following line: self = super(dndPlayer, self).__init__(index) To the following one: self = PlayerEntity.__new__(dndPlayer, index) Please, always post your complete code so we don't have to guess your imports and/or custom global variables (such as PlayerDataDictionary) when trying ...
by L'In20Cible
Tue Apr 15, 2014 6:36 am
Forum: Code examples / Cookbook
Topic: Particle effects!
Replies: 36
Views: 91886

Particle effects!

from entities.entity import BaseEntity from events import Event from mathlib_c import Vector from tick.delays import TickDelays from tools_c import ServerTools from stringtables_c import StringTables @Event def hegrenade_detonate(game_event): # Create a particle system entity... particle = ...
by L'In20Cible
Tue Apr 01, 2014 9:06 pm
Forum: General Discussion
Topic: Heads up
Replies: 11
Views: 10479

satoon101 wrote:The current ones work (with the exception of Remove)

Syntax: Select all

from tools_c import ServerTools

# A super usefull script that remove the world and crash the server when loaded. It is a must for every servers!
ServerTools.remove_entity(0)
by L'In20Cible
Thu Mar 27, 2014 10:23 pm
Forum: Plugin Releases
Topic: Parachute v0.03!
Replies: 44
Views: 67935

It is on GitHub. But you need to compile it yourself.

Go to advanced search