Help me. Error in script: Compile
#1

Hey guys...

Today I was adding random spawns to my script, but I got an error. Heres the code:

Код:
new Float:RandomSpawns[23][4] =
{
    {1728.1360,-1633.1812,20.2155,0.6367},
    {2099.3120,-1806.7130,13.5547,89.6009},
    {2495.4861,-1686.1387,13.5143,356.8298},
    {1209.4156,-1747.2662,13.5936,35.9850},
    {997.5394,-919.7606,42.1797,91.7220},
    {1201.4775,-921.8998,43.0039,189.8411},
    {793.7746,-514.4272,16.8958,179.8100},
    {1022.8834,-1124.0189,23.8710,186.0921},
    {1072.4758,-1327.4943,13.5469,95.1711},
    {1178.9458,-1324.2008,14.1451,268.8001},
    {1365.3500,-1279.0601,13.5469,90.0000},
    {1653.1512,-1659.4375,22.5156,183.6145},
    {1930.7151,-1776.6263,13.5469,272.6766},
    {2070.7471,-1601.0851,13.5364,179.5734},
    {2146.6316,-1433.3799,25.5391,88.1066},
    {1999.9172,-1126.6880,25.5082,179.2473},
    {1573.7261,-1331.0933,16.4844,310.1884},
    {1518.4542,-1449.1108,13.5391,358.5282},
    {1017.8611,-1558.8264,14.8657,230.2355},
    {840.8857,-1625.8016,13.5469,26.4912},
    {515.2096,-1558.6857,16.4225,213.0308},
    {301.3730,-1621.6326,33.2764,238.7493},
    {1287.4647,-1156.2283,23.8281,357.6565},
};
And I got this error...

Код:
C:\Documents and Settings\Danny\My Documents\GTA SA Server\gamemodes\cnr.pwn(37) : error 018: initialization data exceeds declared size
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
And on OnPlayerSpawn I put this...

Код:
public OnPlayerSpawn(playerid)
{
    new Random = random(sizeof(RandomSpawns));
    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
    return 1;
}

Can you please help me, what do I do?
Reply
#2

Try this:

Код:
new Float:RandomSpawns[23][4] =
{
    {1728.1360,-1633.1812,20.2155,0.6367},
    {2099.3120,-1806.7130,13.5547,89.6009},
    {2495.4861,-1686.1387,13.5143,356.8298},
    {1209.4156,-1747.2662,13.5936,35.9850},
    {997.5394,-919.7606,42.1797,91.7220},
    {1201.4775,-921.8998,43.0039,189.8411},
    {793.7746,-514.4272,16.8958,179.8100},
    {1022.8834,-1124.0189,23.8710,186.0921},
    {1072.4758,-1327.4943,13.5469,95.1711},
    {1178.9458,-1324.2008,14.1451,268.8001},
    {1365.3500,-1279.0601,13.5469,90.0000},
    {1653.1512,-1659.4375,22.5156,183.6145},
    {1930.7151,-1776.6263,13.5469,272.6766},
    {2070.7471,-1601.0851,13.5364,179.5734},
    {2146.6316,-1433.3799,25.5391,88.1066},
    {1999.9172,-1126.6880,25.5082,179.2473},
    {1573.7261,-1331.0933,16.4844,310.1884},
    {1518.4542,-1449.1108,13.5391,358.5282},
    {1017.8611,-1558.8264,14.8657,230.2355},
    {840.8857,-1625.8016,13.5469,26.4912},
    {515.2096,-1558.6857,16.4225,213.0308},
    {301.3730,-1621.6326,33.2764,238.7493},
    {1287.4647,-1156.2283,23.8281,357.6565}
};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)