Change variable names for consistency

This commit is contained in:
OciXCrom 2018-09-13 15:25:57 +02:00
parent 38cef18a8b
commit e96533b974

View File

@ -28,13 +28,13 @@ new Float:g_amx_scrollmsg_x_start_pos;
new Float:g_amx_scrollmsg_x_end_pos; new Float:g_amx_scrollmsg_x_end_pos;
new Float:g_amx_scrollmsg_y_pos; new Float:g_amx_scrollmsg_y_pos;
new g_startPos; new g_start_pos;
new g_endPos; new g_end_pos;
new g_scrollMsg[SCROLLMSG_SIZE]; new g_scroll_msg[SCROLLMSG_SIZE];
new g_displayMsg[SCROLLMSG_SIZE]; new g_display_msg[SCROLLMSG_SIZE];
new Float:g_xPos; new Float:g_x_pos;
new g_Length; new g_length;
new g_Frequency; new g_frequency;
public plugin_init() public plugin_init()
{ {
@ -59,31 +59,31 @@ public plugin_init()
public showMsg() public showMsg()
{ {
new a = g_startPos, i = 0; new a = g_start_pos, i = 0;
while (a < g_endPos) while (a < g_end_pos)
{ {
g_displayMsg[i++] = g_scrollMsg[a++]; g_display_msg[i++] = g_scroll_msg[a++];
} }
g_displayMsg[i] = 0; g_display_msg[i] = 0;
if (g_endPos < g_Length) if (g_end_pos < g_length)
{ {
g_endPos++; g_end_pos++;
} }
if (g_xPos > g_amx_scrollmsg_x_start_pos) if (g_x_pos > g_amx_scrollmsg_x_start_pos)
{ {
g_xPos -= g_amx_scrollmsg_x_move_amount; g_x_pos -= g_amx_scrollmsg_x_move_amount;
} }
else else
{ {
g_startPos++; g_start_pos++;
g_xPos = g_amx_scrollmsg_x_start_pos; g_x_pos = g_amx_scrollmsg_x_start_pos;
} }
set_hudmessage(g_amx_scrollmsg_color_red, g_amx_scrollmsg_color_green, g_amx_scrollmsg_color_blue, g_xPos, g_amx_scrollmsg_y_pos, 0, g_amx_scrollmsg_speed, g_amx_scrollmsg_speed, 0.05, 0.05, 2); set_hudmessage(g_amx_scrollmsg_color_red, g_amx_scrollmsg_color_green, g_amx_scrollmsg_color_blue, g_x_pos, g_amx_scrollmsg_y_pos, 0, g_amx_scrollmsg_speed, g_amx_scrollmsg_speed, 0.05, 0.05, 2);
if(g_amx_scrollmsg_only_dead) if(g_amx_scrollmsg_only_dead)
{ {
@ -92,54 +92,54 @@ public showMsg()
for(new i; i < pnum; i++) for(new i; i < pnum; i++)
{ {
show_hudmessage(players[i], g_displayMsg); show_hudmessage(players[i], g_display_msg);
} }
} }
else else
{ {
show_hudmessage(0, "%s", g_displayMsg); show_hudmessage(0, "%s", g_display_msg);
} }
} }
public msgInit() public msgInit()
{ {
g_endPos = 1; g_end_pos = 1;
g_startPos = 0; g_start_pos = 0;
g_xPos = g_amx_scrollmsg_x_end_pos; g_x_pos = g_amx_scrollmsg_x_end_pos;
replace(g_scrollMsg, charsmax(g_scrollMsg), "%hostname%", g_hostname); replace(g_scroll_msg, charsmax(g_scroll_msg), "%hostname%", g_hostname);
g_Length = strlen(g_scrollMsg); g_length = strlen(g_scroll_msg);
set_task(g_amx_scrollmsg_speed, "showMsg", SCROLLMSG_TASK, "", 0, "a", g_Length + 48); set_task(g_amx_scrollmsg_speed, "showMsg", SCROLLMSG_TASK, "", 0, "a", g_length + 48);
client_print(0, print_console, "%s", g_scrollMsg); client_print(0, print_console, "%s", g_scroll_msg);
} }
public setMessage() public setMessage()
{ {
remove_task(SCROLLMSG_TASK); /* remove current messaging */ remove_task(SCROLLMSG_TASK); /* remove current messaging */
read_argv(1, g_scrollMsg, charsmax(g_scrollMsg)); read_argv(1, g_scroll_msg, charsmax(g_scroll_msg));
g_Length = strlen(g_scrollMsg); g_length = strlen(g_scroll_msg);
new mytime[32]; new mytime[32];
read_argv(2, mytime, charsmax(mytime)); read_argv(2, mytime, charsmax(mytime));
g_Frequency = str_to_num(mytime); g_frequency = str_to_num(mytime);
if (g_Frequency > 0) if (g_frequency > 0)
{ {
new minimal = floatround((g_Length + 48) * (g_amx_scrollmsg_speed + 0.1)); new minimal = floatround((g_length + 48) * (g_amx_scrollmsg_speed + 0.1));
if (g_Frequency < minimal) if (g_frequency < minimal)
{ {
server_print("%L", LANG_SERVER, "MIN_FREQ", minimal); server_print("%L", LANG_SERVER, "MIN_FREQ", minimal);
g_Frequency = minimal; g_frequency = minimal;
} }
server_print("%L", LANG_SERVER, "MSG_FREQ", g_Frequency / 60, g_Frequency % 60); server_print("%L", LANG_SERVER, "MSG_FREQ", g_frequency / 60, g_frequency % 60);
set_task(float(g_Frequency), "msgInit", SCROLLMSG_TASK, "", 0, "b"); set_task(float(g_frequency), "msgInit", SCROLLMSG_TASK, "", 0, "b");
} }
else else
{ {