Page 1 of 1

giving item not working for csgo

Posted: Sat Sep 27, 2014 11:36 am
by 8guawong

Syntax: Select all

from events import Event
from players.entity import PlayerEntity
from players.helpers import index_from_userid

@Event
def player_jump(game_event):
player = PlayerEntity(index_from_userid(game_event.get_int('userid')))
player.give_named_item('weapon_ak47', 0, True)


Code: Select all


[SP] Caught an Exception:
Traceback (most recent call last):
  File '../addons/source-python/packages/source-python/events/listener.py', line 90, in fire_game_event
    callback(game_event)
  File '../addons/source-python/plugins/test/test.py', line 8, in player_jump
    player.give_named_item('weapon_ak47', 0, True)
  File '../addons/source-python/packages/source-python/entities/entity.py', line 114, in __getattr__
    raise AttributeError('Attribute '{0}' not found'.format(attr))

AttributeError: Attribute 'give_named_item' not found


CSGO

Posted: Sat Sep 27, 2014 1:37 pm
by Hedgehog

Posted: Sat Sep 27, 2014 3:43 pm
by 8guawong
Hedgehog wrote:You should try to use an amazing thing called search :)
http://forums.sourcepython.com/showthread.php?146-Stripping-weapons&p=2537&viewfull=1#post2537


ok thanks
but comments like "You should try to use an amazing thing called search :) " is not really needed since its just rude :rolleyes:

Posted: Sat Sep 27, 2014 4:54 pm
by L'In20Cible
Why is that rude?

Posted: Sat Sep 27, 2014 5:58 pm
by satoon101
Also, there is a parameter for that function on CS:GO that we do not currently support. For now, use the method L'In20Cible showed where you create/spawn the weapon and move it to the player's location.