[Pomoc] Debug

10. Jan. 2016. Zaključano
776
pregleda
13
postova
Branko_Milovanovic
5
Crime Lord
10. Jan. 2016.
Skripta koju koristim: Ne bitno
Detaljan opis problema: Ne znam zasto debug izbacuje ovo kada umrem.
Dio skripte:
[16:06:03] Run time error 4: "Array index out of bounds"
[16:06:03]   Accessing element at index 65535 past array upper bound 14
[16:06:03] AMX backtrace:
[16:06:03] #0 0020b3a0 in ?? (... <3 arguments>) at C:\Users\Zvezda\Downloads\optimizacija\All Stars RolePlay v1.0.0\gamemodes\ASRP.pwn:23044
[16:06:03] #1 00009818 in public OnPlayerDeath (playerid=0, killerid=65535, reason=255) at C:\Users\Zvezda\Downloads\optimizacija\All Stars RolePlay v1.0.0\pawno\include\YSI\y_hooks/impl.inc:753

Neke slike/video za lakse dobivanje pomoci(neobavezno): //
PWN|Medis
5
Kingpin
10. Jan. 2016.
daj onplayerdeath
valjda nije dugačak puno 😄
ja msm da moras provjerit da li je killderid = INVALID_PLAYER_ID

nesto ovako
  if(killerid != INVALID_PLAYER_ID)
    {
        //Tvoj kod(npr.)
SCM(killerid, COLOR_RED, "Ubili ste igraca!");
    }


EDIT:
Izgleda da sam u pravu, evo sta kaze samp wiki

You MUST check whether 'killerid' is valid (not INVALID_PLAYER_ID) before using it in an array (or really anywhere), as it will cause the OnPlayerDeath script to crash (not the entire script). This is because INVALID_PLAYER_ID is defined as 65535, and if an array only has 'MAX_PLAYERS' elements, e.g. 500, you're trying to access an index that is above 499, which is out of bounds.
PWN|Medis
5
Kingpin
10. Jan. 2016.
Rekao sam ti gore u cemu je problem, preleti kroz kod i eto..
Branko_Milovanovic
5
Crime Lord
10. Jan. 2016.
A gde bih to trebao da stavim jel u svakoj komandi gde ima killerid i playerid?
Branko_Milovanovic
5
Crime Lord
12. Jan. 2016.
Moze pomoć? :-D
Branko_Milovanovic
5
Crime Lord
13. Jan. 2016.
BUMP!
PWN|Medis
5
Kingpin
13. Jan. 2016.
Ajd evo sjeo sam malo pa rpegledao tvoj kod, probaj zamjenit ovo
if(killerid == IPI)
  {
printf("[%d/%d/%d].[%d:%d:%d] | %s je umro!",td,tm1,ty,th,tm,ts,Ime_Igraca(playerid));
}

Za ovo
if(killerid != INVALID_PLAYER_ID)
  {
printf("[%d/%d/%d].[%d:%d:%d] | %s je umro!",td,tm1,ty,th,tm,ts,Ime_Igraca(playerid));
}
Branko_Milovanovic
5
Crime Lord
14. Jan. 2016.
Hvala na vremenu ali i dalje mi izbacuje debug.
PWN|Medis
5
Kingpin
14. Jan. 2016.
Ne znam stvarno.Reći ću ti jedno, a to je da je lakÅ¡e ponovo napisati taj kod nego naci gresku i ispraviti je 😄
Branko_Milovanovic
5
Crime Lord
18. Jan. 2016.
Kako ??
Branko_Milovanovic
5
Crime Lord
20. Jan. 2016.
BUMP!
LAVendeta
4
Shot Caller
20. Jan. 2016.
ae probaj da izbrises ovo da vidimo dal ce tada pistai to.
  if(killerid != INVALID_PLAYER_ID)
    {
    PI++; PI++;
ResetujVar(playerid);
if(IgracPolicajac(killerid))
{
PI = 0;
SetPlayerWantedLevel_Ex(killerid,PI);
}
    }
    if(killerid != INVALID_PLAYER_ID)
    {
if(!IgracPolicajac(killerid) && IsPlayerConnected(playerid))
{
if(PI == 0)
{
PostaviWanted(killerid, "Ubistvo", "Nepoznat");
}
}
}
if(killerid != INVALID_PLAYER_ID)
    {
if(GetPlayerWantedLevel_Ex(killerid) > 6)
{
PI += 6;
SetPlayerWantedLevel_Ex(killerid, PI);
}
}
if(killerid != INVALID_PLAYER_ID)
    {
if(IsPlayerConnected(killerid) && GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
format(nellys,sizeof(nellys), "!: %s[ID:%d] je uradio Drive By nad igracem %s[ID:%d]!", Ime_Igraca(killerid), killerid, Ime_Igraca(playerid), playerid);
    StaffPoruka(COLOR_YELLOW, nellys);
}
}

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha