Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Tosic ツ poslato Jul 11, 2016, 12:46:13 POSLE PODNE

Naslov: [Pomoc] debug
Poruka od: Tosic ツ poslato Jul 11, 2016, 12:46:13 POSLE PODNE
Skripta koju koristim: LURP
Detaljan opis problema: Kada igrac umre ovo izbacuje u log.. Evo i OnPlayerDeath.. Nmg skontati u cemu je prob

[pawn]
[12:15:32] [debug] Run time error 4: "Array index out of bounds"
[12:15:32] [debug]  Accessing element at index 65535 past array upper bound 499
[12:15:32] [debug] AMX backtrace:
[12:15:32] [debug] #0 0020e590 in ?? (... <3 arguments>) at C:\Users\Tosic\Desktop\Modovi\Last Union v4.0\gamemodes\LUv4.pwn:16532
[12:15:32] [debug] #1 000077dc in public OnPlayerDeath (playerid=0, killerid=65535, reason=255) at C:\Users\Nemanja\Desktop\Modovi\Last Union v4.0\pawno\include\YSI\y_hooks/impl.inc:753
[12:15:32] [death] Tosic died 255
[/pawn]

[pawn]
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pUbistava]++; PlayerInfo[playerid][pSmrti]++;
    ResetPlayerWeapons(playerid); ResetujVar(playerid);
    ////////////////////////////////////////////////////////////
   if(IgracPolicajac(killerid))
   {
      PlayerInfo[killerid][pTrazeniLevel] = 0;
      SetPlayerWantedLevel(killerid,0);
   }
   ////////////////////////////////////////////////////////////
   if(!IgracPolicajac(killerid) && IsPlayerConnected(playerid))
   {
      PostaviWanted(killerid, "Ubistvo", "Nepoznat");
   }
   ////////////////////////////////////////////////////////////
   if(GetPlayerWantedLevel(killerid) > 6)
   {
      SetPlayerWantedLevel(killerid, 6);
      PlayerInfo[killerid][pTrazeniLevel] = 6;
   }
   ////////////////////////////////////////////////////////////
   if(GetPlayerWantedLevel(playerid) > 0)
   {
       new string[256];
      g_NovacMinus(playerid, GetPlayerWantedLevel(playerid)*400);
      SCMF(playerid, -1, ""ZUTA"[INFO] "CRVENA"Izgubili ste %d$ zbog umiranja sa wanted level-om "ZUTA"%d!", GetPlayerWantedLevel(playerid)*400, GetPlayerWantedLevel(playerid));
      SetPlayerWantedLevel(playerid, 0); PlayerInfo[playerid][pTrazeniLevel] = 0;
       format(string,sizeof(string),""CRVENA"[LU:RP] "SIVA"Igrac %s je ubijen/se ubio sa wanted level-om!",GetName(playerid));
      AdminGameMaster(-1,string);
    }
    ////////////////////////////////////////////////////////////
   if(IsPlayerConnected(killerid) && GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
   {
       new string[256];
      format(string,sizeof(string), ""CRVENA"[LU:RP Anti DB] "SIVA"Igrac %s (ID:%d) je uradio Drive By nad igracem %s (ID:%d)!", GetName(killerid), killerid, GetName(playerid), playerid);
       AdminGameMaster(-1, string);
   }
   ////////////////////////////////////////////////////////////
   if(IsPlayerConnected(killerid) && PlayerInfo[playerid][pLevel] >= 1)
   {
       new string[256];
      format(string,sizeof(string), ""CRVENA"[LU:RP AK] "SIVA"Igrac %s (ID:%d) je ubio igraca %s (ID:%d)", GetName(killerid), killerid, GetName(playerid), playerid);
      AdminGameMaster(-1, string);
   }
   ////////////////////////////////////////////////////////////
   if(gPlayerUsingLoopingAnim[playerid])
   {
      gPlayerUsingLoopingAnim[playerid] = 0;
   }
   ////////////////////////////////////////////////////////////
    return 1;
}
[/pawn]

Dio skripte: /
Neke slike/video za lakse dobivanje pomoci(neobavezno): /
Naslov: Odg: [Pomoc] debug
Poruka od: Tosic ツ poslato Jul 11, 2016, 13:34:14 POSLE PODNE
Na vrh if(killerid != INVALID_PLAYER_ID) { i resen prob.