../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)
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);
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]);
}
SetPlayerInterior(playerid,BuildingInts[h]);
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;
}
BuildingEnterPos[2]+0.75
For the first warning/error, this is your fault:
Код:
BuildingEnterPos[2]+0.75 Second: again two dimensions, use "BuildingInts[h][0]" or simply lose the second dimension and just use it like you did. |