Code: Select all
from events import Event
from players.entity import PlayerEntity
from players.helpers import index_from_userid
@Event
def player_say(GameEvent):
# Get the player's userid
userid = GameEvent.GetInt('userid')
# Get the player's index
index = index_from_userid(userid)
# Get the player's PlayerEntity instance
player = PlayerEntity(index)
# Give the player the weapon
player.give_named_item('item_longjump', 0, True)
I'am trying to give the players weapons on activate rather than have them run around and look for them
weapons/items to spawn with after every death.
item_longjump
item_weapon_shotgun
item_weapon_mp5
item_weapon_357
item_weapon_crossbow
Thanks