[17:38:04] Incoming connection: 127.0.0.1:58125 [17:38:04] Incoming connection: 127.0.0.1:58126 [17:38:04] Incoming connection: 127.0.0.1:58127 [17:38:04] Incoming connection: 127.0.0.1:58128 [17:38:04] Incoming connection: 127.0.0.1:58129 [17:38:04] Incoming connection: 127.0.0.1:58130 [17:38:05] Incoming connection: 127.0.0.1:58131 [17:38:05] Incoming connection: 127.0.0.1:58132 [17:38:05] Incoming connection: 127.0.0.1:58133 [17:38:05] Incoming connection: 127.0.0.1:58134 [17:38:07] [join] bRUNO_(QlP4 has joined the server (100:127.0.0.1) [17:38:07] [join] bRUNO_NQw)Y has joined the server (101:127.0.0.1) [17:38:07] 101 Entrou em menos de 2 segundos [17:38:07] [join] bRUNO_yq8OD has joined the server (102:127.0.0.1) [17:38:07] 102 Entrou em menos de 2 segundos [17:38:07] BOT: ID -> 102 IP -> 127.0.0. [17:38:08] [part] bRUNO_yq8OD has left the server (102:2) |
Agora funcionou
![]() PHP код:
|
#include a_samp
#if !defined varGet
#define varGet(%0) getproperty(0,%0)
#endif
// https://sampforum.blast.hk/showthread.php?pid=1925909#pid1925909
#if !defined varSet
#define varSet(%0,%1) setproperty(0, %0, %1)
#endif
stock botGetIP[24];
#define IsPlayerBot(%0)\
GetPlayerPing(%0) == 65535 && (gettime() - varGet((GetPlayerIp(%0, botGetIP, sizeof botGetIP), botGetIP)) > 5)
public OnPlayerConnect(playerid) {
if(IsPlayerNPC(playerid)) return false;
static
playerip[24]
;
GetPlayerIp(playerid, playerip, 24);
if(gettime() - varGet(playerip) < 2) {
strcat(playerip, "di_S");
if(gettime() - varGet(playerip) < 3) {
return false;
}
printf("%d Entrou em menos de 2 segundos", playerid);
GetPlayerIp(playerid, playerip, 20);
varSet(playerip, gettime());
strcat(playerip, "x");
static timers ;
timers = varGet(playerip);
varSet(playerip, 1+ timers);
if(timers > 2) {
playerip[strlen(playerip) - 2] = 0;
printf("BOT: ID -> %d IP -> %s", playerid, playerip);
BanEx(playerid, "Bot Connect");
}
}
return varSet(playerip, gettime());
}
public OnPlayerDisconnect(playerid, reason) {
if(reason == 2) {
static
playerip[20]
;
GetPlayerIp(playerid, playerip, 20);
strcat(playerip, "di_S");
varSet(playerip, gettime());
}
return false;
}
if(IsPlayerBOT(playerid)) return false;
[17:35:56] [part] ___ has left the server (2:1)
[17:35:58] Incoming connection: 127.0.0.1:3851
[17:35:59] [join] ___ has joined the server (2:127.0.0.1)
[17:35:59] Conta salva: Contas/___.ini.
[17:35:59] [part] ___ has left the server (2:1)
[17:36:01] Incoming connection: 127.0.0.1:3852
[17:36:01] [join] ___ has joined the server (2:127.0.0.1)
[17:36:01] Conta salva: Contas/___.ini.
[17:36:01] [part] ___ has left the server (2:1)
[17:36:03] Incoming connection: 127.0.0.1:3853
[17:36:05] [join] xUI42pIjfJfy8I has joined the server (2:127.0.0.1)
[17:36:05] [join] Cjl6aGeNPrtgBt has joined the server (2:127.0.0.1)
[17:36:05] [join] PNXlfP8sCFKe8Q has joined the server (2:127.0.0.1)
[17:36:05] [join] ZBQ40pGGmBPkfE has joined the server (2:127.0.0.1)
[17:36:05] [join] wBA9E4Yi3waP3X has joined the server (2:127.0.0.1)
[17:36:05] [join] dBm9tr702x9FWL has joined the server (2:127.0.0.1)
[17:36:05] [join] FCCcV0XkuvzwB3 has joined the server (2:127.0.0.1)
[17:36:05] [join] uwpjSK529aEm2x has joined the server (2:127.0.0.1)
[17:36:05] [join] YpCC48xGwDE6sB has joined the server (2:127.0.0.1)
[17:42:35] [join] DtvugjacniUnwk has joined the server (2:127.0.0.1)
[17:42:35] [join] TN2oDpmjCzIKfu has joined the server (2:127.0.0.1)
[17:42:35] 2 Entrou em menos de 2 segundos
[17:42:35] [join] CmkIKzeN71xKUx has joined the server (2:127.0.0.1)
[17:42:35] 2 Entrou em menos de 2 segundos
[17:42:35] BOT: ID -> 2 IP -> 127.0.0.
warning 203: symbol is never used: "botGetIP"
if(IsPlayerBOT(playerid)) return false;
warning 203: symbol is never used: "botGetIP"
error 021: symbol already defined: "playerip"
Sгo avisos, nгo erros.
playerip ocorre porque vocк jб tem uma global chamada "playerip" e o botGetIP ocorre porque voce nao usou em nenhuma linha IsPLayerBot .. PARA DE FAZER DOUBLE POST Nгo й a primeira vez que vocк faz. |
if(IsPlayerBOT(playerid)) return false;
error 017: undefined symbol "IsPlayerBOT"
#include a_samp
#if !defined varGet
#define varGet(%0) getproperty(0,%0)
#endif
#if !defined varSet
#define varSet(%0,%1) setproperty(0, %0, %1)
#endif
#define IsPlayerBot(%0)\
GetPlayerPing(%0) == 65535 && (gettime() - varGet((GetPlayerIp(%0, botGetIP, sizeof botGetIP), botGetIP)) > 5)
public OnPlayerConnect(playerid) {
if(IsPlayerNPC(playerid)) return false;
static
playerip[24]
;
GetPlayerIp(playerid, playerip, 24);
if(gettime() - varGet(playerip) < 2) {
strcat(playerip, "di_S");
if(gettime() - varGet(playerip) < 3) {
return false;
}
printf("%d Entrou em menos de 2 segundos", playerid);
GetPlayerIp(playerid, playerip, 20);
varSet(playerip, gettime());
strcat(playerip, "x");
static timers ;
timers = varGet(playerip);
varSet(playerip, 1+ timers);
if(timers > 2) {
playerip[strlen(playerip) - 2] = 0;
printf("BOT: ID -> %d IP -> %s", playerid, playerip);
BanEx(playerid, "Bot Connect");
}
}
if(IsPlayerNPC(playerid)) return false;
return varSet(playerip, gettime());
}
public OnPlayerDisconnect(playerid, reason) {
if(reason == 2) {
static
playerip[20]
;
GetPlayerIp(playerid, playerip, 20);
strcat(playerip, "di_S");
varSet(playerip, gettime());
}
if(IsPlayerNPC(playerid)) return false;
return false;
}