On_PlayerSpawning

Discussion in 'Wiki' started by DreTaX, Sep 18, 2015.

  1. DreTaX
    Offline

    DreTaX Probably knows the answer... Administrator

    Joined:
    Jun 29, 2014
    Messages:
    3,820
    Likes Received:
    602
    On_PlayerSpawning
    Method:
    On_PlayerSpawning

    Argument(s):
    1: Player Player
    2: SpawnEvent evt

    Examples:

    Code (Python):
    def On_PlayerSpawning(self, Player, SpawnEvent):
        if SpawnEvent.CampUsed:
            Logger.Log("Player used bool CampUsed")
            return
        Player.Message("Select a spawn option..")
    Code (Javascript):
    function On_PlayerSpawning(Player, SpawnEvent) {
        if (SpawnEvent.CampUsed) {
            Logger.Log("Player used a spawn option..");
            return;
        }
        Player.Message("Select a spawn option..");
    }


    Code (Lua):

    function On_PlayerSpawning(Player, SpawnEvent)
        if (SpawnEvent.CampUsed) then
            Logger:Log("Player used a spawn option..")
            return
        end
        Player.Message("Select a spawn option..")
    end
     
     
    #1
  2. Assassin
    Offline

    Assassin Plugin Developer Plugin Developer

    Joined:
    Apr 9, 2017
    Messages:
    173
    Likes Received:
    15
    Code (Python):
    def On_PlayerSpawning(self, Player, SpawnEvent):

     
    i think you forgot to add self
    because this code doesn't works without self
     
    #2
    • Agree Agree x 1

Share This Page