Pomoc

Započeo Am1L, Oktobar 19, 2021, 17:11:56 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Kada ucem u igru i kada neko auto eksplodira iz nekog razloga svima kresha il jih kicka sa srw,
u skripti nema nikakav error.
Deo skripte: [pawn]//[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): //
Poslednja Izmena: Oktobar 25, 2021, 22:22:13 POSLE PODNE od M Ө M Σ N Z I

debug] Run time error 4: "Array index out of bounds"
[debug]  Attempted to read/write array element at index 65535 in array of size 1000
[debug] AMX backtrace:
[debug] #0 00906ac0 in public Fakee (playerid=65535) at C:\Users\mahmu\Desktop\JV RP\gamemode\gamemodes\v_Script.pwn:71752
[debug] Run time error 4: "Array index out of bounds"
[debug]  Attempted to read/write array element at index 65535 in array of size 1000
[debug] AMX backtrace:
[debug] #0 00906c70 in public Fakee2 (playerid=65535) at C:\Users\mahmu\Desktop\JV RP\gamemode\gamemodes\v_Script.pwn:71766

public Fakee
Linija u kodu 71752

public Fakee2
Linija u kodu 71766

Premasio si playerid u nekom lupu

forward Fakee(playerid);
public Fakee(playerid)
{
if(playerid == INVALID_PLAYER_ID) return 0;
FakeKillPlus[ playerid ]++;
if( FakeKillPlus[ playerid ] >= 3 )
{
new str[256];
format( str, sizeof( str ), "{F81414}(protect) {F3FF02}%s (%d) je dobio ban ip. Razlog: Fake Kill", ImeIgraca( playerid ),playerid );
AdminPoruka( ANTICHEAT, str );
//Kickovanje( playerid, "Ti si kickovan sa servera. {FF7300}| Razlog: {FFFFFF}Fake kill");
Ban(playerid);
}
return 1;
}
forward Fakee2(playerid);
public Fakee2(playerid)
{
FakeKillPlus[ playerid ] = 0;
return 1;
}

Evo pa ti vidi jesam gdje promasijo

Citat: Am1L poslato Oktobar 20, 2021, 16:37:02 POSLE PODNE
forward Fakee(playerid);
public Fakee(playerid)
{
if(playerid == INVALID_PLAYER_ID) return 0;
FakeKillPlus[ playerid ]++;
if( FakeKillPlus[ playerid ] >= 3 )
{
new str[256];
format( str, sizeof( str ), "{F81414}(protect) {F3FF02}%s (%d) je dobio ban ip. Razlog: Fake Kill", ImeIgraca( playerid ),playerid );
AdminPoruka( ANTICHEAT, str );
//Kickovanje( playerid, "Ti si kickovan sa servera. {FF7300}| Razlog: {FFFFFF}Fake kill");
Ban(playerid);
}
return 1;
}
forward Fakee2(playerid);
public Fakee2(playerid)
{
FakeKillPlus[ playerid ] = 0;
return 1;
}

Evo pa ti vidi jesam gdje promasijo
Dabome da si promašio, vidiš da šalje 65535 što je INVALID_PLAYER_ID

[pawn]forward Fakee(playerid);
public Fakee(playerid)
{
    if(!IS_IN_RANGE(0, playerid, MAX_PLAYERS + 1))
        return 0;

    if(!IsPlayerConnected(playerid))
        return 0;
   
    FakeKillPlus[ playerid ]++;
    if( FakeKillPlus[ playerid ] >= 3 )
    {
        new str[256];
        format( str, sizeof( str ), "{F81414}(protect) {F3FF02}%s (%d) je dobio ban ip. Razlog: Fake Kill", ImeIgraca( playerid ),playerid );
        AdminPoruka( ANTICHEAT, str );
        //Kickovanje( playerid, "Ti si kickovan sa servera. {FF7300}| Razlog: {FFFFFF}Fake kill");
        Ban(playerid);
    }
    return 1;
}
forward Fakee2(playerid);
public Fakee2(playerid)
{
    if(!IS_IN_RANGE(0, playerid, MAX_PLAYERS + 1))
        return 0;

    FakeKillPlus[ playerid ] = 0;
    return 1;
}[/pawn]