Search found 1426 matches

by Ayuto
Mon Oct 06, 2014 8:00 pm
Forum: Plugin Development Support
Topic: need working script that acutally switches player for csgo
Replies: 26
Views: 48457

8guawong wrote:Ayuto please don't comment about my code looks ugly please :cool:

Okay... :(
by Ayuto
Mon Sep 29, 2014 7:04 pm
Forum: Plugin Development Support
Topic: getting index from playeriter
Replies: 6
Views: 10410

Yeah, but since he marked it as red I thought he was confused by "indexing" and "index".
by Ayuto
Mon Sep 29, 2014 6:20 pm
Forum: Plugin Development Support
Topic: getting index from playeriter
Replies: 6
Views: 10410

# Since "index" is the default return type I would also like to add that "indexing" has nothing to do with the return type. See this example: import random print(random.choice(set(range(5)))) It's completely unrelated to Source.Python, but it will...
by Ayuto
Mon Sep 29, 2014 6:12 pm
Forum: Code examples / Cookbook
Topic: Stripping weapons
Replies: 45
Views: 401903

L'In20Cible wrote:Probably different games.
or operating system.
by Ayuto
Sun Sep 28, 2014 6:22 pm
Forum: Plugin Development Support
Topic: how to forcing player to specific team
Replies: 10
Views: 14322

Yes, the result is the same, but if you use the decorator the code is shorter (50%) and less error prone as you don't need to unregister the filter when you unload the plugin. This will be done automatically. Just compare these two scripts and you will understand. from commands.client import client_...
by Ayuto
Sun Sep 28, 2014 4:33 pm
Forum: Plugin Development Support
Topic: how to forcing player to specific team
Replies: 10
Views: 14322

You are trying to compare the Command object with a string. This will always result in False. http://wiki.sourcepython.com/index.php/commands#Command http://wiki.sourcepython.com/index.php/commands.client def client_command_filter(player, command): if command[0] == 'jointeam': print&...
by Ayuto
Fri Sep 26, 2014 6:55 pm
Forum: Plugin Development Support
Topic: need help setting models
Replies: 3
Views: 6387

Print "old_model" and "model_index" ind player_jump and you will see the reason for your error. But please post the full error next time. :)
by Ayuto
Fri Sep 26, 2014 4:47 pm
Forum: Plugin Development Support
Topic: How to emit sound??
Replies: 22
Views: 70441

You don't need to precache the sound. Our Sound class will do that for you.

Are there any errors in your client console?
by Ayuto
Tue Sep 23, 2014 8:05 pm
Forum: Plugin Development Support
Topic: Colored Smoke
Replies: 11
Views: 21363

The effects package provides two methods to spawn smoke. But you could also create an env_smoke or a smokegrenade.
by Ayuto
Wed Sep 17, 2014 6:09 pm
Forum: Plugin Development Support
Topic: Prehook PlayerRunCmd & TraceAttack
Replies: 4
Views: 8420

You would also use the PreHook decorator to hook TraceAttack.

But I don't think you need to hook that method for this. Just use the player_hurt event and check the weapon and hitbox.
by Ayuto
Mon Sep 15, 2014 6:18 pm
Forum: Plugin Development Support
Topic: Prehook PlayerRunCmd & TraceAttack
Replies: 4
Views: 8420

Here is an example for CS:S (CS:GO shouldn't differ very much). # ============================================================================= # >> IMPORTS # ============================================================================= # Memory import memory from memory import Argument from memory ...
by Ayuto
Sat Sep 13, 2014 8:14 pm
Forum: Plugin Releases
Topic: EZSP - Libary to easily access SP modules & functions
Replies: 11
Views: 40700

Ahh, okay. Then try this:

Syntax: Select all

def getplayercount():
# Returns number of players and bots
return len(tuple(PlayerIter()))
by Ayuto
Sat Sep 13, 2014 8:02 pm
Forum: Plugin Releases
Topic: EZSP - Libary to easily access SP modules & functions
Replies: 11
Views: 40700

Let me tell you a nice trick. :p

Syntax: Select all

def getplayercount():
# Returns number of players and bots

x = 0
for index in PlayerIter():
x += 1

return x

Syntax: Select all

def getplayercount():
# Returns number of players and bots
return len(PlayerIter())
by Ayuto
Sat Sep 13, 2014 2:04 pm
Forum: Plugin Development Support
Topic: Multiple modules
Replies: 2
Views: 5002

Check this line. https://bitbucket.org/backraw/source.python/src/7a3ac1d69371807abede5215f234fdb340ed55e3/flashfunsp/config.py?at=master#cl-12

It should actually be

Syntax: Select all

from flashfunsp.info import info
or even shorter

Syntax: Select all

from info import info
by Ayuto
Sat Sep 13, 2014 7:41 am
Forum: Whatever
Topic: Resource manager
Replies: 2
Views: 11700

As for Source.Python the name would be SPAM! :D
by Ayuto
Fri Sep 12, 2014 8:41 pm
Forum: Plugin Releases
Topic: Hitmarker + Damage Stats
Replies: 4
Views: 17465

Well done! Though, I have a few suggestions. 1. You don't need to care about making materials downloadable. SP will take care of it, if you just do this. dl = Downloadables() dl.add("materials/overlays/hitmarker/hitmarkerv2.vmt") dl.add("materials/overlays/hitmarke...
by Ayuto
Thu Sep 11, 2014 10:09 am
Forum: Plugin Development Support
Topic: mathlib's is_within_box()
Replies: 7
Views: 9505

I just had a look at the implementation of Vector::WithinAABox(). bool Vector::WithinAABox( Vector const &boxmin, Vector const &boxmax) { return ( ( x >= boxmin.x ) && ( x <= boxmax.x) && ( y >= boxmin.y ) && ( y <= boxmax.y)...
by Ayuto
Wed Sep 10, 2014 4:11 pm
Forum: Plugin Development Support
Topic: mathlib's is_within_box()
Replies: 7
Views: 9505

Please show me your test code. I need something to reproduce the behaviour you explained in your first post. There is no useful information in the code you just posted.
by Ayuto
Wed Sep 10, 2014 3:45 pm
Forum: Plugin Development Support
Topic: mathlib's is_within_box()
Replies: 7
Views: 9505

Works fine for me. from mathlib import Vector point0 = Vector() point1 = Vector(100, 100, 100) # Prints True print(Vector(5, 5, 5).is_within_box(point0, point1)) # Prints False print(Vector(5, 5, 101).is_within_box(point0, point1)) What...

Go to advanced search