However, I was just wondering, if I get EasyPlayer from userid, and then later on check if an other EasyPlayer instance from the same userid is equal to the first EasyPlayer, will it be? Or would I have to compare like userid's or steamid's?
Example of what I mean:
Syntax: Select all
from players import EasyPlayer
# Create player list for storing all the players (just an example)
players = []
@Event
def player_spawn(GameEvent):
userid = GameEvent.GetInt('userid')
player = EasyPlayer(userid)
# Add spawned player to players if he's not there already
if player not in players:
players.append(player)
Syntax: Select all
from players import EasyPlayer
# Create player list for storing all the players (just an example)
players = []
@Event
def player_spawn(GameEvent):
userid = GameEvent.GetInt('userid')
player = EasyPlayer(userid)
# Add spawned player to players if he's not there already
for p in players:
if player.steamid == p.steamid:
return
players.append(player)