Help with an array
#1

So I've got this array in which I want to save all of the possible spawn points arranged into sections based on what team they belong to:

PHP код:
new Float:SpawnPoints[4][][4] = {  
//[4] (the number of teams)
//[] (because not every teams has the same
//[4] (4 floats)
    
{  
        {
1.1,1.2,1.3,1.4//
    
},
    {  
        {
1.1,1.2,1.3,1.4}
    },
    {  
//Testing with this group!
        
{1568.7694, -1693.18195.8906178.7481}, 
         {
1527.3857, -1677.75245.8906271.1589},
         {
1571.9768, -1634.275413.55590.4598},
         {
257.804478.95851003.6406180.4818}
    },
    {   
        {
1.1,1.2,1.3,1.4}
    }, 
//This is line 99
}; 
These are intended to be used like this:

PHP код:
new random(4);
SetPlayerPos(playeridSpawnPoints[2][x][0], SpawnPoints[2][x][1], SpawnPoints[2][x][2]);
SetPlayerFacingAngle(playeridSpawnPoints[2][x][3]); 
But the problem is this:

PHP код:
C:\Users\Lucas\Desktop\Pawno\gamemodes\Project001.pwn(99) : error 018initialization data exceeds declared size 
Reply
#2

Код:
new Float:SpawnPoints[4][][4] = {   
//[4] (the number of teams) 
//[] (because not every teams has the same 
//[4] (4 floats) 

    {   
        {1.1,1.2,1.3,1.4} // 
    }, 
    {   
        {1.1,1.2,1.3,1.4} 
    }, 
    {  //Testing with this group! 
        {1568.7694, -1693.1819, 5.8906, 178.7481},  
         {1527.3857, -1677.7524, 5.8906, 271.1589}, 
         {1571.9768, -1634.2754, 13.5559, 0.4598}, 
         {257.8044, 78.9585, 1003.6406, 180.4818} 
    }, 
    {    
        {1.1,1.2,1.3,1.4} 
    }, //This is line 99 
};
Take a look on curly brackets.

Triple array? First time when i see it. Few tables in one table? First time when i see it as well.
Reply
#3

Do you mean the braces? What about them?
Reply
#4

pawn Код:
new Float:SpawnPoints[7][4] =
{
    {1.1,1.2,1.3,1.4},
    {1.1,1.2,1.3,1.4},

    //Testing with this group!
    {1568.7694, -1693.1819, 5.8906, 178.7481},
    {1527.3857, -1677.7524, 5.8906, 271.1589},
    {1571.9768, -1634.2754, 13.5559, 0.4598},
    {257.8044, 78.9585, 1003.6406, 180.4818},
   
    {1.1,1.2,1.3,1.4}
};
Reply
#5

The problem with that is it's not going to do what I need it to do.
Reply
#6

Quote:
Originally Posted by elcid7772
Посмотреть сообщение
The problem with that is it's not going to do what I need it to do.
Yes it can fix your problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)