Can someone explain me this?
#1

this poped out when I used my command which haves something wrong in it
pawn Код:
[11:01:52] [debug] Run time error 6: "Invalid instruction"
[11:01:52] [debug]  Unknown opcode 0x2c00 at address 0x0000006B
[11:01:52] [debug] AMX backtrace:
[11:01:52] [debug] #0 0000006b in public cmd_kupistan () from NLRPGv2.amx
[11:01:52] [debug] #1 native CallLocalFunction () [00472ad0] from samp-server.exe
[11:01:52] [debug] #2 0000a430 in ?? (0x0000006b, 0x00000075, 0x00000070, 0x00000069, 0x0000006b, 0x00000075, 0x00000063, 0x00000075, 0x00000000, 0x00000000, ... <1 argument>) from NLRPGv2.amx
[11:01:52] [debug] #3 0000007d in public OnPlayerCommandText () from NLRPGv2.amx
[11:01:52] [debug] Run time error 6: "Invalid instruction"
[11:01:52] [debug]  Unknown opcode 0x29000000 at address 0x0000007D
[11:01:52] [debug] AMX backtrace:
[11:01:52] [debug] #0 ???????? in public OnPlayerCommandText () from NLRPGv2.amx
So when I use crash detect I get this and I dont understand anything from here so can someone explain me what to do and how to fix that here is the command
pawn Код:
CMD:kupistan(playerid, params[])
{
    if(PI[playerid][Stan] != -1) return SCM(playerid, GRAD2, "  (greska) Vi vec posedujete stan!");
    for(new i; i < sizeof(Stanx); i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, Stanx[i][sUlazX], Stanx[i][sUlazY], Stanx[i][sUlazZ]))
        {
            if(!strcmp(Stanx[i][sVlasnik], "Niko", true) && Stanx[i][sImaVlasnika] == 0)
            {
                if(PI[playerid][Nivo] < Stanx[i][sNivo]) return SCMF(playerid, GRAD2, "(greska) Potreban Vam je nivo %d za ovaj stan!", Stanx[i][sNivo]);
                if(PI[playerid][Novac] < Stanx[i][sCena]) return SCM(playerid, GRAD2, "  (greska) Nemate dovoljno novca za ovaj stan!");
                new hIme[MAX_PLAYER_NAME];
                RPIme(playerid, hIme);
                strmid(Stanx[i][sVlasnik], hIme, 0, strlen(hIme), 255);
                Stanx[i][sImaVlasnika] = 1;
                PI[playerid][Stan] = i;
                SetPlayerInterior(playerid, Stanx[i][sEnterijer]);
                SetPlayerVirtualWorld(playerid, Stanx[i][sVW]);
                SetPlayerPos_H(playerid, Stanx[i][sIzlazX], Stanx[i][sIzlazY], Stanx[i][sIzlazZ]);
                SetPlayerFacingAngle(playerid, Stanx[i][sIzlazA]);
                SCM(playerid, BELA, "Cestitamo, kupili ste stan! Upisite /stan za komande stana.");
                NovacMinus(playerid, Stanx[i][sCena]);
                MayorInfo[1][Budzet] += Stanx[i][sCena];
                EntID[playerid] = i;
                PI[playerid][Spawn] = SPAWN_STAN;
                PI[playerid][Renta] = -1;
                PI[playerid][RentaHotel] = -1;
                UpdateLabels();
                //SacuvajStan(i);
                new kkk[MAX_PLAYER_NAME], upit[128];
                ImeIgraca(playerid, kkk);
                format(upit, 128, "UPDATE `igraci` SET `Stan` = '%d', `Spawn` = '0', `Renta` = '-1', `RentaHotel` = '-1' WHERE `Ime` = '%s'", PI[playerid][Stan], kkk);
                mysql_query(upit, THREAD_OSTALO);
                format(CmdString, 100, "| KUPOVINA - STAN | Igrac: %s | ID: %d", kkk, i);
                UpisiLog(FAJL_PRIMOVINELOG, CmdString);
                format(upit, 128, "UPDATE `stanovi` SET `ImaVlasnika` = '1', `Vlasnik` = '%s' WHERE `ID` = '%d'", hIme, i);
                mysql_query(upit, THREAD_OSTALO);
                break;
            }
            else
            {
                SCM(playerid, GRAD2, "  (greska) Ovaj stan nije slobodan!");
            }
        }
    }
    return 1;
}
Reply
#2

Compile your mode with the -d3 flag it should show where the error is or show within a line or two of it.
Reply
#3

I did evrything what it says I should do here https://github.com/Zeex/samp-plugin-...ith-debug-info to complie it with -d3 flag and when I complie it I get this
pawn Код:
D:\Northern_Lights_RPG_Mod\Lucky Star\gamemodes\NLRPGv2.pwn(56890) : warning 219: local variable "Distance" shadows a variable at a preceding level
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:          21944 bytes
Code size:          4567468 bytes
Data size:          8910652 bytes
Stack/heap size:      16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements:13516448 bytes

1 Warning.
So what should I do now?
Reply
#4

The Variable "Distance" of the line 56890 is already used somewhere else in the code, you will have to change its name.
"Distance1"
"Distance2"
"Dist"
Whatever you want.
Reply
#5

Run the server, when it crashes, crashdetect will print out more info and it should include the line number
Reply
#6

I did it i got this:
pawn Код:
[12:06:05] [debug] Run time error 6: "Invalid instruction"
[12:06:05] [debug]  Unknown opcode 0x2700 at address 0x0000006B
[12:06:05] [debug] AMX backtrace:
[12:06:05] [debug] #0 0000006b in public cmd_kupistan () at D:\Northern_Lights_RPG_Mod\Lucky Star\pawno\include\float.inc:112
[12:06:05] [debug] #1 native CallLocalFunction () [00472ad0] from samp-server.exe
[12:06:05] [debug] #2 0000ca6c in ?? (... <11 arguments>) at D:\Northern_Lights_RPG_Mod\Lucky Star\pawno\include\zcmd.inc:102
[12:06:05] [debug] #3 0000007d in public OnPlayerCommandText () at D:\Northern_Lights_RPG_Mod\Lucky Star\pawno\include\float.inc:112
[12:06:05] [debug] Run time error 6: "Invalid instruction"
[12:06:05] [debug]  Unknown opcode 0xc000000 at address 0x0000007D
[12:06:05] [debug] AMX backtrace:
[12:06:05] [debug] #0 ???????? in public OnPlayerCommandText ()
Does that means I should get new float and zcmd includes?
And I also got 1 more error before the command crashed the server so If u could help me about that more
Here is the error
pawn Код:
[12:03:57] [debug] Run time error 4: "Array index out of bounds"
[12:03:57] [debug]  Accessing element at index 531 past array upper bound 449
[12:03:57] [debug] AMX backtrace:
[12:03:57] [debug] #0 00360090 in public OnQueryFinish (query[]=@0x0087f73c "SELECT * FROM `stanovi` WHERE ...", resultid=24, extraid=531, connectionHandle=1) at D:\Northern_Lights_RPG_Mod\Lucky Star\gamemodes\NLRPGv2.pwn:47365
And lines in the pawno script
pawn Код:
case THREAD_UCITAJSTAN:
        {
            mysql_store_result();
            new linija[160];
            if(mysql_num_rows() == 1)
            {
                if(mysql_fetch_row(linija))
                {
                    mysql_free_result();
                    new k[2];
/*47365 this is the line*/      sscanf(linija, "p<|>iis[24]ffffffffiiis[32]iii",
                    k[0], Stanx[extraid][sImaVlasnika], Stanx[extraid][sVlasnik], Stanx[extraid][sUlazX], Stanx[extraid][sUlazY], Stanx[extraid][sUlazZ], Stanx[extraid][sUlazA], Stanx[extraid][sIzlazX],
                    Stanx[extraid][sIzlazY], Stanx[extraid][sIzlazZ], Stanx[extraid][sIzlazA], Stanx[extraid][sZakljucano], Stanx[extraid][sCena], Stanx[extraid][sEnterijer], Stanx[extraid][sAdresa],
                    Stanx[extraid][sVW], Stanx[extraid][sNivo], k[1]);
                    if(Stanx[extraid][sImaVlasnika] == 0)
                    {
                        format(CmdString, 350, "{F3FF02}Stan na prodaju!{FFFFFF} (%d){F3FF02}\nCena:{FFFFFF} $%d{F3FF02} \nNivo:{FFFFFF} %d{F3FF02}\nZa kupovinu upisite {FFFFFF}/kupistan", extraid, Stanx[extraid][sCena], Stanx[extraid][sNivo]);
                        StanLabel[extraid] = CreateDynamic3DTextLabel(CmdString, ZELENA2, Stanx[extraid][sUlazX], Stanx[extraid][sUlazY], Stanx[extraid][sUlazZ], 25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
                        StanPickup[extraid] = CreateDynamicPickup(1273, 1, Stanx[extraid][sUlazX], Stanx[extraid][sUlazY], Stanx[extraid][sUlazZ]);
                    }
                    else if(Stanx[extraid][sImaVlasnika] == 1)
                    {
                        format(CmdString, 350, "{F3FF02}Vlasnik stana:{FFFFFF} %s{F3FF02}\nNivo:{FFFFFF} %d {F3FF02}\nID:{FFFFFF} %d", Stanx[extraid][sVlasnik], Stanx[extraid][sNivo], extraid);
                        StanLabel[extraid] = CreateDynamic3DTextLabel(CmdString, ZELENA2, Stanx[extraid][sUlazX], Stanx[extraid][sUlazY], Stanx[extraid][sUlazZ], 25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
                        StanPickup[extraid] = CreateDynamicPickup(1239, 1, Stanx[extraid][sUlazX], Stanx[extraid][sUlazY], Stanx[extraid][sUlazZ]);
                    }
                }
            }
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)