29.12.2014, 06:14
Hello, I've just found an error into my script, Can anybody help me to fix this one?
Here is the code :
Код:
C:\Documents and Settings\StuartzBarry-PC\Desktop\MetroRP\XXXX.pwn(5658) : error 032: array index out of bounds (variable "PlayerInfo")
Код:
stock GiveDodWeapon(playerid, weaponid, ammo)
{
GunsBeingRemoved[playerid] = 1;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
if(weaponid == 0 || weaponid == 1)
{ // Slot 0
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][0] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 2 || weaponid == 3 || weaponid == 4 || weaponid == 5 || weaponid == 6 || weaponid == 7 || weaponid == 8 || weaponid == 9)
{ // Slot 1
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][1] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 22 || weaponid == 23 || weaponid == 24)
{ // Slot 2
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][2] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 25 || weaponid == 26 || weaponid == 27)
{ // Slot 3
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][3] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 28 || weaponid == 29 || weaponid == 32)
{ // Slot 4
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][4] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 30 || weaponid == 31)
{ // Slot 5
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][5] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 33 || weaponid == 34)
{ // Slot 6
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][6] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 35 || weaponid == 36 || weaponid == 37 || weaponid == 38)
{ // Slot 7
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][7] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 16 || weaponid == 17 || weaponid == 18 || weaponid == 39)
{ // Slot 8
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][8] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 41 || weaponid == 42 || weaponid == 43)
{ // Slot 9
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][9] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 10 || weaponid == 11 || weaponid == 12 || weaponid == 13 || weaponid == 14 || weaponid == 15)
{ // Slot 10
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][10] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 44 || weaponid == 45 || weaponid == 46)
{ // Slot 11
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][11] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
else if(weaponid == 40)
{ // Slot 12
GunsBeingRemoved[playerid] = 1;
PlayerInfo[playerid][pGuns][12] = weaponid;
GunsBeingRemoved[playerid] = 1;
}
GivePlayerWeapon(playerid, weaponid, ammo);
return 1;
}


