Ден4ик20
Умник
Помогите пожалуйста , с меня + за помощь
Вот что выскакивает :
А вот паблик:
Вот что выскакивает :
PHP:
[03:39:32] [debug] Run time error 4: "Array index out of bounds"
[03:39:32] [debug] Accessing element at negative index -1
[03:39:32] [debug] AMX backtrace:
[03:39:32] [debug] #0 00038788 in ?? () from BS.amx
[03:39:32] [debug] #1 000360d8 in public OneSecondTimer () from BS.amx
[03:39:33] [debug] Run time error 4: "Array index out of bounds"
[03:39:33] [debug] Accessing element at negative index -1
А вот паблик:
PHP:
publics OneSecondTimer()
{
new Float:maxspeed = 175.0;
new plname[MAX_PLAYER_NAME];
new string[256];
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float: vX, Float: vY, Float: vZ;
new Keys,ud,lr;
SetPlayerUnjail();
GetMoney();
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
CheckMeshok(i);
if(PlayerInfo[i][pTestTime] > 0)
{
PlayerInfo[i][pTestTime] -= 1;
}
if (PlayerToPoint(5.0, i, -2026.9520,125.7037,28.7911) && Pickup[i] == 0)
{
new newcar = GetPlayerVehicleID(i);
if(MotoVeh(newcar) || GetVehicleModel(newcar) == 462 || BikeVeh(newcar) || BoatVeh(newcar) || PlaneVeh(newcar) || GruzVeh(newcar))
{
return true;
}
if(!BoatVeh(newcar) || !PlaneVeh(newcar) || !BikeVeh(newcar) || !MotoVeh(newcar) || !PlaneVeh(newcar) || GetVehicleModel(newcar) != 462)
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
Pickup[i] = 1;
ShowPlayerDialog(i,10,DIALOG_STYLE_LIST,"Óñòàíîâêà íåîíà"," - Êðàñíûé\n - Ñèíèé\n - Çåë¸íûé\n - Æåëòûé\n - Ðîçîâûé\n - Áåëûé\n - Óäàëèòü íåîí","Âûáðàòü","Îòìåíà");
}
}
}
if(CarFinding[i] == 1)
{
GetVehiclePos(PlayerInfo[i][pCarKey]+1, vX, vY, vZ);
SetPlayerCheckpoint(i, vX, vY, vZ, 8.0);
CP[i] = 0;
}
if(DrugsInterval[i] > 0)
{
DrugsInterval[i]--;
}
if(FirstAidTime[i] != 255)
{
FirstAidTime[i]--;
if(FirstAidTime[i] == 0)
{
SetPlayerHealth(i, 25);
FirstAidTime[i] = 255;
}
}
if(SafeTime[i] > 0)
{
SafeTime[i]--;
}
if(SafeTime[i] == 1)
{
if(gPlayerAccount[i] == 1 && gPlayerLogged[i] == 0)
{
}
}
if(GetPlayerState(i) == 2)
{
GetPlayerPos(i, TelePos[i][3], TelePos[i][4], TelePos[i][5]);
if(TelePos[i][5] > 550.0)
{
TelePos[i][0] = 0.0;
TelePos[i][1] = 0.0;
}
if(TelePos[i][0] != 0.0)
{
new Float:xdist = TelePos[i][3]-TelePos[i][0];
new Float:ydist = TelePos[i][4]-TelePos[i][1];
new Float:sqxdist = xdist*xdist;
new Float:sqydist = ydist*ydist;
new Float:distance = (sqxdist+sqydist)/31;
if(gSpeedo[i] == 2)
{
if(distance <10)
{
f(string,"~n~~n~~n~~n~~n~~n~~n~~g~mph : ~w~%.0f",distance);
}
if(distance > 10 && distance < 100)
{
f(string,"~n~~n~~n~~n~~n~~n~~n~~g~mph : ~w~%.0f",distance);
}
if(distance > 100)
{
f(string,"~n~~n~~n~~n~~n~~n~~n~~g~mph : ~w~%.0f",distance);
}
GameTextForPlayer(i, string, 2000, 5);
}
if(distance > maxspeed)
{
new tmpcar = GetPlayerVehicleID(i);
if(!PlaneVeh(tmpcar))
{
GetPlayerKeys(i,Keys,ud,lr);
if(Keys & 4)
{
GetPlayerName(i, plname, sizeof(plname));
f(string,"Àíòè÷èò: %s[%d] èñïîëüçóåò Speedhack (%.0f mp/h)",plname,i,distance);
ABroadCast(COLOR_YELLOW,string,1);
}
}
}
}
if(TelePos[i][5] < 550.0 && TelePos[i][3] != 0.0)
{
TelePos[i][0] = TelePos[i][3];
TelePos[i][1] = TelePos[i][4];
}
}
if(PlayerInfo[i][pLocal] != 255 && PlayerInfo[i][pInt] != 0)
{
new house = PlayerInfo[i][pLocal];
GetPlayerPos(i, oldposx, oldposy, oldposz);
if(oldposz != 0.0)
{
if(oldposz < 600.0)
{
if(house > 10000)
{
if (!PlayerToPoint(6, i,1040.6,-1021.0,31.7) && house == 10001 ||!PlayerToPoint(6, i,-2720.5,217.5,4.1) && house == 10002 ||!PlayerToPoint(6, i,2644.6,-2044.9,13.3) && house == 10003)
{
new oldcash = gSpentCash[i];
new Total = PlayerInfo[i][pMoney] - oldcash;
printf("Total %d = PlayerInfo[playerid][pMoney] %d - oldcash %d",Total,PlayerInfo[i][pMoney],oldcash);
new name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(string,128,"<< %s ïîêèíóë ðåäàêòîð äîìà ñ $%d >>",name,Total);
log("Pay", string);
gSpentCash[i] = 0;
TelePos[i][0] = 0.0;
TelePos[i][1] = 0.0;
PlayerInfo[i][pLocal] = 255;
SetPlayerInterior(i,0);
PlayerInfo[i][pInt] = 0;
}
}
}
}
}
if(CellTime[i] > 0)
{
if (CellTime[i] == cchargetime)
{
CellTime[i] = 1;
if(Mobile[Mobile[i]] == i)
{
CallCost[i] = CallCost[i]+callcost;
}
}
CellTime[i] = CellTime[i] +1;
if (Mobile[Mobile[i]] == 255 && CellTime[i] == 5)
{
if(IsPlayerConnected(Mobile[i]))
{
new called[MAX_PLAYER_NAME];
GetPlayerName(Mobile[i], called, sizeof(called));
f(string,"Ó %s çàçâîíèë òåëåôîí.", called);
RingTone[Mobile[i]] = 10;
ProxDetector(30.0, Mobile[i], string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
}
if(CellTime[i] == 0 && CallCost[i] > 0)
{
f(string,"~w~*CO…–OC’ ˆ‹OìKA~n~~r~$%d",CallCost[i]);
PlayerInfo[i][pMoney] -= CallCost[i];
SBizzInfo[2][sbTill] += CallCost[i];
GameTextForPlayer(i, string, 5000, 1);
CallCost[i] = 0;
}
if(TransportTime[i] > 0)
{//Taxi driver and passenger only
if(TransportTime[i] >= 15)
{
TransportTime[i] = 1;
if(TransportDriver[i] < 999)
{
if(IsPlayerConnected(TransportDriver[i]))
{
if(GetSRVMoney(i) >= TransportCost[i])
{
TransportCost[i] += TransportValue[TransportDriver[i]];
TransportCost[TransportDriver[i]] = TransportCost[i];
}
else
{
RemovePlayerFromVehicle(i); SetTimerEx("CarHack", 3000, false, "i", i);
}
}
}
}
TransportTime[i] += 1;
f(string,"~r~%d ~w~: ~g~$%d",TransportTime[i],TransportCost[i]);
GameTextForPlayer(i, string, 15000, 6);
}
}
}
return true;
}
