C:\Users\User\Desktop\VL-Roleplay\GTA RP Script Linux\gamemodes\RolePlay.pwn(5941) : error 032: array index out of bounds (variable "CopSkins") C:\Users\User\Desktop\VL-Roleplay\GTA RP Script Linux\gamemodes\RolePlay.pwn(16274) : error 032: array index out of bounds (variable "CopSkins") C:\Users\User\Desktop\VL-Roleplay\GTA RP Script Linux\gamemodes\RolePlay.pwn(16279) : error 032: array index out of bounds (variable "CopSkins") C:\Users\User\Desktop\VL-Roleplay\GTA RP Script Linux\gamemodes\RolePlay.pwn(16283) : error 032: array index out of bounds (variable "CopSkins") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
new CopSkins[][] =
{
{280},{281},{265},{266},{267},{282},{283},{288},{284},{285}
};
SetPlayerSkin(playerid, CopSkins[0][1]);
if(Player[playerid][SelectingClothes] == 1)
{
if(Player[playerid][SelectingClothesType] == 1)
{
new ViewingSkin = 0;
if(clickedid == NSkin)
{
ViewingSkin++;
SetPlayerSkin(playerid, CopSkins[ViewingSkin][1]);
}
if(clickedid == PSkin)
{
ViewingSkin--;
SetPlayerSkin(playerid, CopSkins[ViewingSkin][1]);
}
if(clickedid == SSkin)
{
Player[playerid][DutyClothes] = CopSkins[ViewingSkin][1];
SetPlayerPos(playerid, Player[playerid][LastX], Player[playerid][LastY], Player[playerid][LastZ]);
SetPlayerFacingAngle(playerid, Player[playerid][LastA]);
SetPlayerInterior(playerid, Player[playerid][LastInt]);
SetPlayerVirtualWorld(playerid, Player[playerid][LastWorld]);
SetPlayerSkin(playerid, Player[playerid][LastSkin]);
Player[playerid][SelectingClothesType] = 0;
Player[playerid][SelectingClothes] = 0;
SCM(playerid, ADMINBLUE, "Duty Clothes changed!");
SavePlayerData(playerid);
}
if(clickedid == CSkin)
{
SetPlayerPos(playerid, Player[playerid][LastX], Player[playerid][LastY], Player[playerid][LastZ]);
SetPlayerFacingAngle(playerid, Player[playerid][LastA]);
SetPlayerInterior(playerid, Player[playerid][LastInt]);
SetPlayerVirtualWorld(playerid, Player[playerid][LastWorld]);
SetPlayerSkin(playerid, Player[playerid][LastSkin]);
Player[playerid][SelectingClothesType] = 0;
Player[playerid][SelectingClothes] = 0;
}
}
}
new const CopSkins[] = { 280, 281, 265, 266, 267, 282, 283, 288, 284, 285 };
SetPlayerSkin(playerid, CopSkins[ViewingSkin]);
I'm interested to know why some people (not just you) always create a two dimensional array where a single dimensional array would suffice. What exactly is wrong with this?
pawn Код:
pawn Код:
|