player nгo й kickado com kick(playerid); -
Falcon. - 10.12.2012
O cуdigo й simples, quando conecta verifica se ele possui uma conta registrada, nгo importando o resultado era para kickar o player em
sql_onplayerconnect.
pawn Код:
#define threadMySQL::%0(%1) forward %0(%1); \
public %0(%1)
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, nome[0], 21);
format(queryformat, 103, "select contaid, statusconta, linguagem, senhaacesso from contas where nickname='%s'", nome[0]);
mysql_function_query(connectionhandle, queryformat, true, "sql_onplayerconnect", "i", playerid);
return 1;
}
threadMySQL::sql_onplayerconnect(playerid)
{
SendClientMessage(playerid, 0xFFFF80AA, "republicadventure-server.com");
Kick(playerid);
return 0x01;
}
Quando eu adiciono o Kick() antes de tudo em OnPlayerConnect funciona bem:
pawn Код:
public OnPlayerConnect(playerid)
{
Kick(playerid);
GetPlayerNa...
format(que...
server_log.txt:
[17:21:04] Incoming connection: 127.0.0.1:53258
[17:21:04] [join] Falcon has joined the server (0:127.0.0.1)
[17:21:04] [part] Falcon has left the server (0:2)
[17:21:15] Incoming connection: 127.0.0.1:53259
[17:21:15] [join] Falcon has joined the server (0:127.0.0.1)
[17:21:15] [part] Falcon has left the server (0:2)
[17:21:30] Incoming connection: 127.0.0.1:64866
[17:21:30] [join] Falcon has joined the server (0:127.0.0.1)
[17:21:30] [part] Falcon has left the server (0:2)
[17:21:45] Incoming connection: 127.0.0.1:64867
[17:21:46] [join] Falcon has joined the server (0:127.0.0.1)
[17:21:46] [part] Falcon has left the server (0:2)
chatlog.txt:
Код:
[17:21:01] {FFFFFF}SA-MP {B9B9BF}0.3e {FFFFFF}Started
[17:21:04] Connecting to 127.0.0.1:7777...
[17:21:04] Connected. Joining the game...
[17:21:04] Audio stream: http://localhost/intro_login.mp3
[17:21:04] Connected to {B9B9BF}..:: Republic Adventure server ::..
[17:21:14] Lost connection to the server. Reconnecting..
[17:21:14] The server is restarting..
[17:21:15] Connecting to 127.0.0.1:7777...
[17:21:15] Connected. Joining the game...
[17:21:15] Audio stream: http://localhost/intro_login.mp3
[17:21:15] Connected to {B9B9BF}..:: Republic Adventure server ::..
[17:21:30] Lost connection to the server. Reconnecting..
[17:21:30] The server is restarting..
[17:21:30] Connecting to 127.0.0.1:7777...
[17:21:30] Connected. Joining the game...
[17:21:30] Audio stream: http://localhost/intro_login.mp3
[17:21:30] Connected to {B9B9BF}..:: Republic Adventure server ::..
[17:21:45] Lost connection to the server. Reconnecting..
[17:21:45] The server is restarting..
[17:21:45] Connecting to 127.0.0.1:7777...
[17:21:46] Connected. Joining the game...
[17:21:46] Audio stream: http://localhost/intro_login.mp3
[17:21:46] Connected to {B9B9BF}..:: Republic Adventure server ::..
[17:21:46] republicadventure-server.com
[17:21:46] Server closed the connection.
parece ser o mesmo o mesmo problema desse cara:
Quote:
Originally Posted by scott1
...so it have to kick me, but nothing happend, i got an message "lose connection, try reconnecting" like if server shut down, after some sec i got reconnected and after another time the message and so and so.
But never the server shut down or restart, just for me.
|
Re: player nгo й kickado com kick(playerid); -
BreakDriFT - 10.12.2012
Aquele SendClientMessage ta sendo enviado ?
Re: player nгo й kickado com kick(playerid); -
Falcon. - 10.12.2012
no chatlog.txt tб mostrando ai, depois de vбrias vezes que "o servidor cai" como no exemplo do scott1 envia e kicka.
й como se fosse para eu ser kickado e o servidor fica reiniciando somente para mim
Re: player nгo й kickado com kick(playerid); -
Falcon. - 11.12.2012
entгo... ninguйm saberia oque pode ser isto ? =/
nгo estou muito afim de refazer tudo e acabar neste erro novamente
Re: player nгo й kickado com kick(playerid); -
Don_Speed - 11.12.2012
Esta chegando ao sql_onplayerconnect 
Re: player nгo й kickado com kick(playerid); -
Falcon. - 11.12.2012
sim, todas as outras funзхes que eu adiciono lб funciona. Mas quando uso o Kick o servidor fica reiniciando somente para mim e nгo kicka.
ai no chatlog.txt que eu postei tб mostrando como tб acontecendo
Re: player nгo й kickado com kick(playerid); -
[JD]BlackFire - 11.12.2012
a funзгo mysql_query_calback nгo estб chamando a callback.
Re: player nгo й kickado com kick(playerid); -
Falcon. - 11.12.2012
a consulta estб chegando na callback, o problema mesmo й quando executa o Kick(playerid);
o servidor fica como se desse gmx vбrias vezes seguidas, mas somente para mim
Re: player nгo й kickado com kick(playerid); -
ViniBorn - 11.12.2012
Jб viu o valor que playerid tб assumindo?
Re: player nгo й kickado com kick(playerid); -
Falcon. - 11.12.2012
sim, todo o resto funciona bem... aparenta ser algum problema no sa-mp server.
Atй porque mesmo com o new.pwn resultava nisso.
A soluзгo para o problema foi usar um SetTimer, entгo passou a funcionar corretamente.
pawn Код:
#include <a_samp>
main()
{
print("SA-MP Forums");
}
public OnPlayerConnect(playerid)
{
SetTimerEx("Falcon", 500, false, "i", playerid);
return 1;
}
forward Falcon(playerid);
public Falcon(playerid)
{
SendClientMessage(playerid, -1, "GET OUT !!!");
Kick(playerid);
return 0x01;
}
Obrigado todos que respoderam.