08.01.2012, 13:41
Quote:
(33074) : error 032: array index out of bounds (variable "plate") (33079) : error 032: array index out of bounds (variable "plate") (33084) : error 032: array index out of bounds (variable "plate") |
pawn Код:
command(lookupplate, playerid, params[])
{
if(gPlayerData[playerid][Faction] == 5)
{
new plate[128], string[256];
if(sscanf(params, "s", plate)) return SendClientMessage(playerid, GREY, "Server: /lookupplate [Plate]");
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(plate[128] == gPlayerData[i][NumPlate]) //line 33074
{
format(string, sizeof(string), "[%s] This vehicle belongs to %s.", plate, RemoveUnderScore(i));
SendClientMessage(playerid, WHITE, string);
}
else if(plate[128] == gPlayerData[i][NumPlate2]) //line 33079
{
format(string, sizeof(string), "[%s] This vehicle belongs to %s.", plate, RemoveUnderScore(i));
SendClientMessage(playerid, WHITE, string);
}
else if(plate[128] == gPlayerData[i][NumPlate3]) //line 33084
{
format(string, sizeof(string), "[%s] This vehicle belongs to %s.", plate, RemoveUnderScore(i));
SendClientMessage(playerid, WHITE, string);
}
else return SendClientMessage(playerid, WHITE, "This vehicle wasn't found in the vehicle database.");
}
}
}
else return SendClientMessage(playerid, GREY, "You are not in the correct Faction.");
return 1;
}