02.12.2013, 12:57
Из-за чего все так?
Quote:
[17:39:58] [debug] Run time error 4: "Array index out of bounds" [17:39:58] [debug] Accessing element at index 682 past array upper bound 681 [17:39:58] [debug] AMX backtrace: [17:39:58] [debug] #0 0000ba1c in ?? () from GameMode.amx [17:39:58] [debug] #1 0001b394 in public aat_OnPlayerSpawn () from GameMode.amx [17:39:58] [debug] #2 0000f47c in public OnPlayerSpawn () from GameMode.amx |
PHP код:
public OnPlayerSpawn(playerid)
{
if(PlayerLogged[playerid] == 0) return GKick(playerid);
SetPlayerVirtualWorld(playerid,0);
PlayerPlaySound(playerid,1184,0.0,0.0,0.0);
SetPVarInt(playerid,"K_Times",0);
SetPVarInt(playerid, "AntiBreik", 3);
SetPlayerSkills(playerid);
SetHealth(playerid,100.00);
sitosti = CreateProgressBar(548.00, 35.00, 57.50, 6.19, 3407871, 100.0);
SetProgressBarValue(sitosti, PlayerInfo[playerid][pSatiety]);
if(animload[playerid] == false)
{
PreloadAnimLib(playerid,"BOMBER");
PreloadAnimLib(playerid,"BD_FIRE");
PreloadAnimLib(playerid,"RAPPING");
PreloadAnimLib(playerid,"SHOP");
PreloadAnimLib(playerid,"BEACH");
PreloadAnimLib(playerid,"SMOKING");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"ON_LOOKERS");
PreloadAnimLib(playerid,"DEALER");
PreloadAnimLib(playerid,"CRACK");
PreloadAnimLib(playerid,"CARRY");
PreloadAnimLib(playerid,"CASINO");
PreloadAnimLib(playerid,"COP_AMBIENT");
PreloadAnimLib(playerid,"PARK");
PreloadAnimLib(playerid,"INT_HOUSE");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"CRIB");
PreloadAnimLib(playerid,"ROB_BANK");
PreloadAnimLib(playerid,"JST_BUISNESS");
PreloadAnimLib(playerid,"PED");
PreloadAnimLib(playerid,"OTB");
PreloadAnimLib(playerid,"BUDDY");
animload[playerid] = true;
}
if(PlayerInfo[playerid][pFightStyle] != 0)
{
SetPlayerFightingStyle(playerid,PlayerInfo[playerid][pFightStyle]);
}
else SetPlayerFightingStyle(playerid,0);
GunCheckTime[playerid] = 5;
SetMoney(playerid, PlayerInfo[playerid][pCash]);
SetPlayerTeamColor(playerid);
ResetWeapon(playerid);
LoadPWeapon(playerid);
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
if(PlayerInfo[playerid][pWanted] > 0) SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
if(PlayerLogged[playerid] == 0) SendClientMessage(playerid, COLOR_LIGHTRED, PlayerNeedToLoggedForToPlay), GKick(playerid);
if(PlayerInfo[playerid][pChar] > 0) SetPlayerSkin(playerid,PlayerInfo[playerid][pChar]);
else SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
if(ClothesRound[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "×òî áû ïðîñìàòðèâàòü îäåæäó, èñïîëüçóéòå ñòðåëî÷êè íà ýêðàíå!");
SetPlayerVirtualWorld(playerid, playerid);
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,208.4520,-160.8391,1000.5234);
SetPlayerFacingAngle(playerid,180.9319);
SetPlayerCameraPos(playerid, 207.6285, -166.3627, 1003.5407);
SetPlayerCameraLookAt(playerid, 207.6098, -165.3643, 1003.1712);
ApplyAnimation(playerid,"DEALER"," DEALER_IDLE ",4.1,1,1,1,1,1);
TogglePlayerControllable(playerid, 0);
TextDrawShowForPlayer(playerid,ButtonLeft);
TextDrawShowForPlayer(playerid,ButtonRight);
TextDrawShowForPlayer(playerid,ButtonSelect);
SelectTextDraw(playerid, 0x2641FEAA);
SetHealth(playerid,100.00);
if(PlayerInfo[playerid][pSex] == 1) SetPlayerSkin(playerid, JoinReg[0][0]), SelectCharRegID[playerid] = 1, ChosenSkin[playerid] = JoinReg[0][0];
else SetPlayerSkin(playerid, JoinReg[5][0]), SelectCharRegID[playerid] = 1, ChosenSkin[playerid] = JoinReg[5][0];
}
else if(ClothesRound[playerid] == 2)
{
SendClientMessage(playerid, COLOR_YELLOW, "×òîáû ïðîñìàòðèâàòü îäåæäó, èñïîëüçóéòå ñòðåëî÷êó =>, äëÿ âûáîðà íàæìèòå 'SELECT'");
SetPlayerVirtualWorld(playerid, playerid);
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,208.4520,-160.8391,1000.5234);
SetPlayerFacingAngle(playerid,180.9319);
SetPlayerCameraPos(playerid, 207.6285, -166.3627, 1003.5407);
SetPlayerCameraLookAt(playerid, 207.6098, -165.3643, 1003.1712);
ApplyAnimation(playerid,"DEALER"," DEALER_IDLE ",4.1,1,1,1,1,1);
TogglePlayerControllable(playerid, 0);
SelectTextDraw(playerid, 0x2641FEAA);
TextDrawShowForPlayer(playerid,ButtonRight);
TextDrawShowForPlayer(playerid,ButtonSelect);
if(SelectCharID[playerid] == F_MAYOR) SetPlayerSkin(playerid, JoinPed[0][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[0][0];
if(SelectCharID[playerid] == F_POLICE_LS || SelectCharID[playerid] == F_POLICE_SF || SelectCharID[playerid] == F_POLICE_LV) SetPlayerSkin(playerid, JoinPed[6][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[6][0];
if(SelectCharID[playerid] == F_FBI || SelectCharID[playerid] == F_CIA) SetPlayerSkin(playerid, JoinPed[14][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[14][0];
if(SelectCharID[playerid] == F_HOSPITAL) SetPlayerSkin(playerid, JoinPed[19][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[19][0];
if(SelectCharID[playerid] == F_LIC) SetPlayerSkin(playerid, JoinPed[25][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[25][0];
if(SelectCharID[playerid] == F_GROVE) SetPlayerSkin(playerid, JoinPed[36][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[36][0];
if(SelectCharID[playerid] == F_BALLAS) SetPlayerSkin(playerid, JoinPed[32][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[32][0];
if(SelectCharID[playerid] == F_AZTECAS) SetPlayerSkin(playerid, JoinPed[43][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[43][0];
if(SelectCharID[playerid] == F_VAGOS) SetPlayerSkin(playerid, JoinPed[47][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[47][0];
if(SelectCharID[playerid] == F_RIFA) SetPlayerSkin(playerid, JoinPed[51][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[51][0];
if(SelectCharID[playerid] == F_ARMY) SetPlayerSkin(playerid, JoinPed[30][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[30][0];
if(SelectCharID[playerid] == F_YAKUZA) SetPlayerSkin(playerid, JoinPed[58][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[58][0];
if(SelectCharID[playerid] == F_RM) SetPlayerSkin(playerid, JoinPed[65][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[65][0];
if(SelectCharID[playerid] == F_LCN) SetPlayerSkin(playerid, JoinPed[71][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[71][0];
if(SelectCharID[playerid] == F_NEWS) SetPlayerSkin(playerid, JoinPed[75][0]),SelectCharPlace[playerid] = 1, ChosenSkin[playerid] = JoinPed[75][0];
}
else if(ClothesRound[playerid] == 3)
{
new string[128];
SendClientMessage(playerid, COLOR_YELLOW, "Âûáåðèòå ñåáå ïîäõîäÿùóþ îäåæäó, ïîñëå âûáîðà íàæìèòå 'SELECT', äëÿ îòìåíû íàæìèòå 'CANCEL'");
SendClientMessage(playerid, COLOR_LIGHTRED, "×òîáû ïðîñìîòðåòü îäåæäó, èñïîëüçóéòå ñòðåëî÷êè <= èëè =>");
SetPlayerVirtualWorld(playerid, playerid);
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,208.4520,-160.8391,1000.5234);
SetPlayerFacingAngle(playerid,180.9319);
SetPlayerCameraPos(playerid, 207.6285, -166.3627, 1003.5407);
SetPlayerCameraLookAt(playerid, 207.6098, -165.3643, 1003.1712);
ApplyAnimation(playerid,"DEALER"," DEALER_IDLE ",4.1,1,1,1,1,1);
TogglePlayerControllable(playerid, 0);
TextDrawShowForPlayer(playerid,ButtonRight);
TextDrawShowForPlayer(playerid,ButtonSelect);
TextDrawShowForPlayer(playerid,ButtonCancel);
TextDrawShowForPlayer(playerid,ButtonLeft);
SelectTextDraw(playerid, 0x2641FEAA);
//PlayerSpawned[playerid] = 1;
if(PlayerInfo[playerid][pSex] == 1)
{
SelectCharPlace[playerid] = 0;
SetPlayerSkin(playerid, JoinShopM[SelectCharPlace[playerid]][0]);
format(string, 128, "~b~~n~~n~~n~~n~~n~~n~PRICE: ~w~%i",JoinShopM[SelectCharPlace[playerid]][1]);
}
else
{
SelectCharPlace[playerid] = 0;
SetPlayerSkin(playerid, JoinShopF[SelectCharPlace[playerid]][0]);
format(string, 128, "~b~~n~~n~~n~~n~~n~~n~PRICE: ~w~%i",JoinShopF[SelectCharPlace[playerid]][1]);
}
GameTextForPlayer(playerid, string, 2000, 3);
}
else
{
if(PlayerInfo[playerid][pJail] == 1)
{
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid,264.1425,77.4712,1001.0391);
SetPlayerFacingAngle(playerid, 263.0160);
new string[128];
format(string, 80, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~JAILED: ~w~%s", PlayerInfo[playerid][pJailTime]-10);
GameTextForPlayer(playerid, string, 1000, 3);
SendClientMessage(playerid, COLOR_LIGHTRED, "Âû åùå íå îòñèäåëè ñâîé òþðåìíûé ñðîê");
PlayerSpawned[playerid] = 1;
return true;
}
if(PlayerInfo[playerid][pJail] == 2)
{
SetPlayerInterior(playerid, 10);
SetPlayerPos(playerid,219.5400,109.9767,999.0156);
SetPlayerFacingAngle(playerid, 1.0000);
new string[128];
format(string, 80, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~JAILED: ~w~%s", PlayerInfo[playerid][pJailTime]-10);
GameTextForPlayer(playerid, string, 1000, 3);
SendClientMessage(playerid, COLOR_LIGHTRED, "Âû åùå íå îòñèäåëè ñâîé òþðåìíûé ñðîê");
PlayerSpawned[playerid] = 1;
return true;
}
if(PlayerInfo[playerid][pJail] == 3)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,285.7703,286.7446,996.5789);
SetPlayerFacingAngle(playerid, 0.0000);
new string[128];
format(string, 80, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~JAILED: ~w~%s", PlayerInfo[playerid][pJailTime]-10);
GameTextForPlayer(playerid, string, 1000, 3);
SendClientMessage(playerid, COLOR_LIGHTRED, "Âû åùå íå îòñèäåëè ñâîé òþðåìíûé ñðîê");
PlayerSpawned[playerid] = 1;
return true;
}
if(PlayerInfo[playerid][pJail] == 4)
{
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid,193.4487,175.4382,1003.0234);
SetPlayerFacingAngle(playerid, 0.0000);
new string[128];
format(string, 80, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~JAILED: ~w~%s", PlayerInfo[playerid][pJailTime]-10);
GameTextForPlayer(playerid, string, 1000, 3);
SendClientMessage(playerid, COLOR_LIGHTRED, "Âû åùå íå îòñèäåëè ñâîé òþðåìíûé ñðîê");
return true;
}
else if(PlayerInfo[playerid][pHospital] == 1)
{
TogglePlayerControllable(playerid,false);
SetTimerEx("PlayerToggle", 1600, false, "d", playerid);
SetHealth(playerid, 15.0);
SetPlayerFacingAngle(playerid, 90);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid,1178.7709,-1378.5133,13.8859);
PlayerSpawned[playerid] = 1;
return true;
}
for(new i = 1; i <= TOTALHOUSE;i++)
{
if(!strcmp(HouseInfo[i][hOwner],PlayerInfo[playerid][pSendername],true))
{
if(PlayerInfo[playerid][pSpawnChange] != 0)
{
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
SetPlayerInterior(playerid,HouseInfo[i][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[i][hVirtual]);
SetPVarInt(playerid, "PlayerHouse", i);
PlayerSpawned[playerid] = 1;
return true;
}
}
}
//=========================== Spawns Ôðàêöèé ===========================
if(PlayerInfo[playerid][pMember] == 0) // Spawns ïðèåçæèõ
{
if(PlayerInfo[playerid][pLevel] >= 1 && PlayerInfo[playerid][pLevel] <= 10000)
{
TogglePlayerControllable(playerid,false);
SetPlayerPos(playerid,1154.3702,-1768.4338,16.5938);
SetPlayerFacingAngle(playerid, 359.7278);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
SetTimerEx("PlayerToggle", 1000, false, "d", playerid);
//return true;
}
}
if(PlayerInfo[playerid][pMember] == F_MAYOR)
{
SetPlayerPos(playerid,337.1920,193.5128,1014.1797);
SetPlayerFacingAngle(playerid, 265.8);
SetPlayerInterior(playerid,3);
SetPlayerVirtualWorld(playerid, 1);
//return true;
}
if(PlayerInfo[playerid][pMember] == F_POLICE_LS)
{
SetPlayerPos(playerid,234.1521,71.5594,1005.0391);
SetPlayerFacingAngle(playerid, 358.0);
SetPlayerInterior(playerid, 6);
SetPlayerVirtualWorld(playerid, 0);
//return true;
}
if(PlayerInfo[playerid][pMember] == F_POLICE_SF)
{
SetPlayerPos(playerid,225.1647,121.0442,999.0786);
SetPlayerFacingAngle(playerid, 89.0);
SetPlayerInterior(playerid, 10);
SetPlayerVirtualWorld(playerid, 0);
//return true;
}
if(PlayerInfo[playerid][pMember] == F_FBI)
{
SetPlayerPos(playerid,323.5093,286.0427,1007.3959);
SetPlayerFacingAngle(playerid, 359.3);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
//return true;
}
if(PlayerInfo[playerid][pMember] == F_HOSPITAL)
{
SetPlayerPos(playerid,1178.8590,-1347.5291,13.8859);
SetPlayerFacingAngle(playerid, 67.5002);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
//return true;
}
if(PlayerInfo[playerid][pMember] == F_LIC)
{
SetPlayerPos(playerid,-2032.8049,-117.4445,1035.1719);
SetPlayerFacingAngle(playerid, 269.9);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 1);
//return true;
}
else if(PlayerInfo[playerid][pMember] == F_GROVE && GetPVarInt(playerid,"Hospital") == 0)
{
t_SetPlayerPos(playerid,2483.2910,-1637.9647,14.3169);
SetPlayerFacingAngle(playerid, 225.2027);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPVarInt(playerid,"Hospital",0);
//return true;
}
else if(PlayerInfo[playerid][pMember] == F_BALLAS && GetPVarInt(playerid,"Hospital") == 0)
{
t_SetPlayerPos(playerid,2488.5366,-1987.3193,13.8949);
SetPlayerFacingAngle(playerid, 130.5200);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPVarInt(playerid,"Hospital",0);
//return true;
}
else if(PlayerInfo[playerid][pMember] == F_RIFA && GetPVarInt(playerid,"Hospital") == 0)
{
t_SetPlayerPos(playerid,2172.1450,-1780.1101,13.5756);
SetPlayerFacingAngle(playerid, 189.2710);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPVarInt(playerid,"Hospital",0);
//return true;
}
else if(PlayerInfo[playerid][pMember] == F_AZTECAS && GetPVarInt(playerid,"Hospital") == 0)
{
t_SetPlayerPos(playerid,1689.3876,-2094.1104,13.9339);
SetPlayerFacingAngle(playerid,49.1287);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPVarInt(playerid,"Hospital",0);
//return true;
}
else if(PlayerInfo[playerid][pMember] == F_VAGOS && GetPVarInt(playerid,"Hospital") == 0)
{
t_SetPlayerPos(playerid,2799.4390,-1620.4969,14.5990);
SetPlayerFacingAngle(playerid, 301.3435);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPVarInt(playerid,"Hospital",0);
//return true;
}
if(PlayerInfo[playerid][pMember] == F_ARMY)
{
SetPlayerPos(playerid,247.8784,1859.4562,14.0840);
SetPlayerFacingAngle(playerid, 90.2);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
// return true;
}
if(PlayerInfo[playerid][pMember] == F_CIA)
{
SetPlayerPos(playerid,-1936.6405,646.8841,46.5625);
SetPlayerFacingAngle(playerid,337.4248);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
//return true;
}
if(PlayerInfo[playerid][pMember] == F_LCN)
{
SetPlayerPos(playerid,2541.0574,-1295.1235,1054.6406);
SetPlayerFacingAngle(playerid, 92.2);
SetPlayerInterior(playerid, 2);
SetPlayerVirtualWorld(playerid, 2);
//return true;
}
if(PlayerInfo[playerid][pMember] == F_YAKUZA)
{
SetPlayerPos(playerid,1265.7104,-793.7453,1084.0078);
SetPlayerFacingAngle(playerid,268.5670);
SetPlayerInterior(playerid, 5);
SetPlayerVirtualWorld(playerid, 1);
//return true;
}
if(PlayerInfo[playerid][pMember] == F_RM)
{
SetPlayerPos(playerid,2558.9172,-1296.3939,1060.9844);
SetPlayerFacingAngle(playerid, 272.3);
SetPlayerInterior(playerid, 2);
SetPlayerVirtualWorld(playerid, 1);
//return true;
}
if(PlayerInfo[playerid][pMember] == F_NEWS)
{
SetPlayerPos(playerid,2171.5288,1602.0793,999.9686);
SetPlayerFacingAngle(playerid, 87.7);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid, 1);
//return true;
}
if(PlayerInfo[playerid][pMember] == F_POLICE_LV)
{
SetPlayerPos(playerid,246.0800,186.8824,1008.1719);
SetPlayerFacingAngle(playerid, 178.7634);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 0);
//return true;
}
}
PreloadAllAnims(playerid);
PlayerSpawned[playerid] = 1;
return true;
}