17.01.2016, 13:21
Код:
[16:18:08] [debug] Run time error 4: "Array index out of bounds" [16:18:08] [debug] Accessing element at index 300 past array upper bound 299 [16:18:08] [debug] AMX backtrace: [16:18:08] [debug] #0 0000ed0c in ?? () from PR-RP.amx [16:18:08] [debug] #1 000cce28 in public OnPlayerSpawn () from PR-RP.amx [16:18:09] Loading Bot Number 20
Код:
public OnPlayerSpawn(playerid) { if(GetPVarInt(playerid, "SpawnBug") == 1) return DeletePVar(playerid, "SpawnBug"); if(IsPlayerNPC(playerid)) return 1; new string[128]; if(GetPVarInt(playerid, "PlayerLogged") == 1) { SetPlayerSkinEx(playerid,GetPVarInt(playerid, "Model")); SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,200); SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,200); DeletePVar(playerid,"MouthCig"); switch(GetPVarInt(playerid, "FightStyle")) { case 0: SetPlayerFightingStyle(playerid,FIGHT_STYLE_NORMAL); case 1: SetPlayerFightingStyle(playerid,FIGHT_STYLE_BOXING); case 2: SetPlayerFightingStyle(playerid,FIGHT_STYLE_KUNGFU); case 3: SetPlayerFightingStyle(playerid,FIGHT_STYLE_KNEEHEAD); case 4: SetPlayerFightingStyle(playerid,FIGHT_STYLE_GRABKICK); case 5: SetPlayerFightingStyle(playerid,FIGHT_STYLE_ELBOW); } switch(GetPVarInt(playerid, "Member")) { case 1: if(GetPVarInt(playerid, "Duty") != 0) SetPlayerColor(playerid, 0xC9A527AA); case 4: if(GetPVarInt(playerid, "Duty") != 0) SetPlayerColor(playerid,0xFF8282AA); } if(GetPVarInt(playerid, "Bag") != 0) SetPlayerAttachedObject(playerid, HOLDOBJECT_BAG, 371, 1, 0.0, -0.1, 0.0, 0.0, 90.0, 0.0); switch(GetPVarInt(playerid, "InvWeapon")) { case 25: { if(GetPVarInt(playerid, "Member") == 1 || GetPVarInt(playerid, "Member") == 7) SetPlayerAttachedObject( playerid, HOLDOBJECT_GUN2, GetGunObjectID(GetPVarInt(playerid, "InvWeapon")), 1, -0.157276, -0.124338, -0.098805, 195.769546, 13.859096, 0.000000, 1.000000, 1.000000, 1.000000); else SetPlayerAttachedObject(playerid, HOLDOBJECT_GUN2, GetGunObjectID(GetPVarInt(playerid, "InvWeapon")), 1, 0.139415, -0.167970, 0.120848, 0.000000, 152.342666, 0.000000); } case 27,29,30,31,33,34: { if(GetPVarInt(playerid, "Member") == 1 || GetPVarInt(playerid, "Member") == 7) SetPlayerAttachedObject( playerid, HOLDOBJECT_GUN2, GetGunObjectID(GetPVarInt(playerid, "InvWeapon")), 1, 0.110000, 0.180000, -0.265000, 180.769546, 142.859096, 0.000000, 1.000000, 1.000000, 1.000000); else SetPlayerAttachedObject(playerid, HOLDOBJECT_GUN2, GetGunObjectID(GetPVarInt(playerid, "InvWeapon")), 1, 0.139415, -0.167970, 0.120848, 0.000000, 152.342666, 0.000000); } case 22,23,24,26,28,32: { switch(GetPlayerSkin(playerid)) { case 265 .. 267, 280 .. 287: SetPlayerAttachedObject(playerid, HOLDOBJECT_GUN2, GetGunObjectID(GetPVarInt(playerid, "InvWeapon")), 8, -0.044177, 0.000000, 0.092454, 246.994583, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000); } } } LoadMask(playerid); if(GetPVarInt(playerid, "AFK") == 1) { SetPlayerPos(playerid,GetPVarFloat(playerid,"MarkX"),GetPVarFloat(playerid,"MarkY"),GetPVarFloat(playerid,"MarkZ")); SetPlayerInterior(playerid,0); SetPlayerVirtualWorld(playerid,0); SetPlayerHealthEx(playerid,50.0); return 1; } if(GetPVarInt(playerid, "Tut") == 0) { if(GetPVarInt(playerid, "Approve") == 0) { strmid(PlayerInfo[playerid][pOOC], "None", 0, strlen("None"), 255); strmid(PlayerInfo[playerid][pMetagame], "None", 0, strlen("None"), 255); strmid(PlayerInfo[playerid][pRevenge], "None", 0, strlen("None"), 255); strmid(PlayerInfo[playerid][pRoleplay], "None", 0, strlen("None"), 255); strmid(PlayerInfo[playerid][pPowergame], "None", 0, strlen("None"), 255); strmid(PlayerInfo[playerid][pQuest1], "None", 0, strlen("None"), 255); strmid(PlayerInfo[playerid][pQuest2], "None", 0, strlen("None"), 255); strmid(PlayerInfo[playerid][pQuest3], "None", 0, strlen("None"), 255); strmid(PlayerInfo[playerid][pQuest4], "None", 0, strlen("None"), 255); strmid(PlayerInfo[playerid][pQuest5], "None", 0, strlen("None"), 255); OnConnectInit(playerid); SetPlayerWorldBounds(playerid, 432.0814, 35.03363, 2102.018, 1728.326); SetPlayerColor(playerid,0x80008096); SetPlayerVirtualWorld(playerid,1); SetPlayerInterior(playerid,0); SetPlayerPos(playerid,215.7280,1821.2645,6.4141); SetPVarInt(playerid, "Mute", 1); SetPVarInt(playerid, "Tut", 0); SetPlayerSkin(playerid,25); SetPVarInt(playerid, "TutQuestAmount", 0); return CallRemoteFunction("TutorialAnswers","i",playerid); } if(GetPVarInt(playerid, "ConnectTime") == 0) { OnConnectInit(playerid); SetPlayerMoney(playerid,1250); SetPVarInt(playerid, "Bank", 1000); } SetPVarInt(playerid, "PlayerLogged", 1); DeletePVar(playerid, "LableDraw"); LoadTutorialP(playerid); return 1; } if(GetPVarInt(playerid, "Jailed") == 2) { format(string, sizeof(string), "Ai primit ajail pentru %d .", GetPVarInt(playerid, "JailTime")); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "Motiv: %s.", PlayerInfo[playerid][pJailReason]); SendClientMessage(playerid, COLOR_WHITE, string); SetPlayerInterior(playerid, 0); if(playerid != 0) SetPlayerVirtualWorld(playerid, playerid); else SetPlayerVirtualWorld(playerid, 501); SetPlayerPos(playerid,2523.9197,-1673.8944,14.8589); TogglePlayerControllableEx(playerid, false); SetPVarInt(playerid, "Mute", 1); SetPlayerHealthEx(playerid,99.0); return 1; } if(GetPVarInt(playerid, "Jailed") == 3) { if(GetPVarInt(playerid, "Bail") == 0) format(string, sizeof(string), "Prison sentence for %d seconds, Bail: None.", GetPVarInt(playerid, "JailTime")); else format(string, sizeof(string), "Prison sentence for %d seconds, Bail: $%d.", GetPVarInt(playerid, "JailTime"), GetPVarInt(playerid, "Bail")); SendClientMessage(playerid, COLOR_WHITE, string); SetPlayerInterior(playerid, 90); SetPlayerVirtualWorld(playerid, 1); TogglePlayerControllableEx(playerid, false); new rand = random(35); switch(rand) { case 0: SetPlayerPos(playerid,1843.5868,-1732.3020,5202.5859+1.5); case 1: SetPlayerPos(playerid,1840.6082,-1732.0969,5202.5859+1.5); case 2: SetPlayerPos(playerid,1837.3689,-1732.2864,5202.5859+1.5); case 3: SetPlayerPos(playerid,1833.9435,-1731.9695,5202.5859+1.5); case 4: SetPlayerPos(playerid,1831.1238,-1731.7903,5202.5859+1.5); case 5: SetPlayerPos(playerid,1827.7970,-1732.0796,5202.5859+1.5); case 6: SetPlayerPos(playerid,1827.5924,-1710.4680,5202.5859+1.5); case 7: SetPlayerPos(playerid,1830.7355,-1711.4698,5202.5859+1.5); case 8: SetPlayerPos(playerid,1834.1029,-1711.6887,5202.5859+1.5); case 9: SetPlayerPos(playerid,1837.3362,-1711.6300,5202.5859+1.5); case 10: SetPlayerPos(playerid,1840.3849,-1711.8690,5202.5859+1.5); case 11: SetPlayerPos(playerid,1843.6633,-1711.8934,5202.5859+1.5); case 12: SetPlayerPos(playerid,1827.3882,-1732.0566,5206.1860+1.5); case 13: SetPlayerPos(playerid,1830.9949,-1732.1698,5206.1860+1.5); case 14: SetPlayerPos(playerid,1834.2728,-1731.8037,5206.1860+1.5); case 15: SetPlayerPos(playerid,1837.2111,-1732.1985,5206.1860+1.5); case 16: SetPlayerPos(playerid,1840.7469,-1731.7461,5206.1860+1.5); case 17: SetPlayerPos(playerid,1843.8475,-1731.9094,5206.1860+1.5); case 18: SetPlayerPos(playerid,1843.5913,-1710.9928,5206.1860+1.5); case 19: SetPlayerPos(playerid,1840.2179,-1711.7318,5206.1860+1.5); case 20: SetPlayerPos(playerid,1837.3470,-1711.1550,5206.1860+1.5); case 21: SetPlayerPos(playerid,1833.9822,-1711.6144,5206.1860+1.5); case 22: SetPlayerPos(playerid,1830.7404,-1711.6763,5206.1860+1.5); case 23: SetPlayerPos(playerid,1827.4083,-1711.2239,5206.1860+1.5); case 24: SetPlayerPos(playerid,1843.7363,-1732.4628,5209.6860+1.5); case 25: SetPlayerPos(playerid,1840.4147,-1732.2030,5209.6860+1.5); case 26: SetPlayerPos(playerid,1837.2146,-1731.9749,5209.6860+1.5); case 27: SetPlayerPos(playerid,1834.0748,-1732.0955,5209.6870+1.5); case 28: SetPlayerPos(playerid,1830.5750,-1731.8383,5209.6870+1.5); case 29: SetPlayerPos(playerid,1827.5675,-1732.1094,5209.6870+1.5); case 30: SetPlayerPos(playerid,1827.6600,-1711.3943,5209.6860+1.5); case 31: SetPlayerPos(playerid,1830.9219,-1711.8075,5209.6860+1.5); case 32: SetPlayerPos(playerid,1834.2236,-1711.4484,5209.6860+1.5); case 33: SetPlayerPos(playerid,1837.4734,-1711.5946,5209.6860+1.5); case 34: SetPlayerPos(playerid,1840.4496,-1711.5330,5209.6860+1.5); case 35: SetPlayerPos(playerid,1843.6206,-1711.6078,5209.6860+1.5); } SetPlayerHealthEx(playerid,99.0); Streamer_Update(playerid); SetTimerEx("TogglePlayerControllableEx", 5000, false, "ii", playerid, true); return 1; } if(GetPVarInt(playerid, "Jailed") == 4) { format(string, sizeof(string), "Detective jail sentence for %d seconds.", GetPVarInt(playerid, "JailTime")); SendClientMessage(playerid, COLOR_WHITE, string); SetPlayerInterior(playerid, 6); SetPlayerVirtualWorld(playerid, 1); SetPlayerPos(playerid,263.7917,77.7757,1001.0391); SetPlayerHealthEx(playerid,99.0); return 1; } if(GetPVarInt(playerid, "Jailed") == 5) { format(string, sizeof(string), "Military jail sentence for %d seconds.", GetPVarInt(playerid, "JailTime")); SendClientMessage(playerid, COLOR_WHITE, string); SetPlayerInterior(playerid, 3); SetPlayerVirtualWorld(playerid, 2); SetPlayerPos(playerid,193.2047,175.7343,1003.0234); SetPlayerHealthEx(playerid,99.0); return 1; } if(GetPVarInt(playerid, "Dead") == 1 || GetPVarInt(playerid, "Dead") == 2) { TogglePlayerControllableEx(playerid,false); SetPVarInt(playerid, "Dead", 2); SetPlayerPos(playerid,GetPVarFloat(playerid, "PosX"),GetPVarFloat(playerid, "PosY"),GetPVarFloat(playerid, "PosZ")); SetPlayerFacingAngle(playerid,GetPVarFloat(playerid, "Angle")); SetPlayerInterior(playerid,GetPVarInt(playerid, "Int")); SetPlayerVirtualWorld(playerid,GetPVarInt(playerid, "World")); SetCameraBehindPlayer(playerid); SendClientMessage(playerid,COLOR_WHITE,"Scrie (/accept death) daca vrei sa iti continui moartea."); SetPlayerHealthEx(playerid,1.0); new rand = random(5)+1; switch(rand) { case 1: ApplyAnimation(playerid, "ped", "FLOOR_hit", 4.0, 0, 1, 1, 1, -1); case 2: ApplyAnimation(playerid, "ped", "FLOOR_hit_f", 4.0, 0, 1, 1, 1, -1); case 3: ApplyAnimation(playerid, "ped", "KO_shot_front", 4.0, 0, 1, 1, 1, -1); case 4: ApplyAnimation(playerid, "ped", "KO_shot_stom", 4.0, 0, 1, 1, 1, -1); case 5: ApplyAnimation(playerid, "ped", "BIKE_fall_off", 4.0, 0, 1, 1, 1, -1); default: ApplyAnimation(playerid, "FINALE", "FIN_Land_Die", 4.0, 0, 1, 1, 1, -1); } if(GetPVarInt(playerid, "Admin") != 10) SetPVarInt(playerid, "DeathTime", GetCount()+60000); RemovePlayerAttachedObject(playerid, HOLDOBJECT_GUN2); return 1; } if(GetPVarInt(playerid, "Dead") == 3) { ResetPlayerWeaponsEx(playerid); SetPVarInt(playerid, "Mute", 1); TogglePlayerControllableEx(playerid,false); ResetPlayerWeaponsEx(playerid); SetPVarInt(playerid, "InvWeapon", 0); SetPVarInt(playerid, "InvAmmo", 0); RemovePlayerAttachedObject(playerid, HOLDOBJECT_GUN2); SetPlayerHealthEx(playerid,1.0); SetPlayerInterior(playerid,0); SetPlayerPos(playerid, 269.4417,1861.8927,8.7578); SetPlayerCameraPos(playerid, 275.2712,1859.6465,9.8133); SetPlayerCameraLookAt(playerid, 275.2712,1859.6465,16.6257, 0); if(playerid == 0) SetPlayerVirtualWorld(playerid,501); else SetPlayerVirtualWorld(playerid,playerid); SendClientMessage(playerid,COLOR_GREY,"Ai nevoie de catva timp sa iti recapeti puterea."); return 1; } if(GetPVarInt(playerid, "Dead") == 5) SetPVarInt(playerid, "Dead", 0); switch(GetPVarInt(playerid, "Cuffed")) { case 1: { ApplyAnimation(playerid, "PARACHUTE", "FALL_skyDive_DIE", 4.0, 0, 1, 1, 1, -1); TogglePlayerControllableEx(playerid,false); } case 2: { SetPlayerSpecialAction(playerid,SPECIAL_ACTION_CUFFED); SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH4, 19418, 5, 0.002000,0.037999,-0.004000,-12.600098,126.699996,-119.800048,1.000000,1.000000,1.000000); } } } return 1; }