Thread: [Solved] native
View Single Post
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 03-13-2021 , 08:33   Re: native
#4

Do you really need a native for this? I think something similar to amx_plmenu_bantimes would be a better choice in your case. Take a look at plmenu.sma

Code:
new Array:g_bantimes;

Code:
g_bantimes = ArrayCreate(); // Load up the old default values ArrayPushCell(g_bantimes, 0); ArrayPushCell(g_bantimes, 5); ArrayPushCell(g_bantimes, 10); ArrayPushCell(g_bantimes, 15); ArrayPushCell(g_bantimes, 30); ArrayPushCell(g_bantimes, 45); ArrayPushCell(g_bantimes, 60); register_srvcmd("amx_plmenu_bantimes", "plmenu_setbantimes");

Code:
public plmenu_setbantimes() {     new buff[32];     new args = read_argc();     if (args <= 1)     {         server_print("usage: amx_plmenu_bantimes <time1> [time2] [time3] ...");         server_print("   use time of 0 for permanent.");         return;     }     ArrayClear(g_bantimes);     for (new i = 1; i < args; i++)     {         read_argv(i, buff, charsmax(buff));         ArrayPushCell(g_bantimes, str_to_num(buff));     } }
__________________









Last edited by CrazY.; 03-13-2021 at 08:34.
CrazY. is offline