Mensajes: 299
Temas: 44
Registro en: Aug 2016
Reputación:
2
hola hace un tiempo vi en un servidor un menu que se le podian ver los fps que tenia el jugador y me llamo la atencion le pregunte al dueño y dijo que andaba rondando la verdad que llevo harto rato trantando de buscarlo y no lo encuentro así que si ustedes saben cual es me lo pudieran pasar porfavor, gracias.
Mensajes: 1,072
Temas: 57
Registro en: Feb 2016
Reputación:
8
Mensajes: 926
Temas: 64
Registro en: Feb 2014
Reputación:
9
01/08/2019, 04:51 PM
(Última modificación: 01/08/2019, 04:51 PM por Cr3470r. Edited 2 times in total.)
(01/08/2019, 04:08 PM)Niper.-. escribió: https://amxmodx-es.com/Thread-SpecInfo-F...2#pid29322
Ahí tenes
A eso llamas obtener fps? ... ESTO es obtener fps:
Código PHP: new Float:gF_ClientFPS[33]
register_forward ( FM_CmdStart, "Fw_CmdStart", 0 )
public Fw_CmdStart ( const id, const uc_handle, const seed ) { static MSec MSec = get_uc ( uc_handle, UC_Msec )
gF_ClientFPS[id] = ( 1 / ( MSec * 0.001 ) ) }
Igual una verga el método, pero suele ser mucho más preciso ...
(15/12/2020, 07:06 PM)Mario AR. escribió: Cuando tu acatante conozca de tu nuevo puerto, te volverá a atacar
Mensajes: 299
Temas: 44
Registro en: Aug 2016
Reputación:
2
(01/08/2019, 04:51 PM)Cr3470r escribió: (01/08/2019, 04:08 PM)Niper.-. escribió: https://amxmodx-es.com/Thread-SpecInfo-F...2#pid29322
Ahí tenes
A eso llamas obtener fps? ... ESTO es obtener fps:
Código PHP: new Float:gF_ClientFPS[33]
register_forward ( FM_CmdStart, "Fw_CmdStart", 0 )
public Fw_CmdStart ( const id, const uc_handle, const seed ) { static MSec MSec = get_uc ( uc_handle, UC_Msec )
gF_ClientFPS[id] = ( 1 / ( MSec * 0.001 ) ) }
Igual una verga el método, pero suele ser mucho más preciso ...
y eso como lo puedo implementar en un menu para que muestre los fps ?
Mensajes: 1,072
Temas: 57
Registro en: Feb 2016
Reputación:
8
Proba así
Código PHP: #include <amxmodx> #include <amxmisc> #include <fakemeta>
new g_fps[33]; new g_maxplayers;
public plugin_init() { register_plugin("ver", "fps", "xd"); register_clcmd("say /verfps", "VerFps"); register_forward(FM_CmdStart, "fw_CmdStart"); g_maxplayers = get_maxplayers(); }
public client_putinserver(id) g_fps[id] = EOS;
public fw_CmdStart(id, uc_handle) { static fps; fps = floatround(1 / (get_uc(uc_handle, UC_Msec) * 0.001)); g_fps[id] = fps;
}
public VerFps(id) { new menu = menu_create("Ver FPS Jugadores: ", "HandlerVerFps"); for(new id2 = 1; id2 <= g_maxplayers; id2++) { if(is_user_connected(id2)) { new Opcion[100]; new Name[32]; get_user_name(id2, Name, charsmax(Name)), new szId[3]; num_to_str(id2, szId, 2); formatex(Opcion, charsmax(Id2), "%s \y(%d FPS)", Name, g_fps[id2]); menu_additem(menu, Opcion, szId, 0); } } menu_display(id, menu, 0); }
public HandlerVerFps(id, menu, item) menu_destroy(menu);
Mensajes: 299
Temas: 44
Registro en: Aug 2016
Reputación:
2
No compila :
Cita:Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2013 ITB CompuPhase, AMX Mod X Team
C:\Users\Lenovo\Desktop\menu.sma(34 -- 35) : error 029: invalid expression, assumed zero
C:\Users\Lenovo\Desktop\menu.sma(35) : error 017: undefined symbol "szId"
C:\Users\Lenovo\Desktop\menu.sma(35) : warning 215: expression has no effect
C:\Users\Lenovo\Desktop\menu.sma(35) : error 001: expected token: ";", but found "]"
C:\Users\Lenovo\Desktop\menu.sma(35) : fatal error 107: too many error messages on one line
Compilation aborted.
4 Errors.
Could not locate output file C:\Users\Mati\Desktop//menu.amx (compile failed).
[Finished in 0.5s]
Mensajes: 3,238
Temas: 47
Registro en: Feb 2015
Reputación:
34
(02/08/2019, 10:57 PM)+rdNN! escribió: No compila :
Cita:Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2013 ITB CompuPhase, AMX Mod X Team
C:\Users\Lenovo\Desktop\menu.sma(34 -- 35) : error 029: invalid expression, assumed zero
C:\Users\Lenovo\Desktop\menu.sma(35) : error 017: undefined symbol "szId"
C:\Users\Lenovo\Desktop\menu.sma(35) : warning 215: expression has no effect
C:\Users\Lenovo\Desktop\menu.sma(35) : error 001: expected token: ";", but found "]"
C:\Users\Lenovo\Desktop\menu.sma(35) : fatal error 107: too many error messages on one line
Compilation aborted.
4 Errors.
Could not locate output file C:\Users\Mati\Desktop//menu.amx (compile failed).
[Finished in 0.5s]
Código PHP: new Name[32]; get_user_name(id2, Name, charsmax(Name)), -> new Name[32]; get_user_name(id2, Name, charsmax(Name))
Mensajes: 1,072
Temas: 57
Registro en: Feb 2016
Reputación:
8
Proba ahí:
Código PHP: #include <amxmodx> #include <amxmisc> #include <fakemeta>
new g_fps[33]; new g_maxplayers;
public plugin_init() { register_plugin("ver", "fps", "xd"); register_clcmd("say /verfps", "VerFps"); register_forward(FM_CmdStart, "fw_CmdStart"); g_maxplayers = get_maxplayers(); }
public client_putinserver(id) g_fps[id] = EOS;
public fw_CmdStart(id, uc_handle) { static fps; fps = floatround(1 / (get_uc(uc_handle, UC_Msec) * 0.001)); g_fps[id] = fps;
}
public VerFps(id) { new menu = menu_create("Ver FPS Jugadores: ", "HandlerVerFps"); for(new id2 = 1; id2 <= g_maxplayers; id2++) { if(is_user_connected(id2)) { new Opcion[100]; new Name[32]; get_user_name(id2, Name, charsmax(Name)); new szId[3]; num_to_str(id2, szId, 2); formatex(Opcion, charsmax(Opcion), "%s \y(%d FPS)", Name, g_fps[id2]); menu_additem(menu, Opcion, szId, 0); } } menu_display(id, menu, 0); }
public HandlerVerFps(id, menu, item) menu_destroy(menu);
Mensajes: 299
Temas: 44
Registro en: Aug 2016
Reputación:
2
03/08/2019, 08:22 PM
(Última modificación: 04/08/2019, 12:09 AM por +rdNN!. Edited 2 times in total.)
Muchas gracias , ahora solo falta que el menu haga un actualizacion de fps cada 5 segundos para tener los fps exactos pero eso lo haré yo por mi parte.
|