Happy Hour

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
Shopkeh
Извън линия
Foreigner
Foreigner
Мнения: 5
Регистриран на: 02 Май 2018, 05:58
Местоположение: Behind you!
Се отблагодари: 1 път
Обратна връзка:

Happy Hour

Мнение от Shopkeh » 25 Мар 2019, 14:17

Greetings everyone.

I've been searcing for a plugin that could give to players a certain flag(s) for a certain time. I could only find "Happy Hour" for ZP mod and some other but none of them meets my requirements.

I would use the plugin for purposes such as giving to players a "V.I.P" status for a certain period in time.

I'm greatful for anybody willing to help me.
.
.
P̵̧̝̬̤̖̳̞͙̩̪̑͂̂̑̎͂̎̌̕e̵̲͎͕̰̜̒̀̈̾͊͛̕s̡̛̻̻̜̞͍̗̋̈́̇̀́̄͋̀ş̴̱̰͈̺̝̲̝͉̎̈́͛̽̈́͞ȋ̢̞̠͙̦̩̊͗̔̎͂̾̋͌͂m̥͔͙̯̳͕̳̗̰͋̄̊̀͑͝ͅȉ̵̙̼̣̯̟̪͔̔̽̎̀̆̊̓͒͟͡ş̖̤̖͕̺̫͇̑̔̅̉͜͞t̴͙̠͎̩͉̻̀͑̽̇̆̎̀̆͝͞į̷̙̦̳͍̉͒̋̍̐̃́͠͡͝ͅc̼̞̭̱̓́̏̂̄̉̚̚̚͢͠ͅ t̰̠̝̱̠̱̓̇̓̂̋̓̑̽̕͟͝h̶͔̰̗̳͎̮͉̼̪̽͑̅͒̎͟i̸̲͖̟͋̈́̓͐͆̓̔͒͜͜ṉ̴̨̛̫̭̙̀͋̓̓̾̕͡ͅḱ̢̧̛̝̘̺̽̀͊̕ĭ̴̛̟͚̹̱̙́͋̅̃͗̕̕͜n̡̘͖̙͙̗͇̊̈́̔̀̑̀̓̌̾̅g̶̛͕͖̲͈̗̘̮̐̓̆̃̐̔̚
.
.

Аватар
Autumn Shade
Извън линия
Потребител
Потребител
Мнения: 269
Регистриран на: 14 Мар 2019, 13:20
Се отблагодари: 48 пъти
Получена благодарност: 150 пъти

Happy Hour

Мнение от Autumn Shade » 25 Мар 2019, 14:18

Okay. You mean, you give somebody the flags, and he has it for 1 hour, for example, or he has it between some hours?

Аватар
Shopkeh
Извън линия
Foreigner
Foreigner
Мнения: 5
Регистриран на: 02 Май 2018, 05:58
Местоположение: Behind you!
Се отблагодари: 1 път
Обратна връзка:

Happy Hour

Мнение от Shopkeh » 25 Мар 2019, 14:48

I mean automatically. When a certain time comes, players will receive a "V.I.P" flag. For example, on 10pm till 10am, users can play with flag(s) ("V.I.P" abilities).

Maybe the requiest is understandable for me because I have had it's purpose in my head, so I didn't explain well...
.
.
P̵̧̝̬̤̖̳̞͙̩̪̑͂̂̑̎͂̎̌̕e̵̲͎͕̰̜̒̀̈̾͊͛̕s̡̛̻̻̜̞͍̗̋̈́̇̀́̄͋̀ş̴̱̰͈̺̝̲̝͉̎̈́͛̽̈́͞ȋ̢̞̠͙̦̩̊͗̔̎͂̾̋͌͂m̥͔͙̯̳͕̳̗̰͋̄̊̀͑͝ͅȉ̵̙̼̣̯̟̪͔̔̽̎̀̆̊̓͒͟͡ş̖̤̖͕̺̫͇̑̔̅̉͜͞t̴͙̠͎̩͉̻̀͑̽̇̆̎̀̆͝͞į̷̙̦̳͍̉͒̋̍̐̃́͠͡͝ͅc̼̞̭̱̓́̏̂̄̉̚̚̚͢͠ͅ t̰̠̝̱̠̱̓̇̓̂̋̓̑̽̕͟͝h̶͔̰̗̳͎̮͉̼̪̽͑̅͒̎͟i̸̲͖̟͋̈́̓͐͆̓̔͒͜͜ṉ̴̨̛̫̭̙̀͋̓̓̾̕͡ͅḱ̢̧̛̝̘̺̽̀͊̕ĭ̴̛̟͚̹̱̙́͋̅̃͗̕̕͜n̡̘͖̙͙̗͇̊̈́̔̀̑̀̓̌̾̅g̶̛͕͖̲͈̗̘̮̐̓̆̃̐̔̚
.
.

Аватар
Autumn Shade
Извън линия
Потребител
Потребител
Мнения: 269
Регистриран на: 14 Мар 2019, 13:20
Се отблагодари: 48 пъти
Получена благодарност: 150 пъти

Happy Hour

Мнение от Autumn Shade » 25 Мар 2019, 15:05

The title says it all. Using OciXCrom's written plugin as base: https://www.amxx-bg.info/forum/viewtopic.php?t=967

Код за потвърждение: Избери целия код

#include <amxmodx>

enum _:HappyHour
{
    Start,
    End
}

/*! Here you can enter the hours you want it from */
new const g_eHappyHour[][HappyHour] =
{
    // You can add more hours here
    // Structure:  { Start hour, end hour }
    { 22, 10 },
}

/*! Here you can edit the flags you want to give to the players in this interval of time */
new const VIPFlags[] = "cfu";

public plugin_init()
{
    register_plugin("Happy Hour", "1.0", "OciXCrom @ amxx-bg.info/forum")
}

public client_authorized(id) {
    if(is_user_connected(id))
        for(new i; i < sizeof(g_eHappyHour); i++)
            if(g_eHappyHour[i][Start] <= iHour <= g_eHappyHour[i][End])
            {
                set_user_flags(id, read_flags(VIPFlags));
                break
            }
}
Let me know if it works.

Аватар
Shopkeh
Извън линия
Foreigner
Foreigner
Мнения: 5
Регистриран на: 02 Май 2018, 05:58
Местоположение: Behind you!
Се отблагодари: 1 път
Обратна връзка:

Happy Hour

Мнение от Shopkeh » 25 Мар 2019, 15:18

When I try to compile it, I get the following error: https://prnt.sc/n2nbwe
.
.
P̵̧̝̬̤̖̳̞͙̩̪̑͂̂̑̎͂̎̌̕e̵̲͎͕̰̜̒̀̈̾͊͛̕s̡̛̻̻̜̞͍̗̋̈́̇̀́̄͋̀ş̴̱̰͈̺̝̲̝͉̎̈́͛̽̈́͞ȋ̢̞̠͙̦̩̊͗̔̎͂̾̋͌͂m̥͔͙̯̳͕̳̗̰͋̄̊̀͑͝ͅȉ̵̙̼̣̯̟̪͔̔̽̎̀̆̊̓͒͟͡ş̖̤̖͕̺̫͇̑̔̅̉͜͞t̴͙̠͎̩͉̻̀͑̽̇̆̎̀̆͝͞į̷̙̦̳͍̉͒̋̍̐̃́͠͡͝ͅc̼̞̭̱̓́̏̂̄̉̚̚̚͢͠ͅ t̰̠̝̱̠̱̓̇̓̂̋̓̑̽̕͟͝h̶͔̰̗̳͎̮͉̼̪̽͑̅͒̎͟i̸̲͖̟͋̈́̓͐͆̓̔͒͜͜ṉ̴̨̛̫̭̙̀͋̓̓̾̕͡ͅḱ̢̧̛̝̘̺̽̀͊̕ĭ̴̛̟͚̹̱̙́͋̅̃͗̕̕͜n̡̘͖̙͙̗͇̊̈́̔̀̑̀̓̌̾̅g̶̛͕͖̲͈̗̘̮̐̓̆̃̐̔̚
.
.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Happy Hour

Мнение от OciXCrom » 25 Мар 2019, 17:17

The settings are in the beginning of the file.

Код за потвърждение: Избери целия код

#include <amxmodx>

// The VIP flags that players will receive during happy hour.
new const VIP_FLAGS[] = "bmnop"

// Happy hour start time. For example, 23 will be 23:00.
const HAPPY_HOUR_START = 23

// Happy hour end time. For example, 3 will be 03:00.
const HAPPY_HOUR_END = 3

// Add flags after this many seconds upon player joins.
const Float:DELAY_AFTER_CONNECT = 2.0

new g_iFlags

public plugin_init()
{
	register_plugin("VIP Happy Hour", "1.0", "OciXCrom")
	g_iFlags = read_flags(VIP_FLAGS)
}

public client_putinserver(id)
{
	if(is_happy_hour(HAPPY_HOUR_START, HAPPY_HOUR_END))
	{
		set_task(DELAY_AFTER_CONNECT, "set_vip_flags", id)
	}
}

public set_vip_flags(id)
{
	set_user_flags(id, g_iFlags)
	remove_user_flags(id, ADMIN_USER)
}

bool:is_happy_hour(const iStart, const iEnd)
{
    static iHour; time(iHour)
    return bool:(iStart < iEnd ? (iStart <= iHour < iEnd) : (iStart <= iHour || iHour < iEnd))
}

Аватар
Shopkeh
Извън линия
Foreigner
Foreigner
Мнения: 5
Регистриран на: 02 Май 2018, 05:58
Местоположение: Behind you!
Се отблагодари: 1 път
Обратна връзка:

Happy Hour

Мнение от Shopkeh » 25 Мар 2019, 18:34

Thank you very much, as always! :)
.
.
P̵̧̝̬̤̖̳̞͙̩̪̑͂̂̑̎͂̎̌̕e̵̲͎͕̰̜̒̀̈̾͊͛̕s̡̛̻̻̜̞͍̗̋̈́̇̀́̄͋̀ş̴̱̰͈̺̝̲̝͉̎̈́͛̽̈́͞ȋ̢̞̠͙̦̩̊͗̔̎͂̾̋͌͂m̥͔͙̯̳͕̳̗̰͋̄̊̀͑͝ͅȉ̵̙̼̣̯̟̪͔̔̽̎̀̆̊̓͒͟͡ş̖̤̖͕̺̫͇̑̔̅̉͜͞t̴͙̠͎̩͉̻̀͑̽̇̆̎̀̆͝͞į̷̙̦̳͍̉͒̋̍̐̃́͠͡͝ͅc̼̞̭̱̓́̏̂̄̉̚̚̚͢͠ͅ t̰̠̝̱̠̱̓̇̓̂̋̓̑̽̕͟͝h̶͔̰̗̳͎̮͉̼̪̽͑̅͒̎͟i̸̲͖̟͋̈́̓͐͆̓̔͒͜͜ṉ̴̨̛̫̭̙̀͋̓̓̾̕͡ͅḱ̢̧̛̝̘̺̽̀͊̕ĭ̴̛̟͚̹̱̙́͋̅̃͗̕̕͜n̡̘͖̙͙̗͇̊̈́̔̀̑̀̓̌̾̅g̶̛͕͖̲͈̗̘̮̐̓̆̃̐̔̚
.
.

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 34 госта