Jump to content
  • 0

Problema


Cbr.

Question

[pawn]C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(2447) : error 017: undefined symbol "Trivia"

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(4522) : warning 204: symbol is assigned a value that is never used: "gNewb"

Pawn compiler 3.2.3664          Copyright © 1997-2006, ITB CompuPhase

1 Error.[/pawn]

[pawn]public TriviaEvent()

{

    typet = random(MAX_QUESTIONS);

2447    SendClientMessageToAll ( -1, Trivia [ typet ] [ tIntrebare ] );

    endt =1;

    timertrivia = SetTimer("TriviaEnd", 360000, false);

    return 1;

}

public TriviaEnd()

{

    endt = 0;

    KillTimer(timertrivia);

    return 1;

}[/pawn]

Am vurt sa bag si eu trivia si imi da acea eroare, de ce ?

Link to comment
Share on other sites

23 answers to this question

Recommended Posts

[pawn]C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3520) : error 028: invalid subscript (not an array or too many subscripts): "Trivia"

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3520) : warning 215: expression has no effect

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3520) : error 001: expected token: ";", but found "]"

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3520) : error 029: invalid expression, assumed zero

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3520) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.[/pawn]

Link to comment
Share on other sites

[pawn]//=================================[trivia]=====================================

new typet = -1;

new endt = 0;

new timertrivia;

#define MAX_QUESTIONS (21)

enum Trivia_ENUM

{

tIntrebare [ 128 ],

tRaspuns [ 128 ]

}

//==============================================================================[/pawn]

[pawn]forward TriviaEvent();

forward TriviaEnd();[/pawn]

[pawn]public TriviaEvent()

{

typet = random(MAX_QUESTIONS);

SendClientMessageToAll ( -1, Trivia [ typet ] [ tIntrebare ] );

endt =1;

timertrivia = SetTimer("TriviaEnd", 360000, false);

return 1;

}

public TriviaEnd()

{

endt = 0;

KillTimer(timertrivia);

return 1;

}[/pawn]

[pawn]new Trivia [ 21 ] [ Trivia_ENUM ];[/pawn]

[pawn]//==============================================================================

    strcat ( Trivia [ 0 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF}Capitala Frantei? Pentru a raspunde foloseste {008040}/answer", 128 );

strcat ( Trivia [ 0 ] [ tRaspuns ], "Paris", 128 );

    strcat ( Trivia [ 1 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Care este sloganul Nokia? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 1 ] [ tRaspuns ], "Connecting People", 128 );

    strcat ( Trivia [ 2 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Moneda oficiala in Venezuela? Pentru a raspunde foloseste {008040}/answer ", 128 );

    strcat ( Trivia [ 2 ] [ tRaspuns ], "Bolivar", 128 );

    strcat ( Trivia [ 3 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Cum se numeste modul serverului? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 3 ] [ tRaspuns ], "Godfather", 128 );

    strcat ( Trivia [ 4 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF}Cine se afla pe bancnota de 1 de leu? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 4 ] [ tRaspuns ], "Nicolae Iorga", 128 );

    strcat ( Trivia [ 5 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF}Ce se sarbatoreste pe 25 Decembrie? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 5 ] [ tRaspuns ], "Craciunul", 128 );

//===========================================================================================

strcat ( Trivia [ 6 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Cel mai inalt varf din lume? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 6 ] [ tRaspuns ], "Everest", 128 );

    strcat ( Trivia [ 7 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Cat fac 7x8? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 7 ] [ tRaspuns ], "56", 128 );

    strcat ( Trivia [ 8 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Din ce munti izvoraste Dunarea? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 8 ] [ tRaspuns ], "Padurea Neagra", 128 );

    strcat ( Trivia [ 9 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Cum se numeste desenul pe piele? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 9 ] [ tRaspuns ], "tatuaj", 128 );

    strcat ( Trivia [ 10 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Orasul Londra se afla pe raul ? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 10 ] [ tRaspuns ], "Tamisa", 128 );

//==========================================================================================

strcat ( Trivia [ 11 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Cine se afla pe bancnota de 200 de lei? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 11 ] [ tRaspuns ], "Lucian Blaga", 128 );

    strcat ( Trivia [ 12 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Cati sateliti are Jupiter? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 12 ] [ tRaspuns ], "18", 128 );

    strcat ( Trivia [ 13 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Daca tastezi la 112 unde suni? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 13 ] [ tRaspuns ], "Pompieri", 128 );

    strcat ( Trivia [ 14 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Cum se numesc accesoriile pentru degete? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 14 ] [ tRaspuns ], "inele", 128 );

    strcat ( Trivia [ 15 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Floarea ochiului se numeste? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 15 ] [ tRaspuns ], "Iris", 128 );

//=============================================================================================

strcat ( Trivia [ 16 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Cum se numesc masinile gen Savanna / Broadway? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 16 ] [ tRaspuns ], "Lowrider", 128 );

    strcat ( Trivia [ 17 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Merge in somn? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 17 ] [ tRaspuns ], "Somnambul", 128 );

    strcat ( Trivia [ 18 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Ce inseamna NFS? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 18 ] [ tRaspuns ], "Need for Speed", 128 );

    strcat ( Trivia [ 19 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Tara lalelelor? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 19 ] [ tRaspuns ], "Olanda", 128 );

    strcat ( Trivia [ 20 ] [ tIntrebare ], "{008040}[TRIVIA]:{FFFFFF} Ruperea unui os se numeste? Pentru a raspunde foloseste {008040}/answer", 128 );

    strcat ( Trivia [ 20 ] [ tRaspuns ], "Fractura", 128 );

  typet = -1;

endt = 0;

SetTimer("TriviaEvent", 360000, true);[/pawn]

[pawn]if(strcmp(cmd, "/trivia", true) == 0)

    {

        if(IsPlayerConnected(playerid))

        {

            if(PlayerInfo[playerid][pAdmin] >= 1337)

            {

                TriviaEvent();

}

            else

{

SendClientMessage(playerid, COLOR_GRAD1, "{09F7DF}DENITED: {ffffff}Nu ai rangul administrativ necesar !");

}

        }

        return 1;

    }

    if(strcmp(cmd, "/answer", true) == 0)

{

  if(IsPlayerConnected(playerid))

    {

    if(PlayerInfo[playerid][pMuted] == 1)

      {

      SendClientMessage(playerid, TEAM_CYAN_COLOR, "  You can't speak, you have been silenced !");

        return 1;

      }

      if ( endt != 1 ) return SendClientMessage ( playerid, -1, "{008040}[TRIVIA]:{FFFFFF} Nu este niciun event trivia activ." );

      new length = strlen(cmdtext);

      while ((idx < length) && (cmdtext[idx] <= ' '))

      {

      idx++;

      }

      new offset = idx;

        new result[64];

        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))

        {

        result[idx - offset] = cmdtext[idx];

        idx++;

        }

      result[idx - offset] = EOS;

      if(!strlen(result))

      {

      SendClientMessage(playerid, COLOR_GRAD2, "UTILIZARE: /an [answer]");

        return 1;

        }

        if ( !strcmp ( result, Trivia [ typet ] [ tRaspuns ], true ) )

        {

        new strr[256];

    GetPlayerName(playerid,giveplayer,MAX_PLAYER_NAME);

    format(strr, sizeof(strr), "{008040}[TRIVIA]:{FFFFFF} %s a raspuns cel mai repede la intrebare si a castigat $5000.", giveplayer);

    SendClientMessageToAll(0x5EFB6EFF, strr);

    GivePlayerMoney(playerid, 5000);

    KillTimer(timertrivia);

    endt = 0;

        }

        else

          SendClientMessage(playerid, COLOR_GREY, "  Raspuns gresit !");

        }

        return 1;

}[/pawn]

Uite tot ce am bagat si:

[pawn]new Trivia;[/pawn]

Link to comment
Share on other sites

[pawn]C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3520) : error 028: invalid subscript (not an array or too many subscripts): "Trivia"

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3520) : warning 215: expression has no effect

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3520) : error 001: expected token: ";", but found "]"

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3520) : error 029: invalid expression, assumed zero

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3520) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.[/pawn]

[pawn]public TriviaEvent()

{

typet = random(MAX_QUESTIONS);

3520 SendClientMessageToAll ( -1, Trivia [ typet ] [ tIntrebare ] );

endt =1;

timertrivia = SetTimer("TriviaEnd", 360000, false);

return 1;

}

public TriviaEnd()

{

endt = 0;

KillTimer(timertrivia);

return 1;

}[/pawn]

Link to comment
Share on other sites

Pune asta in locul celuilalt:

public TriviaEvent()

{

        new Trivia [ 21 ] [ Trivia_ENUM ];

typet = random(MAX_QUESTIONS);

SendClientMessageToAll ( -1, Trivia [ typet ] [ tIntrebare ] );

endt =1;

timertrivia = SetTimer("TriviaEnd", 360000, false);

return 1;

}

Daca iti da eroare,posteaza eroarea.

Daca ti-am fost de ajutor +1 Respect!Multumesc

Link to comment
Share on other sites

[pawn]C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3502) : warning 219: local variable "Trivia" shadows a variable at a preceding level

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(16833) : error 021: symbol already defined: "Trivia"

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(18680) : error 028: invalid subscript (not an array or too many subscripts): "Trivia"

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(18680) : warning 215: expression has no effect

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(18680) : error 001: expected token: ";", but found "]"

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(18680) : error 029: invalid expression, assumed zero

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(18680) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

5 Errors.[/pawn]

Link to comment
Share on other sites

Scoate-l de acolo new trivia si incearca sa adaugi asa:

public TriviaEvent()

{

        new Trivia [ 21 ] [ Trivia_ENUM ];

  typet = random(MAX_QUESTIONS);

  format(string, sizeof(string), " %s ", Trivia [typet] [tIntrebare]);

  SendClientMessageToAll(COLOR_LIGHTRED, string);

  endt =1;

  timertrivia = SetTimer("TriviaEnd", 360000, false);

  return 1;

}

Daca ti-am fost de ajutor +1 Respect!Multumesc

Link to comment
Share on other sites

[pawn]C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3502) : warning 219: local variable "Trivia" shadows a variable at a preceding level

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3522) : error 017: undefined symbol "string"

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3522) : error 017: undefined symbol "string"

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3522) : error 029: invalid expression, assumed zero

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3522) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.[/pawn]

Link to comment
Share on other sites

[pawn]C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3502) : warning 219: local variable "Trivia" shadows a variable at a preceding level

C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(4526) : warning 204: symbol is assigned a value that is never used: "gNewb"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Header size:          11584 bytes

Code size:          2505180 bytes

Data size:          7327736 bytes

Stack/heap size:      16384 bytes; estimated max. usage=8171 cells (32684 bytes)

Total requirements: 9860884 bytes

2 Warnings.[/pawn]

Merge , dar am warning . Cum rezolv ?

Link to comment
Share on other sites

[pawn]C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3502) : warning 219: local variable "Trivia" shadows a variable at a preceding level

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Header size:          11584 bytes

Code size:          2505160 bytes

Data size:          7327732 bytes

Stack/heap size:      16384 bytes; estimated max. usage=8171 cells (32684 bytes)

Total requirements: 9860860 bytes

1 Warning.[/pawn]

Asta imi arata la 3502:

[pawn]stock SetVehicleModel(vehicleid, model)[/pawn]

Link to comment
Share on other sites

[pawn]C:\Documents and Settings\Madalin\Desktop\SAMP.EFL.RO\gamemodes\Godfather.pwn(3621) : warning 219: local variable "Trivia" shadows a variable at a preceding level

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Header size:          11608 bytes

Code size:          2511024 bytes

Data size:          7332160 bytes

Stack/heap size:      16384 bytes; estimated max. usage=8171 cells (32684 bytes)

Total requirements: 9871176 bytes

1 Warning.[/pawn]

[pawn]public TriviaEvent()

{

3621  new Trivia [ 21 ] [ Trivia_ENUM ];

  typet = random(MAX_QUESTIONS);

  new string[128];

  format(string, sizeof(string), " %s ", Trivia [typet] [tIntrebare]);

  SendClientMessageToAll(COLOR_LIGHTRED, string);

  endt =1;

  timertrivia = SetTimer("TriviaEnd", 360000, false);

  return 1;

}[/pawn]

Si nu merge pe server. Ce ii mai fac ?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.