4 Errors from Team
#1

Hello, I got error when I was creating my GM but I do not know how to fix

Errors:
pawn Код:
D:\BF4S\gamemodes\bf4s.pwn(14) : error 018: initialization data exceeds declared size
D:\BF4S\gamemodes\bf4s.pwn(22) : error 018: initialization data exceeds declared size
D:\BF4S\gamemodes\bf4s.pwn(83) : warning 202: number of arguments does not match definition
D:\BF4S\gamemodes\bf4s.pwn(86) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Code:
pawn Код:
//Line 14 and 22
new Float:USARandomSpawns[4][3] = {
    {207.0986,1929.8029,23.2422,180.4532},
    {213.5416,1858.0024,20.6406,3.1282},
    {141.1846,1875.6771,17.8434,268.0424},
    {207.0986,1929.8029,23.2422,180.4532}
};


new Float:RussiaRandomSpawns[4][3] = {
    {-242.9845,2711.9512,62.6875,177.2704},
    {-183.1272,2748.0396,62.6875,120.5566},
    {-255.1463,2603.4963,62.8582,272.5013},
    {-242.9845,2711.9512,62.6875,177.2704}
};

//Line 83 and 86

public OnPlayerRequestClass(playerid, classid)
{
    // So, we're gonna simply use a switch instead of if-else if structure

    switch(classid) // Switching between the classids
    {
         case 0/* The first classid is of the USA*/:
         {
              SetPlayerTeam(playerid, USA); // Setting players team
              GameTextForPlayer(playerid, "~b~United States (U.S.A)", 1000, 3); // Screen msg for player to show what team
          }

         case 1/* The second classid is of the Russia*/:
         {
              SetPlayerTeam(playerid, Russia); // Same as above
              GameTextForPlayer(playerid, "~g~Russian Federation, 1000", 3); // Same as above
          }
     }
     return 1;
}
I hope that anyone help me.
Regards,
ShadyX
Reply
#2

Show the exact lines of errors and warnings.
Reply
#3

Are you blind bro? I already posted it.
Reply
#4

No doubt you posted it but i said exact lines .
PHP код:
//Line 14 and 22
new Float:USARandomSpawns[4][3] = {
    {
207.0986,1929.8029,23.2422,180.4532},
    {
213.5416,1858.0024,20.6406,3.1282},
    {
141.1846,1875.6771,17.8434,268.0424},
    {
207.0986,1929.8029,23.2422,180.4532}
};
new 
Float:RussiaRandomSpawns[4][3] = {
    {-
242.9845,2711.9512,62.6875,177.2704},
    {-
183.1272,2748.0396,62.6875,120.5566},
    {-
255.1463,2603.4963,62.8582,272.5013},
    {-
242.9845,2711.9512,62.6875,177.2704}
}; 
You said from 14 to 22 but these lines are 14 . So we don't know which is the exact line.
Reply
#5

Because Includes and Defines, So They are those lines
Reply
#6

try this
[CODE]//Line 14 and 22
new Float:USARandomSpawns[][] =
{
{207.0986,1929.8029,23.2422,180.4532},
{213.5416,1858.0024,20.6406,3.1282},
{141.1846,1875.6771,17.8434,268.0424},
{207.0986,1929.8029,23.2422,180.4532}
};


new Float:RussiaRandomSpawns[][] =
{
{-242.9845,2711.9512,62.6875,177.2704},
{-183.1272,2748.0396,62.6875,120.5566},
{-255.1463,2603.4963,62.8582,272.5013},
{-242.9845,2711.9512,62.6875,177.2704}
};

//Line 83 and 86

public OnPlayerRequestClass(playerid, classid)
{
// So, we're gonna simply use a switch instead of if-else if structure

switch(classid) // Switching between the classids
{
case 0:/* The first classid is of the USA*/:
{
SetPlayerTeam(playerid, USA); // Setting players team
GameTextForPlayer(playerid, "~b~United States (U.S.A)", 1000, 3); // Screen msg for player to show what team
}

case 1:/* The second classid is of the Russia*/:
{
SetPlayerTeam(playerid, Russia); // Same as above
GameTextForPlayer(playerid, "~g~Russian Federation, 1000", 3); // Same as above
}
}
return 1;
}[CODE]
hope this work
Reply
#7

Are you noob? It's the same code, There no edits you did. :facepalm:
Reply
#8

you didn't add " : " after the case and the number
Reply
#9

Another errors
pawn Код:
D:\BF4S\gamemodes\bf4s.pwn(14) : error 018: initialization data exceeds declared size
D:\BF4S\gamemodes\bf4s.pwn(22) : error 018: initialization data exceeds declared size
D:\BF4S\gamemodes\bf4s.pwn(74) : error 029: invalid expression, assumed zero
D:\BF4S\gamemodes\bf4s.pwn(80) : error 010: invalid function or declaration
D:\BF4S\gamemodes\bf4s.pwn(86) : error 010: invalid function or declaration
From line 14 to 22:
pawn Код:
new Float:USARandomSpawns[4][3] = {
    {207.0986,1929.8029,23.2422,180.4532},
    {213.5416,1858.0024,20.6406,3.1282},
    {141.1846,1875.6771,17.8434,268.0424},
    {207.0986,1929.8029,23.2422,180.4532}
};


new Float:RussiaRandomSpawns[4][3] = {
    {-242.9845,2711.9512,62.6875,177.2704},
    {-183.1272,2748.0396,62.6875,120.5566},
    {-255.1463,2603.4963,62.8582,272.5013},
    {-242.9845,2711.9512,62.6875,177.2704}
};
From line 74 to 89
pawn Код:
case 0:/* The first classid is of the USA*/:
       {
        SetPlayerTeam(playerid, USA); // Setting players team
        GameTextForPlayer(playerid, "~b~United States (U.S.A)", 1000, 3); // Screen msg for player to show what team
       }

      case 1:/* The second classid is of the Russia*/:
        {
         SetPlayerTeam(playerid, Russia); // Same as above
         GameTextForPlayer(playerid, "~g~Russian Federation, 1000", 3); // Same as above
         }
     }
     return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}
Reply
#10

How have you defined USA and Russia?
and here you go with the coordinates -
pawn Код:
new Float:USARandomSpawns[4][4] = {
* * {207.0986,1929.8029,23.2422,180.4532},
* * {213.5416,1858.0024,20.6406,3.1282},
* * {141.1846,1875.6771,17.8434,268.0424},
* * {207.0986,1929.8029,23.2422,180.4532}
};


new Float:RussiaRandomSpawns[4][4] = {
* * {-242.9845,2711.9512,62.6875,177.2704},
* * {-183.1272,2748.0396,62.6875,120.5566},
* * {-255.1463,2603.4963,62.8582,272.5013},
* * {-242.9845,2711.9512,62.6875,177.2704}
};
Reply
#11

Yes, I defined them, let me try this code
-------------------------------------------------------
Doesn't work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)