- 0
Eroare warr/turf/ore buguite
-
Similar Content
-
Eroare idk
By Ronni,
- 0 replies
- 54 views
-
- 5 replies
- 284 views
-
- 3 answers
- 86 views
-
eroare job
By viji,
- 5 answers
- 120 views
-
- 2 answers
- 213 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
SakaLuX
Problema intalnita (descriere): Primesc erori de genul cand playerii se omoara intre ei si cred ca au legatura cu war-urile sau turfs
Ero(area / rile) / warning-(ul / urile):
[14:35:08] [debug] Run time error 4: "Array index out of bounds"
[14:35:08] [debug] Accessing element at index 73 past array upper bound 72
[14:35:08] [debug] AMX backtrace:
[14:35:08] [debug] #0 0007b7c0 in public IsPlayerInTurf (playerid=1, turfid=73) at C:\Users\SakaLuX\Downloads\samp\pawno\WhiteCs.pwn:8574
[14:35:08] [debug] #1 000a1994 in public AB_OnPlayerDeath (playerid=1, killerid=65535, reason=255) at C:\Users\SakaLuX\Downloads\samp\pawno\WhiteCs.pwn:11653
[14:35:08] [debug] #2 00024de4 in public fk_OnPlayerDeath (playerid=1, killerid=65535, reason=255) at C:\Users\SakaLuX\Downloads\pawno\include\OPA.inc:71
[14:35:08] [debug] #3 0001d7e0 in public OnPlayerDeath (playerid=1, killerid=65535, reason=255) at C:\Users\SakaLuX\Downloads\samp\pawno\include\OnPlayerFakeKill.inc:47
Liniile de cod / sursa / script-ul(obligatoriu):
Asta e 8574 if(x >= TurfInfo[turfid][zMinX] && x < TurfInfo[turfid][zMaxX] && y >= TurfInfo[turfid][zMinY] && y < TurfInfo[turfid][zMaxY])
public IsPlayerInTurf(playerid, turfid)
{
if(IsPlayerConnected(playerid))
{
if(turfid == -1)
{
return 0;
}
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
if(x >= TurfInfo[turfid][zMinX] && x < TurfInfo[turfid][zMaxX] && y >= TurfInfo[turfid][zMinY] && y < TurfInfo[turfid][zMaxY])
{
return 1;
}
}
return 0;
}
11653 if(IsPlayerInTurf(playerid, i) == 1)
public OnPlayerDeath(playerid, killerid, reason)
{
Alive[playerid] = 0;
CheckDelay[playerid] = 10;
TextDrawHideForPlayer(playerid, Status[playerid]);
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleVariables[vehicleid][vVehicleJob] == 7)
{
format(szMessage, sizeof(szMessage), "Job failed.");
SCM(playerid, COLOR_NOB, szMessage);
SetVehicleToRespawnEx(vehicleid);
KillTimer(mowertimer[playerid]);
MowerMoney[playerid] = 0;
TextDrawHideForPlayer(playerid,Mower[playerid]);
playerVariables[playerid][pFarmerMoney] = 0;
}
if(PlayerPaintballing[playerid] != 0)
{
foreach(Player, x)
{
if((PlayerPaintballing[playerid] != 0 && PlayerPaintballing[killerid] != 0) && PlayerPaintballing[x])
{
SendDeathMessageToPlayer(x, killerid, playerid, reason);
}
}
new string[500];
new pinfo[128];
KillP[killerid]++;
DeathP[playerid]++;
format(string, sizeof(string), "You have killed %s. You now have %d kills.",GetName(playerid), KillP[killerid]);
SendClientMessage(killerid, COLOR_GENANNOUNCE, string);
format(string, sizeof(string), "You have been killed by %s.",GetName(killerid));
SendClientMessage(playerid, COLOR_GENANNOUNCE, string);
PlayerPaintballScore[killerid] = KillP[killerid];
if(PlayerPaintballScore[killerid] > PaintballWinnerScore)
{
PaintballWinner = killerid;
PaintballWinnerScore = PlayerPaintballScore[killerid];
foreach(Player,i)
{
if(IsPlayerConnected(i))
{
if(PlayerPaintballing != 0)
{
format(pinfo,sizeof(pinfo),"%s is now in lead with %d kills.",GetName(PaintballWinner),PaintballWinnerScore);
SCM(i, COLOR_YELLOW, pinfo);
}
}
}
}
return 1;
}
KillTimer(mowertimer[playerid]);
if(playerVariables[playerid][pHeadValue] > 0)
{
if(IsPlayerConnected(killerid))
{
if(playerVariables[killerid][pGroup] == 12)
{
if(GoChase[killerid] == playerid)
{
new string[256];
new killer[MAX_PLAYER_NAME];
new name[MAX_PLAYER_NAME];
GetPlayerName(killerid, killer, sizeof(killer));
GetPlayerName(playerid, name, sizeof(name));
playerVariables[killerid][pMoney] += playerVariables[playerid][pHeadValue];
format(string,128,"%s has succesfully completed the contract on %s for $%d, distance: %.0fm.",killer,name,playerVariables[playerid][pHeadValue], GetDistanceBetweenPlayers(killerid, playerid));
SendToGroup(12, COLOR_HIT, string);
playerVariables[playerid][pHeadValue] = -1;
GotHit[playerid] = 0;
GetChased[playerid] = 999;
GoChase[killerid] = 999;
}
}
}
}
new turfkiller, turfplayerid;
for(new i = 0; i <= sizeof(TurfInfo); i++)
{
if(IsPlayerInTurf(playerid, i) == 1)
{
turfplayerid = i;
break;
}
}
for(new i = 0; i <= sizeof(TurfInfo); i++)
{
if(IsPlayerInTurf(killerid, i) == 1)
{
turfkiller = i;
break;
}
}
new string[256];
if(WarInfo[turfplayerid][wTime] > 0 && WarInfo[turfkiller][wTime] > 0)
{
if(turfplayerid == turfkiller)
{
if(playerVariables[playerid][pGroup] == WarInfo[turfplayerid][wAttacker] && playerVariables[killerid][pGroup] == WarInfo[turfplayerid][wFaction])
{
playerVariables[playerid][pWarDeaths] += 1;
format(string, sizeof(string), "You have been killed by %s (%i)", playerVariables[killerid][pNormalName], killerid);
SCM(playerid, COLOR_GENANNOUNCE, string);
groupVariables[WarInfo[turfkiller][wFaction]][gScore] += 1;
playerVariables[killerid][pWarScore] += 1;
format(string, sizeof(string), "You have killed %s (%i).", playerVariables[playerid][pNormalName], playerid);
SCM(killerid, COLOR_GENANNOUNCE, string);
foreach(Player, x)
{
if(playerVariables[x][pGroup] == WarInfo[turfplayerid][wAttacker] || playerVariables[x][pGroup] == WarInfo[turfplayerid][wFaction])
{
SendDeathMessageToPlayer(x, killerid, playerid, reason);
}
}
SCM(playerid, COLOR_LIGHTBLUE, "You will be spawned in the HQ.");
}
else if(playerVariables[killerid][pGroup] == WarInfo[turfkiller][wAttacker] && playerVariables[playerid][pGroup] == WarInfo[turfkiller][wFaction])
{
playerVariables[playerid][pWarDeaths] += 1;
format(string, sizeof(string), "You have been killed by %s (%i).", playerVariables[killerid][pNormalName], killerid);
SCM(playerid, COLOR_GENANNOUNCE, string);
groupVariables[WarInfo[turfplayerid][wAttacker]][gScore] += 1;
playerVariables[killerid][pWarScore] += 1;
format(string, sizeof(string), "You have killed %s (%i).", playerVariables[playerid][pNormalName], playerid);
SCM(killerid, COLOR_GENANNOUNCE, string);
foreach(Player, x)
{
if(playerVariables[x][pGroup] == WarInfo[turfplayerid][wAttacker] || playerVariables[x][pGroup] == WarInfo[turfplayerid][wFaction])
{
SendDeathMessageToPlayer(x, killerid, playerid, reason);
}
}
SCM(playerid, COLOR_LIGHTBLUE, "You will be spawned in group HQ.");
}
}
}
if((WarInfo[turfkiller][wTime] != 0 && (WarInfo[turfkiller][wAttacker] == playerVariables[playerid][pGroup] || WarInfo[turfkiller][wFaction] == playerVariables[playerid][pGroup]) && playerVariables[playerid][pGroup] != 0) || (playerVariables[killerid][pGroup] == 1
|| playerVariables[killerid][pGroup] == 2 || playerVariables[killerid][pGroup] == 3 || playerVariables[killerid][pGroup] == 5) || (playerVariables[playerid][pGroup] == 1 || playerVariables[playerid][pGroup] == 2 || playerVariables[playerid][pGroup] == 3 || playerVariables[playerid][pGroup] == 5) || (playerVariables[playerid][pGroup] == playerVariables[killerid][pGroup]) || (PlayerPaintballing[killerid] >= 1))
{
}
else
{
WantedID[playerid] = killerid;
SCM(playerid, COLOR_GENANNOUNCE, "You have been attacked by another player. You have 60 seconds to call the police to report this crime. Use /call 112.");
WantedIDTime[playerid] = 60;
}
//SetTimerEx("Spawn", 3999, 0, "d", playerid);
SetPlayerHealth(playerid, 0);
killerid = INVALID_PLAYER_ID;
return 1;
}
71 return 1;
public OnPlayerDeath(playerid, killerid, reason)
{
g_abLastTick[playerid] = gettime() + 3;
#if defined AB_OnPlayerDeath
AB_OnPlayerDeath(playerid, killerid, reason);
#endif
return 1;
}
47 return true;
public OnPlayerDeath(playerid, killerid, reason)
{
if(!IsPlayerNPC(playerid))
{
if(gettime() - StartDeathTick[playerid] < 5) //5 seconds
{
CountDeaths[playerid] ++;
if(CountDeaths[playerid] == 10)
{
CallLocalFunction("OnPlayerFakeKill", "i", playerid);
return CountDeaths[playerid] = 0;
}
}
else CountDeaths[playerid] = 1;
StartDeathTick[playerid] = gettime();
}
#if defined fk_OnPlayerDeath
fk_OnPlayerDeath(playerid, killerid, reason);
#endif
return true;
}
M-ai am un bug in care un player intra pe sv joaca 2 minute si in /stats ii apare +100 de ore.... /getmats nu functioneaza... si uneori si /stats nu merge... trebuie sa scrie /quitjob ca sa mearga dinou... Astea le vom rezolva dupa ce terminam cu cele date mai sus!
Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Am incercat sa pun la eroarea 47 In loc de return true sa pun return 1 dar degeaba... si am mai facut schimbari dar tot nu am ajuns la rezolvare... ceea ce vedeti mai sus nu am schimbat nimic ca sa nu fie vreo problema
Link to comment
Share on other sites
5 answers to this question
Recommended Posts