Search found 793 matches

by L'In20Cible
Thu Nov 23, 2017 9:43 pm
Forum: Plugin Development Support
Topic: Forcing a user cmd on a player at any time?
Replies: 3
Views: 526

Re: Forcing a user cmd on a player at any time?

You could also use the m_afButtonForced property. For example: player.set_property_int('m_afButtonForced', PlayerButtons.JUMP) Would force the player to jump. However, keep in mind that this property is not networked to clients so any button that requires client prediction won't work...
by L'In20Cible
Thu Nov 23, 2017 4:29 am
Forum: Plugin Development Support
Topic: Looping a Timed Task in Many Objects
Replies: 8
Views: 914

Re: Looping a Timed Task in Many Objects

iPlayer is correct. Using the output would be preferred, I remember some issues with hooking the virtual touch methods. Tho I think it was only post ones? Can't remember. As for inheriting from Entity, I think this would be the best approach. Simply because you can delegate their creation to an Enti...
by L'In20Cible
Wed Nov 22, 2017 11:25 pm
Forum: Plugin Development Support
Topic: Looping a Timed Task in Many Objects
Replies: 8
Views: 914

Re: Looping a Timed Task in Many Objects

Hey, welcome to the forums! First of all, please use the PYTHON syntax when posting python code as it makes it easier to read. As for your code, this is normal that it freeze because it creates an infinite recursion. Every time the draw_beams method is called, it creates a new Repeat instance and re...
by L'In20Cible
Tue Nov 21, 2017 11:20 pm
Forum: Plugin Development Support
Topic: server init
Replies: 32
Views: 2583

Re: server init

what if i use these functions : def get_decal_index(path): engine_server.precache_decal(path,True) return string_tables['decalprecache'][path] def get_model_index(path): engine_server.precache_model(path,True) return string_tables['modelprecache'][pat...
by L'In20Cible
Fri Nov 17, 2017 4:38 am
Forum: Plugin Development Support
Topic: Markdown in MOTD
Replies: 3
Views: 629

Re: Markdown in MOTD

I doubt it. I know you can send plain text, url and html files. Really unsure if the clients are able to make the difference from the files content... pretty sure it won't but, did you try? If you want to use markdown tho, you could always convert your files to html before sending them to clients; t...
by L'In20Cible
Thu Nov 16, 2017 5:49 am
Forum: Plugin Development Support
Topic: Best way to serialize/deserialize data?
Replies: 4
Views: 591

Re: Best way to serialize/deserialize data?

How would I use the vector suit in a plugin? You don't have to do anything, was just pointing out that Vector instances can be pickled as is without conversion on your part: with shelve.open('spawnpoints') as db: db['de_dust2'] = [Vector(1, 2, 3), Vector(4, 5, 6&...
by L'In20Cible
Thu Nov 16, 2017 4:58 am
Forum: Plugin Development Support
Topic: Best way to serialize/deserialize data?
Replies: 4
Views: 591

Re: Best way to serialize/deserialize data?

BackRaw wrote:Converting everything using Pickle/cPickle would cause more code overhead than usage imho. Is there an easier way/library?

I always liked the simplicity of shelve which does all the pickling for you from a dict-like object. Vector instances also have their own suite so they can be stored as is.
by L'In20Cible
Wed Nov 15, 2017 7:37 pm
Forum: Plugin Development Support
Topic: server init
Replies: 32
Views: 2583

Re: server init

you dont need to prove your point. ive already seen your point. i dont disagree with your point. your point just doesnt help me. Sorry, I misinterpreted your previous post and thought you were saying I was wrong for telling you that the tables are re-allocated every map and not that it was not affe...
by L'In20Cible
Wed Nov 15, 2017 6:06 pm
Forum: Plugin Development Support
Topic: server init
Replies: 32
Views: 2583

Re: server init

you are kinda wrong, because i know that i dont reload the map and your scenario never happens.. so it doesnt help me.. :( This will be my last post because this is going nowhere. Here is some data to prove my point. from commands.server import ServerCommand from engines.server import engine_server...
by L'In20Cible
Wed Nov 15, 2017 5:03 pm
Forum: Plugin Development Support
Topic: server init
Replies: 32
Views: 2583

Re: server init

if you think outside the box of "does it crash? no? ok this works use it!!", you will see that getting indexes after precaching is needed only 1 time. thats why im trying to get the index. im not really trying to precache something, that suppresses an error of getting not index. because t...
by L'In20Cible
Wed Nov 15, 2017 4:55 pm
Forum: Plugin Development Support
Topic: server init
Replies: 32
Views: 2583

Re: server init

thanks. theres a problem. with your workaround i dont get index from the Decal() class. it only suppresses any scriptload errors. Which is not really a "problem" because you don't need indexes if there is no map loaded because you cannot network any effects unless there is players and no ...
by L'In20Cible
Wed Nov 15, 2017 4:52 pm
Forum: Plugin Development Support
Topic: server init
Replies: 32
Views: 2583

Re: server init

Yes, checking against the map name is a workaround as it will only returns an empty string when no map has been loaded at all. However, since "server" relies on a signature/symbol, I would rather recommend using:

Syntax: Select all

from engines.server import global_vars

global_vars.map_name
by L'In20Cible
Wed Nov 15, 2017 4:37 pm
Forum: Plugin Development Support
Topic: server init
Replies: 32
Views: 2583

Re: server init

Thanks, I was able to reproduce the crashes as well. Will add checks to ensure it doesn't crash but you should really use the Decal class (same usage for Model and Generic classes): from engines.precache import Decal my_decal = Decal('some/decal.vmt') def some_function(): pri...
by L'In20Cible
Wed Nov 15, 2017 4:22 pm
Forum: Plugin Development Support
Topic: server init
Replies: 32
Views: 2583

Re: server init

In my previous post, I mentioned that stringtables cannot be accessed unless a map is loaded because they are related to the game-play and they are not initialized at this point. I assumed that you was pre-caching using the direct engine_server calls, which I'm unsure if they have the proper checks ...
by L'In20Cible
Wed Nov 15, 2017 4:02 pm
Forum: Plugin Development Support
Topic: server init
Replies: 32
Views: 2583

Re: server init

Like I said in my post, stringtables are not allocated yet. Also, they are freed and re-allocated every map so you should NEVER pre-cache anything in global scope/or load function. You should instead use the engines.precache module that will ensure to refresh the indexes every map for you.
by L'In20Cible
Wed Nov 15, 2017 3:07 pm
Forum: Plugin Development Support
Topic: server init
Replies: 32
Views: 2583

Re: server init

I really don't understand what you are referring to by "native module", could you elaborate which modules exactly? The game binaries? They are the ones loading Source.Python so everything that is not related to the game-play (entities, stringtables, etc.) should be accessible when loading ...
by L'In20Cible
Wed Nov 15, 2017 2:58 pm
Forum: Plugin Development Support
Topic: server init
Replies: 32
Views: 2583

Re: server init

I think you are looking for the OnServerActivate listener or server_spawn event.
by L'In20Cible
Mon Nov 13, 2017 2:20 am
Forum: Plugin Development Support
Topic: [CSGO] Getting and setting player score
Replies: 6
Views: 839

Re: [CSGO] Getting and setting player score

What is your code?
by L'In20Cible
Mon Nov 13, 2017 1:50 am
Forum: Plugin Development Support
Topic: [CSGO] Getting and setting player score
Replies: 6
Views: 839

Re: [CSGO] Getting and setting player score

Player.kills/deaths

Syntax: Select all

player = Player(index)
player.kills = 0
player.deaths = 999
print(f'{player.name} is a noob, check the scoreboard!')
by L'In20Cible
Sun Nov 12, 2017 11:33 pm
Forum: Plugin Development Support
Topic: WeaponID
Replies: 9
Views: 929

Re: WeaponID

Kami wrote:The question is if the data is outdated or if I'm doing something wrong.

Probably is. The bastards at VALVe are changing weapons stuff daily for CS:GO. :tongue:

Go to advanced search