Telemenu: Use of float version of origin natives instead of integer version

This commit is contained in:
Freeman-AM 2014-05-18 15:23:40 +02:00
parent aa00fc6f63
commit d2f909981a

View File

@ -34,13 +34,14 @@
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
new g_menuPosition[33]
new g_menuPlayers[33][32]
new g_menuPlayersNum[33]
new g_menuOption[33] = {-1, ...}
new g_menuOrgin[33][3]
#define MAX_PLAYERS 32 + 1
new g_menuPosition[MAX_PLAYERS]
new g_menuPlayers[MAX_PLAYERS][32]
new g_menuPlayersNum[MAX_PLAYERS]
new g_menuOption[MAX_PLAYERS] = {-1, ...}
new Float:g_menuOrigin[MAX_PLAYERS][3]
new g_coloredMenus
public plugin_init()
@ -68,7 +69,7 @@ public actionTelMenu(id, key)
if (g_menuOption[id] < 0) /* unlocking position for the first time */
g_menuOption[id] = 0
get_user_origin(id, g_menuOrgin[id])
pev(id, pev_origin, g_menuOrigin[id])
displayTelMenu(id, g_menuPosition[id])
}
case 8: displayTelMenu(id, ++g_menuPosition[id])
@ -89,12 +90,12 @@ public actionTelMenu(id, key)
if (g_menuOption[id] > 0)
{
set_user_origin(player, g_menuOrgin[id])
engfunc(EngFunc_SetOrigin, player, g_menuOrigin[id])
} else {
new origin[3]
new Float:f_origin[3]
get_user_origin(id, origin)
set_user_origin(player, origin)
pev(id, pev_origin, f_origin)
engfunc(EngFunc_SetOrigin, player, f_origin)
}
new authid[32], authid2[32], name[32]
@ -105,7 +106,7 @@ public actionTelMenu(id, key)
log_amx("Cmd: ^"%s<%d><%s><>^" teleport ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, name2, get_user_userid(player), authid2)
show_activity_key("ADMIN_TELEPORT_1", "ADMIN_TELEPORT_2", name, name2);
show_activity_key("ADMIN_TELEPORT_1", "ADMIN_TELEPORT_2", name, name2)
displayTelMenu(id, g_menuPosition[id])
}
@ -164,7 +165,7 @@ displayTelMenu(id, pos)
if (g_menuOption[id] > 0) // 1
{
keys |= MENU_KEY_7
len += format(menuBody[len], 511-len, "^n7. To location: %d %d %d^n", g_menuOrgin[id][0], g_menuOrgin[id][1], g_menuOrgin[id][2])
len += format(menuBody[len], 511-len, "^n7. To location: %.0f %.0f %.0f^n", g_menuOrigin[id][0], g_menuOrigin[id][1], g_menuOrigin[id][2])
}
else if (g_menuOption[id]) // -1
{