Mensajes: 242
Temas: 106
Registro en: Apr 2020
Reputación:
0
TENGO ESTE PLUGIN
pero al compilar me tira error y no se como solucionarlo.
Código PHP: #include <amxmodx> #include <unixtime>
new const __PLUGIN_NAME[] = "Loggin in Connect"; new const __PLUGIN_VERSION[] = "v0.1 BETA"; new const __PLUGIN_AUTHOR[] = "Atsel.";
new const __LOG_FILE[] = "players.log";
new g_PlayerName[MAX_PLAYERS + 1][MAX_NAME_LENGTH]; new g_PlayerIp[MAX_PLAYERS + 1][MAX_IP_LENGTH]; new g_PlayerSteamId[MAX_PLAYERS + 1][MAX_AUTHID_LENGTH];
public plugin_init() { register_plugin(__PLUGIN_NAME, __PLUGIN_VERSION, __PLUGIN_AUTHOR); }
public client_connectex(id, const name[], const ip[], reason[128]) { copy(g_PlayerName[id], charsmax(g_PlayerName[]), name);
new sIp[MAX_IP_WITH_PORT_LENGTH]; new sPort[8];
copy(sIp, charsmax(sIp), ip); strtok(sIp, g_PlayerIp[id], charsmax(g_PlayerIp[]), sPort, charsmax(sPort), ':'); }
public client_authorized(id, const authid[]) { copy(g_PlayerSteamId[id], charsmax(g_PlayerSteamId[]), authid); }
public client_putinserver(id) { saveInfoPlayers(id); }
public saveInfoPlayers(const id) { new iSysTime = get_systime(); new iYear; new iMonth; new iDay; new iHour; new iMinute; new iSecond; new sDate[32];
unix_to_time(iSysTime, iYear, iMonth, iDay, iHour, iMinute, iSecond); formatex(sDate, charsmax(sDate), "%d-%02d-%02d a las %02d:%02d:%02d", iYear, iMonth, iDay, iHour, iMinute, iSecond);
log_to_file(__LOG_FILE, "Jugador ingresado al servidor ~~ <%s><%s><%s> ~~ <Fecha y hora: %s>", g_PlayerName[id], g_PlayerIp[id], g_PlayerSteamId[id], sDate); }
ese el plugin y ahora paso el error
Error: Undefined symbol "MAX_PLAYERS" on line 10
Error: Invalid array size (negative or zero) on line 10
Error: Undefined symbol "MAX_PLAYERS" on line 11
Error: Invalid array size (negative or zero) on line 11
Error: Undefined symbol "MAX_PLAYERS" on line 12
Error: Invalid array size (negative or zero) on line 12
Warning: Indeterminate array size in "sizeof" expression (symbol "") on line 19
Error: Undefined symbol "MAX_IP_WITH_PORT_LENGTH" on line 21
Error: Invalid array size (negative or zero) on line 21
Error: Empty statement on line 21
Error: Too many error messages on one line on line
se agradece la ayuda.
Mensajes: 7,178
Temas: 93
Registro en: Aug 2014
Reputación:
63
09/11/2020, 03:38 PM
(Última modificación: 09/11/2020, 03:40 PM por Hinami. Edited 1 time in total.)
usa amxx 1.9.0
o
#define MAX_IP_WITH_PORT_LENGTH 22
#define MAX_PLAYERS 32
Mensajes: 242
Temas: 106
Registro en: Apr 2020
Reputación:
0
(09/11/2020, 03:38 PM)Hypnotize escribió: usa amxx 1.9.0
o
#define MAX_IP_WITH_PORT_LENGTH 22
#define MAX_PLAYERS 32
no uso 1.9.0
podrias reemplazarlo en el plugin.
lo quise hacer yo y me tira error.
gracias
Mensajes: 200
Temas: 56
Registro en: Oct 2020
Reputación:
1
09/11/2020, 04:00 PM
(Última modificación: 09/11/2020, 04:02 PM por Meliodas. Edited 1 time in total.)
(09/11/2020, 03:56 PM)cahervar escribió: no uso 1.9.0
podrias reemplazarlo en el plugin.
lo quise hacer yo y me tira error.
gracias
Código PHP: #include <amxmodx> #include <unixtime>
new const __PLUGIN_NAME[] = "Loggin in Connect"; new const __PLUGIN_VERSION[] = "v0.1 BETA"; new const __PLUGIN_AUTHOR[] = "Atsel.";
new const __LOG_FILE[] = "players.log";
new g_PlayerName[32]; new g_PlayerIp[32]; new g_PlayerSteamId[32];
public plugin_init() { register_plugin(__PLUGIN_NAME, __PLUGIN_VERSION, __PLUGIN_AUTHOR); }
public client_connectex(id, const name[], const ip[], reason[128]) { copy(g_PlayerName[id], charsmax(g_PlayerName[]), name);
new sIp[32]; new sPort[8];
copy(sIp, charsmax(sIp), ip); strtok(sIp, g_PlayerIp[id], charsmax(g_PlayerIp[]), sPort, charsmax(sPort), ':'); }
public client_authorized(id, const authid[]) { copy(g_PlayerSteamId[id], charsmax(g_PlayerSteamId[]), authid); }
public client_putinserver(id) { saveInfoPlayers(id); }
public saveInfoPlayers(const id) { new iSysTime = get_systime(); new iYear; new iMonth; new iDay; new iHour; new iMinute; new iSecond; new sDate[32];
unix_to_time(iSysTime, iYear, iMonth, iDay, iHour, iMinute, iSecond); formatex(sDate, charsmax(sDate), "%d-%02d-%02d a las %02d:%02d:%02d", iYear, iMonth, iDay, iHour, iMinute, iSecond);
log_to_file(__LOG_FILE, "Jugador ingresado al servidor ~~ <%s><%s><%s> ~~ <Fecha y hora: %s>", g_PlayerName[id], g_PlayerIp[id], g_PlayerSteamId[id], sDate); }
Pawn Básico no critiquen xD
Mensajes: 242
Temas: 106
Registro en: Apr 2020
Reputación:
0
(09/11/2020, 04:00 PM)Meliodas escribió: Código PHP: #include <amxmodx> #include <unixtime>
new const __PLUGIN_NAME[] = "Loggin in Connect"; new const __PLUGIN_VERSION[] = "v0.1 BETA"; new const __PLUGIN_AUTHOR[] = "Atsel.";
new const __LOG_FILE[] = "players.log";
new g_PlayerName[32]; new g_PlayerIp[32]; new g_PlayerSteamId[32];
public plugin_init() { register_plugin(__PLUGIN_NAME, __PLUGIN_VERSION, __PLUGIN_AUTHOR); }
public client_connectex(id, const name[], const ip[], reason[128]) { copy(g_PlayerName[id], charsmax(g_PlayerName[]), name);
new sIp[32]; new sPort[8];
copy(sIp, charsmax(sIp), ip); strtok(sIp, g_PlayerIp[id], charsmax(g_PlayerIp[]), sPort, charsmax(sPort), ':'); }
public client_authorized(id, const authid[]) { copy(g_PlayerSteamId[id], charsmax(g_PlayerSteamId[]), authid); }
public client_putinserver(id) { saveInfoPlayers(id); }
public saveInfoPlayers(const id) { new iSysTime = get_systime(); new iYear; new iMonth; new iDay; new iHour; new iMinute; new iSecond; new sDate[32];
unix_to_time(iSysTime, iYear, iMonth, iDay, iHour, iMinute, iSecond); formatex(sDate, charsmax(sDate), "%d-%02d-%02d a las %02d:%02d:%02d", iYear, iMonth, iDay, iHour, iMinute, iSecond);
log_to_file(__LOG_FILE, "Jugador ingresado al servidor ~~ <%s><%s><%s> ~~ <Fecha y hora: %s>", g_PlayerName[id], g_PlayerIp[id], g_PlayerSteamId[id], sDate); }
salta este error
Error: Function heading differs from prototype on line 28
Mensajes: 7,178
Temas: 93
Registro en: Aug 2014
Reputación:
63
si usas amxx 1.8.2 o menor lo de meliodas no te va a compilar
Proba ahí, yo no tengo el include unixtime & no me lo voy a descargar
Código PHP: #include <amxmodx> #include <unixtime>
#define MAX_IP_WITH_PORT_LENGTH 22 #define MAX_NAME_LENGTH 33 #define MAX_PLAYERS 32 #define MAX_AUTHID_LENGTH 64 #define MAX_IP_LENGTH 16
new const __PLUGIN_NAME[] = "Loggin in Connect"; new const __PLUGIN_VERSION[] = "v0.1 BETA"; new const __PLUGIN_AUTHOR[] = "Atsel.";
new const __LOG_FILE[] = "players.log";
new g_PlayerName[MAX_PLAYERS + 1][MAX_NAME_LENGTH]; new g_PlayerIp[MAX_PLAYERS + 1][MAX_IP_LENGTH]; new g_PlayerSteamId[MAX_PLAYERS + 1][MAX_AUTHID_LENGTH];
public plugin_init() { register_plugin(__PLUGIN_NAME, __PLUGIN_VERSION, __PLUGIN_AUTHOR); }
public client_connectex(id, const name[], const ip[], reason[128]) { copy(g_PlayerName[id], charsmax(g_PlayerName[]), name);
new sIp[MAX_IP_WITH_PORT_LENGTH]; new sPort[8];
copy(sIp, charsmax(sIp), ip); strtok(sIp, g_PlayerIp[id], charsmax(g_PlayerIp[]), sPort, charsmax(sPort), ':'); }
public client_authorized(id) { new authid[ MAX_AUTHID_LENGTH ]; get_user_authid( id, authid, charsmax( authid ) )
copy(g_PlayerSteamId[id], charsmax(g_PlayerSteamId[]), authid); }
public client_putinserver(id) { saveInfoPlayers(id); }
public saveInfoPlayers(const id) { new iSysTime = get_systime(); new iYear; new iMonth; new iDay; new iHour; new iMinute; new iSecond; new sDate[32];
unix_to_time(iSysTime, iYear, iMonth, iDay, iHour, iMinute, iSecond); formatex(sDate, charsmax(sDate), "%d-%02d-%02d a las %02d:%02d:%02d", iYear, iMonth, iDay, iHour, iMinute, iSecond);
log_to_file(__LOG_FILE, "Jugador ingresado al servidor ~~ <%s><%s><%s> ~~ <Fecha y hora: %s>", g_PlayerName[id], g_PlayerIp[id], g_PlayerSteamId[id], sDate); }
Mensajes: 242
Temas: 106
Registro en: Apr 2020
Reputación:
0
(09/11/2020, 04:09 PM)Hypnotize escribió: si usas amxx 1.8.2 o menor lo de meliodas no te va a compilar
Proba ahí, yo no tengo el include unixtime & no me lo voy a descargar
Código PHP: #include <amxmodx> #include <unixtime>
#define MAX_IP_WITH_PORT_LENGTH 22 #define MAX_NAME_LENGTH 33 #define MAX_PLAYERS 32 #define MAX_AUTHID_LENGTH 64 #define MAX_IP_LENGTH 16
new const __PLUGIN_NAME[] = "Loggin in Connect"; new const __PLUGIN_VERSION[] = "v0.1 BETA"; new const __PLUGIN_AUTHOR[] = "Atsel.";
new const __LOG_FILE[] = "players.log";
new g_PlayerName[MAX_PLAYERS + 1][MAX_NAME_LENGTH]; new g_PlayerIp[MAX_PLAYERS + 1][MAX_IP_LENGTH]; new g_PlayerSteamId[MAX_PLAYERS + 1][MAX_AUTHID_LENGTH];
public plugin_init() { register_plugin(__PLUGIN_NAME, __PLUGIN_VERSION, __PLUGIN_AUTHOR); }
public client_connectex(id, const name[], const ip[], reason[128]) { copy(g_PlayerName[id], charsmax(g_PlayerName[]), name);
new sIp[MAX_IP_WITH_PORT_LENGTH]; new sPort[8];
copy(sIp, charsmax(sIp), ip); strtok(sIp, g_PlayerIp[id], charsmax(g_PlayerIp[]), sPort, charsmax(sPort), ':'); }
public client_authorized(id) { new authid[ MAX_AUTHID_LENGTH ]; get_user_authid( id, authid, charsmax( authid ) )
copy(g_PlayerSteamId[id], charsmax(g_PlayerSteamId[]), authid); }
public client_putinserver(id) { saveInfoPlayers(id); }
public saveInfoPlayers(const id) { new iSysTime = get_systime(); new iYear; new iMonth; new iDay; new iHour; new iMinute; new iSecond; new sDate[32];
unix_to_time(iSysTime, iYear, iMonth, iDay, iHour, iMinute, iSecond); formatex(sDate, charsmax(sDate), "%d-%02d-%02d a las %02d:%02d:%02d", iYear, iMonth, iDay, iHour, iMinute, iSecond);
log_to_file(__LOG_FILE, "Jugador ingresado al servidor ~~ <%s><%s><%s> ~~ <Fecha y hora: %s>", g_PlayerName[id], g_PlayerIp[id], g_PlayerSteamId[id], sDate); }
gracias. lo pude compilar sin problemas
|