Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

get top15 player name


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Hi guys, first of all I'm sorry for my English, I'm using Google translator.
So, I came here to ask for help from you guys to finish coding a plugin for me.
I'm not a programmer, I'm just a curious :)
I found this plugin from friend GHW_Chronic

https://forums.alliedmods.net/showthread.php?t=13334

That with the command amx_tempadmin <name> <days> <flags> adds an admin temporarily, and my idea is to automate this command by making sure that when the map runs out it runs on the player that is in 1 of the top 15.
What I want this plugin to do:
- Monitor the time of the map, and when the time is up, run the command and show a message to everyone telling the player who won the admin (if possible with a countdown of 5 ~ 10 seconds) before switching to a new map
- Run the command on player 1 of top15
- The plugin should ignore existing admins, for example, if the top 1 is already admin, the plugin should execute the command on the next player other than admin.

I started coding, but I don't know how to finish, this is what I wrote so far:

Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new cvar_flags, cvar_days

public plugin_init(){
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_clcmd("tempadmin", "tempadmin")
        cvar_flags = register_cvar("amx_flags", "bcdefghiju")
        cvar_days = register_cvar("amx_days", "7")
        set_task(1.0,"timer_task",_,"",0,"b");
}
public timer_task(){
        static gmtm;
        gmtm = get_timeleft();
        if(gmtm = 0){
        server_cmd("tempadmin")
        }
}
public tempadmin(id){
        new string1[16]
        get_pcvar_string(cvar_flags, string1, 15)
        new flags = read_flags(string1)
        if(!(get_user_flags(id) & ADMIN_USER))
        return PLUGIN_CONTINUE
        new days
        days = get_pcvar_num(cvar_days)
        name = ?
        server_cmd("amx_tempadmin ^"%s^" ^"%d^" ^"%s^"", name,days,flags)
        ColorChat(id, print_center, "^3The player ^4%s ^3won the ^4Admin", name)
        return PLUGIN_CONTINUE
}

I ask your help for someone to finish coding this plugin for me, and also feel free to modify / improve the coding I wrote. I just wrote it the way I knew it, but I don't know if it's the best way to code.

I thank you for your help.

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

×
×
  • Dodaj nową pozycję...