21.07.2014, 15:42
Hello, I am having 2 errors in a script I have made and can not find a fix for them, This is not a dynamic system by the way it is just a way for me to add more non buyable buildings in easier.
the error messages are:
The line for the first error which is:
../gamemodes/maps.pwn(6) : error 032: array index out of bounds (variable "BuildingEnterPos") is
The full line of code for the first error is
the next error message is on this line.
Full code is.
the error messages are:
Код:
../gamemodes/maps.pwn(6) : error 032: array index out of bounds (variable "BuildingEnterPos") C:\Users\nathan\Dropbox\new 2r-rp\gamemodes\Main.pwn(1937) : error 035: argument type mismatch (argument 2)
../gamemodes/maps.pwn(6) : error 032: array index out of bounds (variable "BuildingEnterPos") is
pawn Код:
CreateDynamic3DTextLabel(string,0xFFFFFFFF,BuildingEnterPos[h][0], BuildingEnterPos[h][1], BuildingEnterPos[2]+0.75, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0, 0, -1, 100.0);
pawn Код:
new Float:BuildingEnterPos[1][3] = {
{648.456481,-1353.883666,13.547086}
};
for(new h = 0; h < sizeof(BuildingEnterPos); h++)
{
new string[256];
format(string, sizeof(string), "%s\nPress H to enter or\ntype /enter", BuildingNames[h]);
CreateDynamic3DTextLabel(string,0xFFFFFFFF,BuildingEnterPos[h][0], BuildingEnterPos[h][1], BuildingEnterPos[2]+0.75, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0, 0, -1, 100.0);
CreateDynamicPickup(1318, 1, BuildingEnterPos[h][0], BuildingEnterPos[h][1], BuildingEnterPos[h][2]);
}
pawn Код:
SetPlayerInterior(playerid,BuildingInts[h]);
pawn Код:
new BuildingNames[1][128] = {
{"San News HQ"}
};
new Float:BuildingEnterPos[1][3] = {
{648.456481,-1353.883666,13.547086}
};
new Float:BuildingIntPos[1][3] = {
{3887.393310,-900.421936,1180.593994}
};
new BuildingInts[1][] = {
{1}
};
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_CTRL_BACK)
{
for(new h = 0; h < sizeof(BuildingEnterPos); h++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0,BuildingEnterPos[h][0], BuildingEnterPos[h][1], BuildingEnterPos[h][2]))
{
TogglePlayerControllableEx(playerid,false);
SetPlayerPos(playerid,BuildingIntPos[h][0], BuildingIntPos[h][1], BuildingIntPos[h][2]);
SetPlayerInterior(playerid,BuildingInts[h]);
SetPlayerVirtualWorld(playerid,h);
SendClientMessage(playerid, COLOR_ORANGE, "You are now Frozen as we attempt to load the Objects around you.");
SendClientMessage(playerid, COLOR_ORANGE, "This Often takes 6 seconds on custom made Interiors, If you have issues contact an admin.");
// Start a 5 second timer to end the anti-spawnkill
SetTimerEx("LoadObjects", 6000, false, "i", playerid);
}
if(IsPlayerInRangeOfPoint(playerid, 3.0,BuildingIntPos[h][0], BuildingIntPos[h][1], BuildingIntPos[h][2]))
{
TogglePlayerControllableEx(playerid,true);
SetPlayerPos(playerid,BuildingEnterPos[h][0], BuildingEnterPos[h][1], BuildingEnterPos[h][2]);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
}
}
}
return 1;
}