Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

Question

Posted

Salut, de la un timp pe serverul meu (localhost) tot primesc server closed the connection, ma uit in consola si nu scrie absolut nimic, decat ca x has left the game si atat. nu inteleg dc, stie cineva un motiv?

22 answers to this question

Recommended Posts

  • 0
Posted

hm.. nu stiu ce sa-ti spun, aveam si eu problema asta si am rezolvat-o modificand ceva la onplayerconnect.

da-mi te rog public OnPlayerConnect si unde se inregistreaza

  • 0
Posted

public OnPlayerConnect(playerid)
{
    ResetVar(playerid);
    SetSpawnInfo(0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);

    LoadPlayerTD(playerid);

    new string[128];
    mysql_format(SQL, string, sizeof(string), "SELECT `Name` FROM `server_accounts` WHERE `Name` = '%e'", GetName(playerid));
    mysql_tquery(SQL, string, "CheckPlayerAccount", "i", playerid);    
    return 1;
}

Dialog:DIALOG_GENDER(playerid, response, listitem, inputtext[])
{
    switch(response)
    {
        case 0: {
            PlayerInfo[playerid][pGender] = 0;
            SetSpawnInfo(playerid, NO_TEAM, 12, 609.6233,-1458.4764,14.3766, -1, -1, -1, -1, -1, -1, -1);
            SCM(playerid, COLOR_RED, "Registration: {FFFFFF}Your gender is Female.");
            mysqlQuery("UPDATE `server_accounts` SET `Gender` = '0' WHERE `ID` = '%d'", PlayerInfo[playerid][pSQLID]);
            PlayerInfo[playerid][pSkin] = 12;
            mysqlQuery("UPDATE `server_accounts` SET `Skin` = '12' WHERE `ID` = '%d'", PlayerInfo[playerid][pSQLID]);
            UpdateLevelBar(playerid);
        }
        case 1:
        {
            PlayerInfo[playerid][pGender] = 1;
            SetSpawnInfo(playerid, NO_TEAM, 250, 609.6233,-1458.4764,14.3766, -1, -1, -1, -1, -1, -1, -1);
            SCM(playerid, COLOR_RED, "Registration: {FFFFFF}You gender is Male."); 
            mysqlQuery("UPDATE `server_accounts` SET `Gender` = '1' WHERE `ID` = '%d'", PlayerInfo[playerid][pSQLID]);
            PlayerInfo[playerid][pSkin] = 250;
            mysqlQuery("UPDATE `server_accounts` SET `Skin` = '250' WHERE `ID` = '%d'", PlayerInfo[playerid][pSQLID]);
            UpdateLevelBar(playerid);
        }
    }
    ShowTD(playerid);
    PlayerInfo[playerid][pLogged] = 1;
    ClearChat(playerid);
    TogglePlayerSpectating(playerid, 0);
    SCMF(playerid, -1, "Welcome to the server, %s!", GetName(playerid));
    return true;
}

  • 0
Posted (edited)

Salut.

Problema apare dupa ce stai un anumit timp pe server? Sau dupa ce ai tastat o anumita comanda? 

Ofera te rog mai multe detalii pentru a putea fi ajutat, sunt mai multe posibilitati.

Daca as fi in locul tau, m-as gandii foarte bine la ce modificari am adus la server in ultima vreme si as incepe prin a face cateva verificari cu functia *printf*pentru a vedea daca totul functioneaza normal.

Edited by Джо

 

 

  • 0
Posted
1 hour ago, Джо said:

Salut.

Problema apare dupa ce stai un anumit timp pe server? Sau dupa ce ai tastat o anumita comanda? 

Ofera te rog mai multe detalii pentru a putea fi ajutat, sunt mai multe posibilitati.

Daca as fi in locul tau, m-as gandii foarte bine la ce modificari am adus la server in ultima vreme si as incepe prin a face cateva verificari cu functia *printf*pentru a vedea daca totul functioneaza normal.

salut, daca stau un anumit timp.

  • 0
Posted

Am patit asta chiar n-aveam habar cum s-o rezolv.. Tot ce trebuie sa faci este sa introduci libraria YSI inainte de include-ul <a_mysql>

Aseaza-ti include-urile dupa exemplul urmator:
 

#include <a_samp>
//#include <a_mysql>
#include <streamer>
#include <sscanf2>
#include <easyDialog>
#include <zcmd>
#include <fly>
#include <playerzone>

#include <YSI\y_va>
#include <YSI\y_timers>

#include <YSI\y_stringhash>

#include <YSI\y_hooks>
#if !defined MYSQL_USE_YINLINE
    #define MYSQL_USE_YINLINE
#endif
#include <YSI\y_inline>
#include <a_mysql>

#include "../modules/assets/colors.inc"
#include "../modules/assets/functions.inc"

#pragma warning disable 238

 

  • 0
Posted

[14:03:27] [debug] AMX backtrace:
[14:03:27] [debug] #0 0006a848 in public SSCANF_OnPlayerDisconnect (playerid=0, reason=2) at C:\Wing RPG\gamemodes\Wing.pwn:1040
[14:03:27] [debug] #1 00052034 in public _y_utils_OnPlayerDisconnect (playerid=0, reason=2) at C:\Wing RPG\pawno\include\sscanf2.inc:266
[14:03:27] [debug] #2 0000e1e0 in OnPlayerDisconnect (playerid=0, reason=2, ... <1073741821 arguments>) at C:\Wing RPG\pawno\include\YSI\..\YSI_Data\..\YSI_Internal\..\YSI_Core\y_utils.inc:321
[14:03:27] [debug] #3 00014028 in public OnPlayerDisconnect (... <2 arguments>) at C:\Wing RPG\pawno\include\YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:114
[14:03:27] [debug] #4 native Kick () from samp-server.exe
[14:03:27] [debug] #5 0009a090 in KickEx (playerid=0) at C:\Wing RPG\gamemodes\Wing.pwn:3917
[14:03:27] [debug] #6 0009bb58 in LoginTimer (playerid=0) at C:\Wing RPG\gamemodes\Wing.pwn:3992
[14:03:27] [debug] #7 0009bb28 in public @Yj:LoginTimer@_yT (__r=0, playerid=0) at C:\Wing RPG\gamemodes\Wing.pwn:3990

  • 0
Posted
La 31.03.2021 la 22:38, Raduq a spus:

Salut, de la un timp pe serverul meu (localhost) tot primesc server closed the connection, ma uit in consola si nu scrie absolut nimic, decat ca x has left the game si atat. nu inteleg dc, stie cineva un motiv?

Când primeșt acest lucru?

  • 0
Posted (edited)
Acum 7 ore, Raduq a spus:

[14:03:27] [debug] AMX backtrace:
[14:03:27] [debug] #0 0006a848 in public SSCANF_OnPlayerDisconnect (playerid=0, reason=2) at C:\Wing RPG\gamemodes\Wing.pwn:1040
[14:03:27] [debug] #1 00052034 in public _y_utils_OnPlayerDisconnect (playerid=0, reason=2) at C:\Wing RPG\pawno\include\sscanf2.inc:266
[14:03:27] [debug] #2 0000e1e0 in OnPlayerDisconnect (playerid=0, reason=2, ... <1073741821 arguments>) at C:\Wing RPG\pawno\include\YSI\..\YSI_Data\..\YSI_Internal\..\YSI_Core\y_utils.inc:321
[14:03:27] [debug] #3 00014028 in public OnPlayerDisconnect (... <2 arguments>) at C:\Wing RPG\pawno\include\YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:114
[14:03:27] [debug] #4 native Kick () from samp-server.exe
[14:03:27] [debug] #5 0009a090 in KickEx (playerid=0) at C:\Wing RPG\gamemodes\Wing.pwn:3917
[14:03:27] [debug] #6 0009bb58 in LoginTimer (playerid=0) at C:\Wing RPG\gamemodes\Wing.pwn:3992
[14:03:27] [debug] #7 0009bb28 in public @Yj:LoginTimer@_yT (__r=0, playerid=0) at C:\Wing RPG\gamemodes\Wing.pwn:3990

Rezolva backtrace-urile din public-urile afisate, si vezi daca mai ai tot aceeasi problema.

Edited by zNx[]

 

  • 0
Posted
16 minutes ago, zNx[] said:

Rezolva backtrace-urile din public-urile afisate, si vezi daca mai ai tot aceeasi problema.

da bro da problema e ca nu prea stiu cum ))))

  • 0
Posted (edited)

ai probleme la LoginTimer

 

Ex:

 

new login_timer[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
	login_timer[playerid] = -1;
	login_timer[playerid] = SetTimerEx("LoginTimer", 30000, false, "i", playerid);
	ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Introdu parola:", "Ok", "Close");
}

public OnPlayerDisconnect(playerid, reason)
{
	if(login_timer[playerid] != -1) { KillTimer(login_timer[playerid]); login_timer[playerid] = -1; }
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
		case DIALOG_LOGIN:
		{
			// daca jucatorul s-a logat cu succes
			KillTimer(login_timer[playerid]);
          	login_timer[playerid] = -1;
		}
	}
	return 1;
}

forward LoginTimer(playerid)
public LoginTimer(playerid)
{
	KillTimer(login_timer[playerid]);
  	login_timer[playerid] = -1;
}

 

Edited by iSkull

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.