Strange problem
#1

pawn Код:
new Float:FunTP[][8] =
{
    {678.7383, 341.4823, 230.3493+2, 44.2607, 667.3849, 347.2433, 232.2656, 312.4264}
};

new Float:JumpTP[][8] =
{
    {2454.2620, 17.2514, 275.3959+2, 358.4811, 2441.7283, 8.2975, 282.3803, 358.4811}
};
Hey I get these 2 errors on the new.. lines

(147) : error 008: must be a constant expression; assumed zero
(157) : error 008: must be a constant expression; assumed zero

can anyone help with this?? THanks
Reply
#2

The code compiles fine for me... Are you sure these are actually the correct lines?
Reply
#3

Yeah they are :S, thats the reason I can't understand why it fails to compile.

EDIT: THe ones above compile fine..?

pawn Код:
new Float:GeneralTP[][8] =
{
    {1348.7295, 2999.0210, 1721.4387, 179.8686, 1334.9700,2990.3110,  1720.9999, 178.6952}
};

new GeneralTPNames[][] =
{
    "San Andreas"
};
Reply
#4

Can you post a bit more of the code maybe?
Reply
#5

Just did My usage is fine as I copyed the sage for the one I just pasted.

Heres some more... This is the usage in a switch statement

pawn Код:
case 2:
                {
                    if(IsPlayerInAnyVehicle(playerid))
                    {
                        SetVehiclePos(GetPlayerVehicleID(playerid), FunTP[listitem][4], FunTP[listitem][5], FunTP[listitem][6]);
                        SetVehicleZAngle(GetPlayerVehicleID(playerid), FunTP[listitem][7]);
                    }
                    else
                    {
                        SetPlayerPos(playerid, FunTP[listitem][0], FunTP[listitem][1], FunTP[listitem][2]);
                        SetPlayerFacingAngle(playerid, FunTP[listitem][3]);
                    }
                    format(string, sizeof(string), "%s has teleported to %s", GetPlayerNameEx(playerid), FunTPNames[listitem]);
                }
Reply
#6

Well to be honest with ya, I don't see anything wrong with the code D:
Reply
#7

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
Well to be honest with ya, I don't see anything wrong with the code D:
No problem I will experiment with things in the code.
Reply
#8

Sorry for the bump but I was sent to this thread, the problem is you cant do maths in an array. Remove +2 whereever you have placed it.
Reply
#9

Thanks , It worked!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)