Search found 769 matches

by L'In20Cible
Fri Nov 17, 2017 4:38 am
Forum: Plugin Development Support
Topic: Markdown in MOTD
Replies: 3
Views: 281

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: 211

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: 211

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: 945

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: 945

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: 945

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: 945

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: 945

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: 945

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: 945

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: 945

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: 945

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: 945

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: 274

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: 274

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: 310

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:
by L'In20Cible
Sun Nov 12, 2017 11:28 pm
Forum: Plugin Development Support
Topic: Get muzzle position
Replies: 20
Views: 779

Re: Get muzzle position

lol. Hey, as long as it works, I'm good with it. Thank you! It might have a direct way to retrieve the origin by extracting the animation/pose parameter from the cs_player_shared.mdl/ak_anims_t/ct.mdl files but I'm really unsure about that. The bone might also be different for CS:GO, I extracted it...
by L'In20Cible
Sun Nov 12, 2017 9:46 am
Forum: Plugin Development Support
Topic: Get muzzle position
Replies: 20
Views: 779

Re: Get muzzle position

Player doesn't have an eye_position attribute, I guess you meant eye_location. However, it returns player.origin + player.view_vector, and your code is the exact same thing, just differently written. ^^ EDIT: Quite crappy... but works! from engines.precache import Model from entities.constants impor...
by L'In20Cible
Sun Nov 12, 2017 9:09 am
Forum: Plugin Development Support
Topic: Get muzzle position
Replies: 20
Views: 779

Re: Get muzzle position

sorry i misinserted the z offset xD what about this? EDIT: from mathlib import QAngle, Vector from players.entity import Player player = Player(1) angles = QAngle(*player.get_property_vector('m_angAbsRotation')) pos = player.get_property_vector('m_HackedGunPo...
by L'In20Cible
Sun Nov 12, 2017 8:51 am
Forum: Plugin Development Support
Topic: Get muzzle position
Replies: 20
Views: 779

Re: Get muzzle position

well you dont have to test it, if you dont want to. it just sounded like you tested your code one moment earlier. so why are you saying that your code was pointing towards "(the front of its feet)"? looking at your actual code, i can say it probably just point towards to the worlds root a...

Go to advanced search