Search found 1411 matches

by Ayuto
Wed Nov 25, 2015 1:16 pm
Forum: General Discussion
Topic: Weird behaviour during warmup
Replies: 7
Views: 6359

An other bug which I'm not sure if it's SP or Source engine: player.is_fake_client() seems to return False even on bots. Is this intended behaviour? I just ended up using player.steamid == 'BOT' for now, but took me a while to figure out why my code wasn't working. Does that always ...
by Ayuto
Wed Nov 25, 2015 12:43 pm
Forum: General Discussion
Topic: Weird behaviour during warmup
Replies: 7
Views: 6359

I moved this thread to a more appropriate section.

I actually doubt that this is a bug in SP, but if you really want to find that out, disable SP and test again.
by Ayuto
Sun Nov 22, 2015 11:50 am
Forum: General Discussion
Topic: SP crashing server No global pointer found for "Server"
Replies: 4
Views: 4193

Build 141 is working fine for me as well. What did you do to update from 140 to 141?
by Ayuto
Sun Nov 22, 2015 12:35 am
Forum: General Discussion
Topic: SP crashing server No global pointer found for "Server"
Replies: 4
Views: 4193

This should fix the crash (build 140): https://github.com/Source-Python-Dev-Team/Source.Python/commit/89e576c055874c78b33db826358e8828155e80de I changed that in my last commit due to the conversions update, but I forgot to remove the "!". Thanks for reporting! :) Edit: The error you get has nothing ...
by Ayuto
Fri Nov 20, 2015 2:44 pm
Forum: News & Announcements
Topic: Updated conversion functions
Replies: 8
Views: 24138

Alright, I have updated the conversion functions once again to raise an exception instead of returning None in case of a failed conversion. The main post has been updated as well.

Thank you for your feedback! :)
by Ayuto
Thu Nov 19, 2015 11:33 pm
Forum: News & Announcements
Topic: Updated conversion functions
Replies: 8
Views: 24138

The reason for this change was that we only wanted one behaviour and not two depending on the second argument. To be honest, when I decided to return None I was a bit C/C++ driven, where it's common to return "false" on failure and "true" on success (the actual return value is passed as a reference ...
by Ayuto
Thu Nov 19, 2015 2:38 pm
Forum: News & Announcements
Topic: Updated conversion functions
Replies: 8
Views: 24138

Updated conversion functions

We have updated all conversion functions. They now don't have the optional keyword argument "raise_exception" anymore (defaulting to True). Instead they only accept the value that should be converted and return the converted value. If the conversion failed, a ValueError will be raised. Exa...
by Ayuto
Wed Nov 18, 2015 11:21 pm
Forum: Plugin Development Support
Topic: Questions on working with entities IO calls and keyvalues
Replies: 19
Views: 12888

Ayuto , do you mean _entities._datamaps.Variant.set_string ? That would be inputdata.value.set_string . As far as I see, it doesn't cast any given string to the needed value type, it just sets it as a string, so the input will be called with a string value. I thought this is exactly what you want? ...
by Ayuto
Wed Nov 18, 2015 7:54 pm
Forum: Plugin Development Support
Topic: Questions on working with entities IO calls and keyvalues
Replies: 19
Views: 12888

I think you "could" use entity.get_input() to get the input function. Then you only need to call Function.__call__ with your own InputData object, which you filled by using InputData.set_string().
by Ayuto
Tue Nov 17, 2015 9:49 pm
Forum: Plugin Development Support
Topic: Csgo motd
Replies: 21
Views: 20415

I can't remember if relative paths were working. But if they are working, they would probably need to be relative to the srcds executable. Example:

Syntax: Select all

motd(index, 'test', 'file://cstrike/page.html')
by Ayuto
Tue Nov 17, 2015 3:44 pm
Forum: Plugin Development Support
Topic: Csgo motd
Replies: 21
Views: 20415

Syntax: Select all

motd(index, 'test', <path to the file on your server>)
by Ayuto
Tue Nov 17, 2015 2:55 pm
Forum: Plugin Development Support
Topic: Csgo motd
Replies: 21
Views: 20415

A better workaround would be to write a temporary file on your server and send that instead of the actual website. Though, I hope there is a real fix.
by Ayuto
Tue Nov 17, 2015 2:08 pm
Forum: Plugin Development Support
Topic: Csgo motd
Replies: 21
Views: 20415

Your screenshot shows a working MOTD, so where is the problem? When I was testing the MOTD with the new messages package I was using the example MOTD from the AlliedModders thread stinckyfax linked here: <html><head><script type="text/javascript">window.onload = function(){  ...
by Ayuto
Tue Nov 17, 2015 1:58 pm
Forum: Plugin Development Support
Topic: player.switch_team() second argument
Replies: 3
Views: 3264

Actually, player.switch_team() only requires one argument, which is the team number.
by Ayuto
Sun Nov 15, 2015 5:40 pm
Forum: API Design
Topic: Sourcemod (or Mani?) Style Player Filtering
Replies: 5
Views: 19845

If we want to be mathematically correct, we would use set operations for filters, because we are actually working with sets. I think the only interesting operations are "union" and "complement". As the notation for unions I would simply use the plus sign (+) and for complements the minus sign (-). H...
by Ayuto
Sat Nov 14, 2015 11:25 am
Forum: Plugin Development Support
Topic: Getting a team's player count without iterating?
Replies: 12
Views: 8399

I guess the first solutions completes that fast for you, because I'm running the latest SP version and we have recently changed the iterators. While your iterator iterates over Edict objects and uses a different way for filtering, the new iterator iterates over Player objects and accesses dynamic at...
by Ayuto
Sat Nov 14, 2015 11:04 am
Forum: API Design
Topic: Adding Entity/PlayerEntity/WeaponEntity attributes via data
Replies: 4
Views: 14115

You are missing the "return_type = INT" entry. Are those offsets the same on all games? I doubt, so we will probably need different offsets for the other games. However, I'm not sure if we really want to add that to the data files. It's another offset we need to maintain for a functionality that alr...
by Ayuto
Sat Nov 14, 2015 10:51 am
Forum: General Discussion
Topic: [SP SUGGESTION] Plugins Hot Reloading
Replies: 2
Views: 3185

Hey, thank you for your suggestion! But I think I agree with Doldol. I know a similar mechanism from the Django framework. At first I though: "Oh, that's cool!", but then I realized that it doesn't always recognize the changes and I had to make another change again. Sometimes I ended up restarting t...
by Ayuto
Sat Nov 14, 2015 1:18 am
Forum: Plugin Requests
Topic: Random fog
Replies: 15
Views: 11829

Ah, I should have taken a look at the data files first. :D
by Ayuto
Fri Nov 13, 2015 11:42 pm
Forum: Plugin Development Support
Topic: Getting a team's player count without iterating?
Replies: 12
Views: 8399

Just tested the performance between PlayerIter and a specific function to get the player count. Here is the result: from timeit import Timer # Tested with 24 bots: 12 T, 12 CT iterations = 1000 # Result: 2.422217352161965 print(Timer( """ len(PlayerIter('t')...

Go to advanced search