←  Pluginy

AMXX.pl: Support AMX Mod X i SourceMod

»

Modyfikacja
Wyciągnięcie nazwy gracza

  • +
  • -
Tomek179 - zdjęcie Tomek179 12.12.2013

Witam. Mam zaintalowany ten plugin: http://amxx.pl/topic...ające-prezenty/

Lista prezentów tworzy się w oddzielnym pluginie.

Czy ktoś potrafi zrobić aby na liście prezentów wyświetlał się nick gracza, który otworzył prezent?

#include <amxmodx>
#include <amxmisc>

#include <prezenty>

#define PLUGIN "Lista prezentow"
#define VERSION "1.0"
#define AUTHOR "R3X"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_gift("Prezent#1", "Prezent_Numer1");
    register_gift("Prezent#2", "Prezent_Numer2");

    
    //Na poczatk rundy
    register_event("HLTV", "eventRoundInit", "a", "1=0", "2=0");
}


public eventRoundInit()
{
    gifts_clear_map();
    
    set_task(5.0, "taskSpawnGift", 2368);
    
}

public taskSpawnGift()
{
    gift_spawn();
}



public Prezent_Numer1(id)
{
    client_print(id, print_chat, "Podniosles prezent nr 1");
}

public Prezent_Numer2(id)
{
    client_print(id, print_chat, "Podniosles prezent nr 2");
    client_print(0, print_chat, "Gracz <nick> podniosl prezent nr 2.");
}

Chodzi oto aby wyświetlało wszystkim nazwę gracza, który otworzył prezent.

Główny plugin w załączniku.

Załączone pliki


Użytkownik Tomek179 edytował ten post 12.12.2013 22:42
Odpowiedz

  • +
  • -
Ogen Dogen - zdjęcie Ogen Dogen 13.12.2013

#include <amxmodx>
#include <amxmisc>

#include <prezenty>

#define PLUGIN "Lista prezentow"
#define VERSION "1.0"
#define AUTHOR "R3X"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_gift("Prezent#1", "Prezent_Numer1");
    register_gift("Prezent#2", "Prezent_Numer2");

    
    //Na poczatk rundy
    register_event("HLTV", "eventRoundInit", "a", "1=0", "2=0");
}

new nick[32];

public eventRoundInit()
{
    gifts_clear_map();
    
    set_task(5.0, "taskSpawnGift", 2368);
    
}

public taskSpawnGift()
{
    gift_spawn();
}



public Prezent_Numer1(id)
{
    client_print(id, print_chat, "Podniosles prezent nr 1");
}

public Prezent_Numer2(id)
{
    client_print(id, print_chat, "Podniosles prezent nr 2");
    get_user_name(id,nick,31);
    client_print(0, print_chat, "Gracz %s podniosl prezent nr 2.",nick);
}

Takie coś ?

Odpowiedz

  • +
  • -
Tomek179 - zdjęcie Tomek179 13.12.2013

O właśnie, oto mi chodziło! Daję plusika.

 

Pięknie dziękuje! :) 

Odpowiedz