Eventy

S!p

Administrator
Członek Załogi
Wydarzenie (eng. Event) - pozwala na wywołanie określonej funkcji w momencie gdy coś się wydarzy. Może to być śmierć gracza, spawn, nowa runda czy połączenie się z serwerem.

eventy wywołujemy w sekcji public plugin_init()
PHP:
register_event("nazwa_eventu","funkcja_ktora_ma_wywolac","flagi",dodatkowe_parametry)

Flagi:
PHP:
a // Wysyłany do wszystkich graczy
b // Wysyłany do konkretnej osoby
c // Wysyłany tylko raz gdy jest powtarzany u inych graczy
d // Wysyalny do martwych
e // Wysyłany do żywych

Pełna lista eventów: http://war3ft.com/downloads/misc/events_CS.htm

Przykładowe eventy:
PHP:
#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    register_event("SendAudio", "wygrana_ct", "a", "2&%!MRAD_ctwin")
}
public wygrana_ct()
{
}

PHP:
#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    register_event("SendAudio", "wygrana_tt", "a", "2&%!MRAD_terwin")
}
public wygrana_tt()
{
}

PHP:
#include <amxmodx>

public plugin_init() {
    register_event("TextMsg", "restart_rundy", "a", "2&#Game_will_restart_in")
}
public restart_rundy()
{
}

PHP:
public client_connect(id)
{
}

PHP:
public client_disconnect(id)
{
}

PHP:
#include <amxmodx> 
 
public plugin_init() 
{ 
    register_event("HLTV", "nowa_runda", "a", "1=0", "2=0")  
} 
 
public nowa_runda() 
{ 
}

PHP:
#include <amxmodx>

public plugin_init() 
{
    register_logevent("koniec_rundy",2,"1=Round_End")
}
public koniec_rundy()
{
}

PHP:
#include <amxmodx>

public plugin_init() 
{
    register_event("Damage", "obrazenia", "b", "2!=0")
}
public obrazenia()
{
}
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Back
Do góry