Započeo Scripter Braun
•10. Jan. 2016.• Zaključano[Pomoc] Debug
787
pregleda
13
postova
Crime Lord
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
902
Postovi:
145
Teme:
Pridružio se:Sep. 2013
10. Jan. 2016.
Skripta koju koristim: Ne bitno
Detaljan opis problema: Ne znam zasto debug izbacuje ovo kada umrem.
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno): //
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:753Neke slike/video za lakse dobivanje pomoci(neobavezno): //
Kingpin
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
241 / 250 XP
Početnik(0)
1,344
Postovi:
96
Teme:
Pridružio se:Jun 2012
10. Jan. 2016.
daj onplayerdeath
valjda nije dugaÄak puno 😄
ja msm da moras provjerit da li je killderid = INVALID_PLAYER_ID
nesto ovako
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.
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.
Crime Lord
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
902
Postovi:
145
Teme:
Pridružio se:Sep. 2013
Crime Lord
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
902
Postovi:
145
Teme:
Pridružio se:Sep. 2013
Crime Lord
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
902
Postovi:
145
Teme:
Pridružio se:Sep. 2013
Kingpin
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
241 / 250 XP
Početnik(0)
1,344
Postovi:
96
Teme:
Pridružio se:Jun 2012
13. Jan. 2016.
Ajd evo sjeo sam malo pa rpegledao tvoj kod, probaj zamjenit ovo
Za 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));
}Crime Lord
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
902
Postovi:
145
Teme:
Pridružio se:Sep. 2013
Crime Lord
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
902
Postovi:
145
Teme:
Pridružio se:Sep. 2013
Crime Lord
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
902
Postovi:
145
Teme:
Pridružio se:Sep. 2013
Shot Caller
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
175
Postovi:
24
Teme:
Pridružio se:Okt. 2014
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