[Crash-login]
#1

Hello guys,
I really have a big problem with my gamemode, I recive this error ever when i create a new account
https://www.youtube.com/watch?v=PN40mDh75gw

Server log:
PHP код:
[13:32:45Incoming connection127.0.0.1:49160
[13:32:46] [joinYest_Tes has joined the server (10:127.0.0.1)
[
13:32:46] [debugRun time error 4"Array index out of bounds"
[13:32:46] [debug]  Accessing element at index 300 past array upper bound 299
[13:32:46] [debugAMX backtrace:
[
13:32:46] [debug#0 0000de88 in ?? () from PR-RP.amx
[13:32:46] [debug#1 0000f200 in ?? () from PR-RP.amx
[13:32:46] [debug#2 0000bcd0 in ?? () from PR-RP.amx
[13:32:46] [debug#3 0000618c in public Itter_OnPlayerConnect () from PR-RP.amx
[13:32:46] [debug#4 native CallLocalFunction () [00472ad0] from samp-server.exe
[13:32:46] [debug#5 00005870 in public OnPlayerConnect () from PR-RP.amx 
Line code:
PHP код:
public OnPlayerConnect(playerid)
{
    if(
IsPlayerNPC(playerid)) return 1;
    new 
string[128], user[128], daymonthyearhourminutesecond;
    new 
num GetMaxIPs(playerid);
    if(
num >= && !IsPlayerNPC(playerid)) return Kick(playerid);
    
OnConnectInit(playerid);
    
//furn system
    
gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    
gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    
gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    
gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    
gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    for(new 
x=0SELECTION_ITEMSx++) {
        
gSelectionFurns[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
    }
    
gFurnAt[playerid] = 0;
    if(!
NameIsRP(PlayerName(playerid)))
    {
        
SendClientMessage(playeridCOLOR_LIGHTRED"Your name is not acceptable please use the format: Firstname_Lastname.");
        
KickEx(playerid);
        return 
1;
    }
    
GetPlayerHost(playerid); // Gets the DNS Data
    
SetPlayerColor(playerid,COLOR_GREY);
    
format(stringsizeof(string),"%s (%d) connected to the server."PlayerName(playerid), playerid);
    if(
GetPVarInt(playerid"Admin") > || GetPVarInt(playerid"Helper") > || GetPVarInt(playerid"RegTeam") > 0)
    {
        
LoginLog(string);
    }
    foreach (
Player,i)
    {
        if(
GetPVarInt(i"CntNames") == 1)
        {
            
SendClientMessage(i,COLOR_WHITE,string);
        }
    }
    
ResetPlayerWeapons(playerid);
    
CheckIP(playerid);
    
gettime(hour,minute,second), FixHour(hour), hour shifthourgetdate(year,month,day);
    
format(usersizeof(user), "users/%s.ini"PlayerName(playerid));
    if(
DOF2_FileExists(user) && DOF2_GetInt(user"Banned") == 1)
    {
        if(
DOF2_GetInt(user"TempYear") > && DOF2_GetInt(user"TempMonth") > && DOF2_GetInt(user"TempDay") > 0)
        {
            new 
proceed 0;
            if(
year DOF2_GetInt(user"TempYear")) // If the year is over your tempban year.
            
{
                
DOF2_SetInt(user"Banned"0);
                
DOF2_SetInt(user"TempYear"0);
                
DOF2_SetInt(user"TempMonth"0);
                
DOF2_SetInt(user"TempDay"0);
                
DOF2_WriteFile();
                
format(stringsizeof(string),"unbanip %s"DOF2_GetString(user"IP"));
                
SendRconCommand(string);
                
SendRconCommand("reloadbans");
                
format(stringsizeof(string),"AdmWarn: %s was un-temp banned from Project-Bot."PlayerName(playerid));
                
SendAdminMessage(COLOR_YELLOW,string);
                
proceed=1;
            }
            if(
month DOF2_GetInt(user"TempMonth")) // If the month is over your tempban month.
            
{
                
DOF2_SetInt(user"Banned"0);
                
DOF2_SetInt(user"TempYear"0);
                
DOF2_SetInt(user"TempMonth"0);
                
DOF2_SetInt(user"TempDay"0);
                
DOF2_WriteFile();
                
format(stringsizeof(string),"unbanip %s"DOF2_GetString(user"IP"));
                
SendRconCommand(string);
                
SendRconCommand("reloadbans");
                
format(stringsizeof(string),"AdmWarn: %s was un-temp banned from Project-Bot."PlayerName(playerid));
                
SendAdminMessage(COLOR_YELLOW,string);
                
proceed=1;
            }
            if(
month >= DOF2_GetInt(user"TempMonth") && day >= DOF2_GetInt(user"TempDay")) // If the day is your tempban undue day or above.
            
{
                
DOF2_SetInt(user"Banned"0);
                
DOF2_SetInt(user"TempYear"0);
                
DOF2_SetInt(user"TempMonth"0);
                
DOF2_SetInt(user"TempDay"0);
                
DOF2_WriteFile();
                
format(stringsizeof(string),"unbanip %s"DOF2_GetString(user"IP"));
                
SendRconCommand(string);
                
SendRconCommand("reloadbans");
                
format(stringsizeof(string),"AdmWarn: %s was un-temp banned from Project-Bot."PlayerName(playerid));
                
SendAdminMessage(COLOR_YELLOW,string);
                
proceed=1;
            }
            if(
proceed == 0)
            {
                new 
mtext[50];
                switch(
DOF2_GetInt(user"TempMonth"))
                {
                    case 
1mtext "January";
                    case 
2mtext "February";
                    case 
3mtext "March";
                    case 
4mtext "April";
                    case 
5mtext "May";
                    case 
6mtext "June";
                    case 
7mtext "July";
                    case 
8mtext "August";
                    case 
9mtext "September";
                    case 
10mtext "October";
                    case 
11mtext "November";
                    case 
12mtext "December";
                }
                if(
DOF2_GetInt(user"TempDay") < 10format(stringsizeof(string),"You are temporarily banned until %s-0%d-%d."mtextDOF2_GetInt(user"TempDay"), DOF2_GetInt(user"TempYear"));
                else 
format(stringsizeof(string),"You are temporarily banned until %s-%d-%d."mtextDOF2_GetInt(user"TempDay"), DOF2_GetInt(user"TempYear"));
                
SendClientMessage(playeridCOLOR_LIGHTREDstring);
                return 
Kick(playerid);
            }
        }
    }
    return 
1;

I try a lot of posibilities, I've search on ****** but still nothing. I really appreciate a good answer and i will REP+. Thank you guys.
Reply
#2

The only known things are the callback (OnPlayerConnect) and the size of the array (300). The first 3 amx backtrace are unknown (??) so it might be inside a custom function that was used in OnPlayerConnect.

Update crashdetect to its latest version if you do not use it already: https://github.com/Zeex/samp-plugin-...es/tag/v4.13.1
Use with debug info (-d3): https://github.com/Zeex/samp-plugin-...ith-debug-info
Re-compile your scripts and run the server. Connect and post what it printed in server log.
Reply
#3

PHP код:
[22:38:08] [joinYest_Testo has joined the server (14:127.0.0.1)
[
22:38:08] [debugRun time error 4"Array index out of bounds"
[22:38:08] [debug]  Accessing element at index 300 past array upper bound 299
[22:38:08] [debugAMX backtrace:
[
22:38:08] [debug#0 0001108c in public OnConnectInit (playerid=14) at ../gamemodes/OnConnect.pwn:166
[22:38:08] [debug#1 00012940 in public Streamer_OnPlayerConnect (playerid=14) at ../gamemodes/OnConnect.pwn:225
[22:38:08] [debug#2 0000e478 in public SSCANF_OnPlayerConnect (playerid=14) at C:\Users\Serban-PC\Desktop\things\pawno\include\streamer.inc:280
[22:38:08] [debug#3 00007ca0 in public Itter_OnPlayerConnect (playerid=14) at C:\Users\Serban-PC\Desktop\things\pawno\include\sscanf2.inc:205
[22:38:08] [debug#4 native CallLocalFunction () [00472ad0] from samp-server.exe
[22:38:08] [debug#5 00007190 in public OnPlayerConnect (playerid=14) at C:\Users\Serban-PC\Desktop\things\pawno\include\Foreach.inc:452 
Reply
#4

Maybe u edited something that cant be edited
Reply
#5

Re-compile with -d3 flag (debug information). You'll get a much more usable stack trace.
Reply
#6

Quote:
Originally Posted by Sithis
Посмотреть сообщение
Re-compile with -d3 flag (debug information). You'll get a much more usable stack trace.
I aleardy do this.

Compile result:
PHP код:
C:\Users\Serban-PC\Desktop\things\pawno\include\streamer.inc(462) : warning 235: public function lacks forward declaration (symbol "OnPlayerWeaponShot")
../
gamemodes/OnGameMode.pwn(11591) : warning 204symbol is assigned a value that is never used"amount"
../gamemodes/OnCommand.pwn(24145) : warning 204symbol is assigned a value that is never used"devtext"
../gamemodes/OnCommand.pwn(24145) : warning 204symbol is assigned a value that is never used"sendername"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
Header size
:          22568 bytes
Code size
:          4540644 bytes
Data size
:         19202652 bytes
Stack
/heap size:     262144 bytesestimated maxusageunknowndue to recursion
Total requirements
:24028008 bytes
4 Warnings

Reply
#7

Post OnConnectInit function and line 166 please.
Reply
#8

PHP код:
public OnConnectInit(playerid)
{
    
RemovePlayerAttachedObject(playerid,0), RemovePlayerAttachedObject(playerid,1);
    
RemovePlayerAttachedObject(playerid,2), RemovePlayerAttachedObject(playerid,3);
    
RemovePlayerAttachedObject(playerid,4), RemovePlayerAttachedObject(playerid,5);
    
RemovePlayerAttachedObject(playerid,6), RemovePlayerAttachedObject(playerid,7);
    
RemovePlayerAttachedObject(playerid,8), RemovePlayerAttachedObject(playerid,9);
    
SetPVarInt(playerid"Cash"0);
    
SetPVarInt(playerid"Bank"0);
    
SetPVarInt(playerid"RentKey"2005);
    
SetPVarInt(playerid"HouseKey"1000);
    
SetPVarInt(playerid"BizzKey"1000);
    
SetPVarInt(playerid"HouseEnter"1000);
    
SetPVarInt(playerid"BizzEnter"1000);
    
SetPVarInt(playerid"IntEnter"1000);
    
SetPVarInt(playerid"CarKey1"SCRIPT_CARS);
    
SetPVarInt(playerid"CarKey2"SCRIPT_CARS);
    
SetPVarInt(playerid"CarKey3"SCRIPT_CARS);
    
PlayerInfo[playerid][pSpeedDelay]=0;
    
PlayerInfo[playerid][pWeapon][0] = 0;
    
PlayerInfo[playerid][pWeapon][1] = 0;
    
PlayerInfo[playerid][pWeapon][2] = 0;
    
PlayerInfo[playerid][pWeapon][3] = 0;
    
PlayerInfo[playerid][pWeapon][4] = 0;
    
PlayerInfo[playerid][pWeapon][5] = 0;
    
PlayerInfo[playerid][pWeapon][6] = 0;
    
PlayerInfo[playerid][pWeapon][7] = 0;
    
PlayerInfo[playerid][pWeapon][8] = 0;
    
PlayerInfo[playerid][pWeapon][9] = 0;
    
PlayerInfo[playerid][pWeapon][10] = 0;
    
PlayerInfo[playerid][pWeapon][11] = 0;
    
PlayerInfo[playerid][pWeapon][12] = 0;
    
PlayerInfo[playerid][pAmmo][0] = 0;
    
PlayerInfo[playerid][pAmmo][1] = 0;
    
PlayerInfo[playerid][pAmmo][2] = 0;
    
PlayerInfo[playerid][pAmmo][3] = 0;
    
PlayerInfo[playerid][pAmmo][4] = 0;
    
PlayerInfo[playerid][pAmmo][5] = 0;
    
PlayerInfo[playerid][pAmmo][6] = 0;
    
PlayerInfo[playerid][pAmmo][7] = 0;
    
PlayerInfo[playerid][pAmmo][8] = 0;
    
PlayerInfo[playerid][pAmmo][9] = 0;
    
PlayerInfo[playerid][pAmmo][10] = 0;
    
PlayerInfo[playerid][pAmmo][11] = 0;
    
PlayerInfo[playerid][pAmmo][12] = 0;
    
SetPVarInt(playerid"HouseEnter"1000);
    
SetPVarInt(playerid"BizzEnter"1000);
    
SetPVarInt(playerid"Checkpoint"CHECKPOINT_NONE);
    
SetPVarInt(playerid"Bot"501);
    new 
randmask 1000 random(9999999);
    
SetPVarInt(playerid"MaskID"randmask);
    
SetPVarInt(playerid"Mobile"501);
    new 
randphone 1000 random(9999999);
    
SetPVarInt(playerid"PhoneNum"randphone);
    
SetPVarInt(playerid"RefillOffer"501);
    
SetPVarInt(playerid"RepairOffer"501);
    
SetPVarInt(playerid"Drag"501);
    for(new 
0301i++) { PlayerInfo[playerid][pBlockPM][i] = 0; }
    
SetPVarInt(playerid"ShakeOffer"501);
    
SetPVarInt(playerid"DragOffer"501);
    
SetPVarInt(playerid"TrunkOffer"501);
    
SetPVarInt(playerid"LiveOffer"501);
    
SetPVarInt(playerid"InviteOffer"501);
    
SetPVarInt(playerid"VehicleOffer"501);
    
SetPVarInt(playerid"BlindOffer"501);
    
SetPVarInt(playerid"HouseOffer"501);
    
strmid(PlayerInfo[playerid][pAdmName], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pAccent], "None"0strlen("None"), 255);
    for(new 
05i++)
    {
        
PlayerInfo[playerid][pTicket][i] = 0;
        
strmid(TicketReason[playerid][i], "None"0strlen("None"), 255);
    }
    
strmid(PlayerInfo[playerid][pPMMsg], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pTaunt], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pNote1], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pNote2], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pNote3], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pNote4], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pNote5], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pJailReason], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pWarning], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pOOC], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pMetagame], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pRevenge], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pRoleplay], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pPowergame], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pQuest1], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pQuest2], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pQuest3], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pQuest4], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pQuest5], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pWarrant], "None"0strlen("None"), 255);
    
strmid(PlayerInfo[playerid][pCellname], "None"0strlen("None"), 255);
    
PlayerInfo[playerid][pLiveOffer][0]=0;
    
PlayerInfo[playerid][pLiveOffer][1]=0;
    
PlayerInfo[playerid][pJobTime]=0;
    
ResetPlayerWeaponsEx(playerid);
    
SetPVarInt(playerid"CameraPos"6);
    
SetPVarInt(playerid"CameraDelay"1);
    
TextDrawHideForPlayer(playeridFadeDraw[playerid]);
    
TextDrawHideForPlayer(playeridHitMark);
    
TextDrawHideForPlayer(playeridScreenBar1);
    
TextDrawHideForPlayer(playeridScreenBar2);
    
StopAudioStreamForPlayerEx(playerid);
    return 
1;

PHP код:
for(new 0301i++) { PlayerInfo[playerid][pBlockPM][i] = 0; } 
Reply
#9

Change to:
pawn Код:
for(new i = 0; i < 300; i++) { PlayerInfo[playerid][pBlockPM][i] = 0; }
Reply
#10

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Change to:
pawn Код:
for(new i = 0; i < 300; i++) { PlayerInfo[playerid][pBlockPM][i] = 0; }
Same happen
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)