22.12.2009, 17:52
Код:
C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(108) : error 032: array index out of bounds (variable "gTeamUSA") C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(115) : error 032: array index out of bounds (variable "gTeamUSA") C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(122) : error 032: array index out of bounds (variable "gTeamUSA") C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(129) : error 032: array index out of bounds (variable "gTeamEstonia") C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(136) : error 032: array index out of bounds (variable "gTeamEstonia") C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(143) : error 032: array index out of bounds (variable "gTeamEstonia") C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(150) : error 032: array index out of bounds (variable "gTeamGerman") C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(157) : error 032: array index out of bounds (variable "gTeamGerman") C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(164) : error 032: array index out of bounds (variable "gTeamGerman") C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(171) : error 032: array index out of bounds (variable "gTeamRussia") C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(178) : error 032: array index out of bounds (variable "gTeamRussia") C:\Program Files\San Andreas Multiplayer server\gamemodes\wow.pwn(185) : error 032: array index out of bounds (variable "gTeamRussia") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 12 Errors.
Код:
new rand = random(sizeof(gTeamUSA));
Код:
public OnPlayerSpawn(playerid) { switch(gClass[playerid]) { case 0: { // If the player's class is 0 then set it to Green SetPlayerColor(playerid, 0x009900ff); // Green new rand = random(sizeof(gTeamUSA)); SetPlayerPos(playerid, gTeamUSA[rand][1],gTeamUSA[rand][2],gTeamUSA[rand][3]); } case 1: { // If the player's class is 1 then set it to Green SetPlayerColor(playerid, 0x009900ff); // Green new rand = random(sizeof(gTeamUSA)); SetPlayerPos(playerid, gTeamUSA[rand][1],gTeamUSA[rand][2],gTeamUSA[rand][3]); } case 2: { // If the player's class is 2 then set it to Green SetPlayerColor(playerid, 0x009900ff); // Green new rand = random(sizeof(gTeamUSA)); SetPlayerPos(playerid, gTeamUSA[rand][1],gTeamUSA[rand][2],gTeamUSA[rand][3]); } case 3: { // If the player's class is 3 then set it to Blue SetPlayerColor(playerid, 0x000099ff); // Blue new rand = random(sizeof(gTeamEstonia)); SetPlayerPos(playerid, gTeamEstonia[rand][1],gTeamEstonia[rand][2],gTeamEstonia[rand][3]); } case 4: { // If the player's class is 4 then set it to Blue SetPlayerColor(playerid, 0x000099ff); // Blue new rand = random(sizeof(gTeamEstonia)); SetPlayerPos(playerid, gTeamEstonia[rand][1],gTeamEstonia[rand][2],gTeamEstonia[rand][3]); } case 5: { // If the player's class is 5 then set it to Blue SetPlayerColor(playerid, 0x000099ff); // Blue new rand = random(sizeof(gTeamEstonia)); SetPlayerPos(playerid, gTeamEstonia[rand][1],gTeamEstonia[rand][2],gTeamEstonia[rand][3]); } case 6: { // If the player's class is 6 then set it to Red SetPlayerColor(playerid, 0xcc0000ff); // Red new rand = random(sizeof(gTeamGerman)); SetPlayerPos(playerid, gTeamGerman[rand][1],gTeamGerman[rand][2],gTeamGerman[rand][3]); } case 7: { // If the player's class is 7 then set it to Red SetPlayerColor(playerid, 0xcc0000ff); // Red new rand = random(sizeof(gTeamGerman)); SetPlayerPos(playerid, gTeamGerman[rand][1],gTeamGerman[rand][2],gTeamGerman[rand][3]); } case 8: { // If the player's class is 8 then set it to Red SetPlayerColor(playerid, 0xcc0000ff); // Red new rand = random(sizeof(gTeamGerman)); SetPlayerPos(playerid, gTeamGerman[rand][1],gTeamGerman[rand][2],gTeamGerman[rand][3]); } case 9: { // If the player's class is 9 then set it to White SetPlayerColor(playerid, 0xffffffff); // White new rand = random(sizeof(gTeamRussia)); SetPlayerPos(playerid, gTeamRussia[rand][1],gTeamRussia[rand][2],gTeamRussia[rand][3]); } case 10: { // If the player's class is 9 then set it to White SetPlayerColor(playerid, 0xffffffff); // White new rand = random(sizeof(gTeamRussia)); SetPlayerPos(playerid, gTeamRussia[rand][1],gTeamRussia[rand][2],gTeamRussia[rand][3]); } case 11: { // If the player's class is 9 then set it to White SetPlayerColor(playerid, 0xffffffff); // White new rand = random(sizeof(gTeamRussia)); SetPlayerPos(playerid, gTeamRussia[rand][1],gTeamRussia[rand][2],gTeamRussia[rand][3]); } } SetPlayerInterior(playerid,0); // Interior 0 return 1; }