Clan DT Forum

    Registering Events

    Share
    avatar
    Dr. Jan Itor


    Number of posts : 66
    Age : 28
    Location : there.
    Steam ID : STEAM_0:1:16785387
    Warning :
    0 / 1000 / 100

    Karma : Infintely Awesome
    Reputation : 0
    Registration date : 2008-03-30

    Registering Events

    Post by Dr. Jan Itor on Sun Jun 15, 2008 11:44 am

    NewRound
    this will be called on new round every round using the function below:
    Code:
    register_event("HLTV", "event_new_round", "a", "1=0", "2=0")

    this will be called at round start using below:
    Code:
    register_logevent("logevent_round_start", 2, "1=Round_Start") 

    Roundend
    This will be called at the end of every round using function below:
    Code:
    register_logevent("logevent_round_end", 2, "1=Round_End") 

    Playerspawn (hamsandwich)
    I think no need to explain what the "Player Spawn" is. But many of the coders still do not know how to detect this event correctly.

    If you are using AMX Mod X v1.8 or higher, or if you have the "Ham Sandwich" module installed the most simple and efficient way of the "Player Spawn" detection is a hook of the "Spawn" function itself:
    Code:
    RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)





    Still confused?

    Still confused and don't really sure which from the above events should be used in your plugin? Review the below examples that may help you to understand the things better.

    * The "New Round" event can be used to move a spawn point entities or to play a music for a players if a freeze time is too long.
    * The "Player Spawn" can be used to alter a player's properties like start health, weapons, etc.
    * The "Round Start" can be used to create your own "buytime" for a plugins that provide a purchasable items or when you want to create a surprise item.
    * The "Round End" can be used to protect a players with a godmode until the "New Round" or to create a quick minigame until the "New Round".


    Last edited by Dr. Jan Itor on Thu Jun 26, 2008 6:56 am; edited 4 times in total


    _________________
    OH, Hello Guest
    avatar
    Ironhide v1.1.0.1
    Ironhide
    Ironhide

    Number of posts : 8
    Age : 24
    Location : on the computer with my cat lieing on the computer
    Steam ID : Steam:0:1:17811664
    Warning :
    0 / 1000 / 100

    Karma : Infinitely Awesome
    Reputation : 0
    Registration date : 2008-03-30

    Re: Registering Events

    Post by Ironhide v1.1.0.1 on Sun Jun 15, 2008 11:47 am

    Maybe should add that the first 1 (dont know how it is with the other) need a public newRound
    Code:
    Public newRound
    {
    }


    _________________

    avatar
    Dr. Jan Itor


    Number of posts : 66
    Age : 28
    Location : there.
    Steam ID : STEAM_0:1:16785387
    Warning :
    0 / 1000 / 100

    Karma : Infintely Awesome
    Reputation : 0
    Registration date : 2008-03-30

    Re: Registering Events

    Post by Dr. Jan Itor on Sun Jun 15, 2008 11:48 am

    yes these are registering events they reigster the
    Public Round_end
    Public newRound
    Public Round_start
    functions


    _________________
    OH, Hello Guest
    avatar
    Dr. Jan Itor


    Number of posts : 66
    Age : 28
    Location : there.
    Steam ID : STEAM_0:1:16785387
    Warning :
    0 / 1000 / 100

    Karma : Infintely Awesome
    Reputation : 0
    Registration date : 2008-03-30

    Re: Registering Events

    Post by Dr. Jan Itor on Mon Jun 23, 2008 4:57 pm

    added playerspawn


    _________________
    OH, Hello Guest

    Sponsored content

    Re: Registering Events

    Post by Sponsored content


      Current date/time is Sun May 20, 2018 4:45 pm