AYUDA ERROR AL COMPILAR PLUGIN
#1
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(sIpcharsmax(sIp), ip);
 
strtok(sIpg_PlayerIp[id], charsmax(g_PlayerIp[]), sPortcharsmax(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(iSysTimeiYeariMonthiDayiHouriMinuteiSecond);
 
formatex(sDatecharsmax(sDate), "%d-%02d-%02d a las %02d:%02d:%02d"iYeariMonthiDayiHouriMinuteiSecond);

 
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.
Responder
#2
usa amxx 1.9.0

o

#define MAX_IP_WITH_PORT_LENGTH 22
#define MAX_PLAYERS 32
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#3
(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
Responder
#4
(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(sIpcharsmax(sIp), ip);
 
strtok(sIpg_PlayerIp[id], charsmax(g_PlayerIp[]), sPortcharsmax(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(iSysTimeiYeariMonthiDayiHouriMinuteiSecond);
 
formatex(sDatecharsmax(sDate), "%d-%02d-%02d a las %02d:%02d:%02d"iYeariMonthiDayiHouriMinuteiSecond);

 
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  Approved

Responder
#5
(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(sIpcharsmax(sIp), ip);
 
strtok(sIpg_PlayerIp[id], charsmax(g_PlayerIp[]), sPortcharsmax(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(iSysTimeiYeariMonthiDayiHouriMinuteiSecond);
 
formatex(sDatecharsmax(sDate), "%d-%02d-%02d a las %02d:%02d:%02d"iYeariMonthiDayiHouriMinuteiSecond);

 
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
Responder
#6
si usas amxx 1.8.2 o menor lo de meliodas no te va a compilar Whatever

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(sIpcharsmax(sIp), ip);
    
strtok(sIpg_PlayerIp[id], charsmax(g_PlayerIp[]), sPortcharsmax(sPort), ':');
}

public 
client_authorized(id
{
    new 
authidMAX_AUTHID_LENGTH ];
    
get_user_authididauthidcharsmaxauthid ) )

    
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(iSysTimeiYeariMonthiDayiHouriMinuteiSecond);
    
formatex(sDatecharsmax(sDate), "%d-%02d-%02d a las %02d:%02d:%02d"iYeariMonthiDayiHouriMinuteiSecond);

    
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);

[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#7
(09/11/2020, 04:09 PM)Hypnotize escribió: si usas amxx 1.8.2 o menor lo de meliodas no te va a compilar Whatever

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(sIpcharsmax(sIp), ip);
    strtok(sIpg_PlayerIp[id], charsmax(g_PlayerIp[]), sPortcharsmax(sPort), ':');
}

public 
client_authorized(id
{
    new authidMAX_AUTHID_LENGTH ];
    get_user_authididauthidcharsmaxauthid ) )

    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(iSysTimeiYeariMonthiDayiHouriMinuteiSecond);
    formatex(sDatecharsmax(sDate), "%d-%02d-%02d a las %02d:%02d:%02d"iYeariMonthiDayiHouriMinuteiSecond);

    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
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)