Server Crashuje

Započeo Plen Ki Mun
12. Mar. 2018. Zaključano
1,265
pregleda
16
postova
Mate
5
Underboss
12. Mar. 2018.
Problem(error/warning): Kod registracije je sve u redu, ali kada idem login upisem sifru server se crashuje
Dio skripte:
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
new hashpass[ 129 ], string[ 180 ];
WP_Hash(hashpass,sizeof(hashpass), inputtext);
if(!strcmp(hashpass, PInfo, false))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);

GivePlayerMoneyEx(playerid, PInfo);
SetPlayerScore(playerid,PInfo);

    if(PInfo != -1 && clanInfo[PInfo] == 0)
{
    PInfo = -1;
PInfo = 0;
}
}
else
{
format(string, sizeof(string), "Dobrodosao %s "COL_WHITE"na CnR Server.\nUpisite sifru", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", string, "Login", "Exit");
PInfo++;
switch (PInfo)
{
  case 1: SCM(playerid, COLOR_ORANGE_RED, "Kriva sifra (1/3)");
    case 2: SCM(playerid, COLOR_ORANGE_RED, "Kriva sifra (2/3)");
    case 3:
    {
SCM(playerid, COLOR_ORANGE_RED, "Upisao si sifru vise puta krivo i izbacensi (3/3)");
SetTimerEx("KickPlayer", 100,false,"i",playerid);
}
  }
  return 1;

}
return 1;
}
}

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
[16:05:46] Rakija has joined the server (0:127.0.0.1)
[16:06:19] Server crashed while executing CNR.amx
[16:06:19] AMX backtrace:
[16:06:19] #0 000ac58c in public OnDialogResponse () from CNR.amx
[16:06:20] Native backtrace:
[16:06:20] #0 6620abc9 in ?? () from plugins\crashdetect.DLL
[16:06:20] #1 6620c8c7 in ?? () from plugins\crashdetect.DLL
[16:06:20] #2 66211489 in ?? () from plugins\crashdetect.DLL
[16:06:21] #3 66211666 in ?? () from plugins\crashdetect.DLL
[16:06:21] #4 6620a207 in ?? () from plugins\crashdetect.DLL
[16:06:21] #5 6620c87a in ?? () from plugins\crashdetect.DLL
[16:06:21] #6 65ec4629 in ?? () from plugins\streamer.DLL
[16:06:21] #7 0046ec31 in ?? () from samp-server.exe
[16:06:21] #8 00452270 in ?? () from samp-server.exe
[16:06:21] #9 0049eef9 in ?? () from samp-server.exe
[16:06:21] #10 004aa31e in ?? () from samp-server.exe

Slika/video ingame problema(obavezno ako je ingame problem): Nije potrebno
Belegija
4
Enforcer
12. Mar. 2018.
vrati u udb_hash i update crashdetect
Mate
5
Underboss
12. Mar. 2018.
Belegija wrote on March 12, 2018, 3:36 pm:
vrati u udb_hash i update crashdetect


Ti boga mi nisi normal, sve radi kako treba što bih vraćao lol.
Belegija
4
Enforcer
12. Mar. 2018.
@Vantage  pa jel tebi kresuje ili svima?
Mate
5
Underboss
12. Mar. 2018.
Belegija wrote on March 12, 2018, 4:34 pm:
@Vantage  pa jel tebi kresuje ili svima?


Ovo je na test serveru, to jest kucnom. Sve je ok, ali kada upisem lozinku odmah se server crashuje.
Ivan_Ino
5
Kingpin
12. Mar. 2018.
Crasha kada upises pravilnu sifru ili kada pogrijesis sifru?
Mate
5
Underboss
12. Mar. 2018.
Ino42O wrote on March 12, 2018, 5:11 pm:
Crasha kada upises pravilnu sifru ili kada pogrijesis sifru?


Kada upisem pravilnu crashuje server, a kada upisem krivu sifru to jest s kojom se nisam registrirao sve je ok... To jest provjera za krivu sifru uopce ne reagira

@Ino42O
Mate
5
Underboss
12. Mar. 2018.
Oprostite na DP ali nema button za edit. Sada kada upisem krivu lozinku, daje mi poruku da je kriva sifra, sto je uredu. Ali i dalje crashuje kada upisem tocnu lozinku nakon krive upisane lozinke i prvi puta kada se moram login.

Jos se jednom ispricavam moderatoru ali nemoj lock temu zbog DP, morao sam jer nema edit button.
Ivan_Ino
5
Kingpin
12. Mar. 2018.
Ovako, postavi ovo umjesto statementa gdje je uspjesan login

print(" :: DEBUG :: 1");
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);

print(" :: DEBUG :: 2");
GivePlayerMoneyEx(playerid, PInfo);

print(" :: DEBUG :: 3");
SetPlayerScore(playerid,PInfo);

print(" :: DEBUG :: 4");

if(PInfo != -1 && clanInfo[PInfo] == 0)
{
PInfo = -1;
PInfo = 0;
}

print(" :: DEBUG :: 5");


i kada crasha vidi u server_log.txt koje je sve debug korake ispisalo
Mate
5
Underboss
12. Mar. 2018.
Log:
[18:52:50] Rakija has joined the server (0:127.0.0.1)
[18:52:58]  :: DEBUG :: 1
[18:52:58]  :: DEBUG :: 2
[18:52:58] Server crashed while executing CNR.amx
[18:52:58] AMX backtrace:
[18:52:58] #0 000ac5dc in public OnDialogResponse () from CNR.amx
[18:53:00] Native backtrace:
[18:53:00] #0 6994abc9 in ?? () from plugins\crashdetect.DLL
[18:53:00] #1 6994c8c7 in ?? () from plugins\crashdetect.DLL
[18:53:00] #2 69951489 in ?? () from plugins\crashdetect.DLL
[18:53:00] #3 69951666 in ?? () from plugins\crashdetect.DLL
[18:53:00] #4 6994a207 in ?? () from plugins\crashdetect.DLL
[18:53:00] #5 6994c87a in ?? () from plugins\crashdetect.DLL
[18:53:00] #6 66fb4629 in ?? () from plugins\streamer.DLL
[18:53:00] #7 0046ec31 in ?? () from samp-server.exe
[18:53:00] #8 00452270 in ?? () from samp-server.exe
[18:53:00] #9 0049eef9 in ?? () from samp-server.exe
[18:53:00] #10 004aa31e in ?? () from samp-server.exe


Kod:

case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
    ClearChat(playerid, 30);
new hashpass[ 129 ], string[ 180 ];
WP_Hash(hashpass,sizeof(hashpass), inputtext);
if(!strcmp(hashpass, PInfo, false))
{
    print(" :: DEBUG :: 1");
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);

print(" :: DEBUG :: 2");
GivePlayerMoneyEx(playerid, PInfo);

print(" :: DEBUG :: 3");
SetPlayerScore(playerid,PInfo);

LoggedIn = 1;

UpdateIP(playerid);

if(PInfo == 1) return Kick(playerid);

                    print(" :: DEBUG :: 4");
    if(PInfo != -1 && clanInfo[PInfo] == 0)
{
    PInfo = -1;
PInfo = 0;
}
print(" :: DEBUG :: 5");
}
else
{
    format(string, sizeof(string), "Dobrodosao %s na CnR server\nUpisite sifru", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", string, "Login", "Exit");
    PInfo++;
switch (PInfo)
{
  case 1: SCM(playerid, -1, "Kriva Sifra (1/3)");
    case 2: SCM(playerid, -1, "Kriva Sifra (2/3)");
    case 3:
    {
SCM(playerid, -1, "Izbaceni si, fulao si sanse za login (3/3)");
SetTimerEx("KickPlayer", 100,false,"i",playerid);
}
  }
  return 1;
                }
}
return 1;
}
Rax_King
5
Godfather
12. Mar. 2018.
daj funkciju GivePlayerMoneyEx
Mate
5
Underboss
12. Mar. 2018.
Evo poneÅ¡to vezanu uz to. Ali kakve veze ima to sa mojim problemom (Pitam, zelim znati)  🙂

Svugdje koristim to jer imam server sided, nisam ima prije sa time problema.
forward GivePlayerMoneyEx(playerid,ammount);


public GivePlayerMoneyEx(playerid,ammount)
{
      OldMoney = GetPlayerMoney(playerid);
      NewMoney = ammount;
      GivePlayerMoneyEx(playerid,ammount);

      return 1;
}
Rax_King
5
Godfather
12. Mar. 2018.
Funkcija poziva samo sebe i tako stvara infinite loop.
Eo fix:
public GivePlayerMoneyEx(playerid,ammount)
{
      OldMoney = GetPlayerMoney(playerid);
      NewMoney = ammount;
      GivePlayerMoney(playerid,ammount);

      return 1;
}
RahimPAWNO
5
OG Legend
12. Mar. 2018.

public GivePlayerMoneyEx(playerid,ammount)
{
      OldMoney = GetPlayerMoney(playerid);
      NewMoney = ammount + OldMoney;
      GivePlayerMoney(playerid,ammount);

      return 1;
}

Ne znam sta si zamislio sa ovim old i newmoney. Probaj sada.
Mate
5
Underboss
12. Mar. 2018.
.ксундер wrote on March 12, 2018, 6:08 pm:
Funkcija poziva samo sebe i tako stvara infinite loop.
Eo fix:
public GivePlayerMoneyEx(playerid,ammount)
{
      OldMoney = GetPlayerMoney(playerid);
      NewMoney = ammount;
      GivePlayerMoney(playerid,ammount);

      return 1;
}


Hvala ti puno. Daj adresu da ti doÄ‘em ljubit noge  😄

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha