Jump to content
  • 0

Problema rezolvare Erroare 010:


anonim23

Question

Salut, sunt mai nou, la inceput.

Am incercat sa fac un system de voteleader si imi da errorile astea si nu prea stiu ce sa le fac, am incercat eu ceva dar degeaba. 

Errorile sunt : (53201) : error 010: invalid function or declaration

                       (53202) : error 010: invalid function or declaration

 

codul :   case DIALOG_ANSWER: {        //linia 53201
      if(!response) return 1;                              //linia 53202
    format(string, sizeof(string), "L-ai votat pe %s!", LeaderName[listitem]);
    SCM(playerid, COLOR_YELLOW, string);
    LeaderVotes[listitem] ++;
    SetPVarInt(playerid, "Voted", 1);
    }

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

salut, cum ai definit DIALOG_ANSWER?

trebuie definit ori cu

#define DIALOG_ANSWER 3 //unde 3 este numarul dialogului si nu trebuie sa fie la fel ca altele,

sau trebuie sa il fi declarat intr un enum

enum
{
    DIALOG_LOGIN,DIALOG_REGISTER,DIALOG_ANSWER
};

 

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
3 hours ago, Mister said:

salut, cum ai definit DIALOG_ANSWER?

trebuie definit ori cu

#define DIALOG_ANSWER 3 //unde 3 este numarul dialogului si nu trebuie sa fie la fel ca altele,

sau trebuie sa il fi declarat intr un enum

enum
{
    DIALOG_LOGIN,DIALOG_REGISTER,DIALOG_ANSWER
};

 

Salut,  #define DIALOG_ANSWER dar am vzt ca mai era un dialog cu acelasi nr, ii dau compile acum, i-am pus un nr unic, 998.

Edited by anonim23
Link to comment
Share on other sites

  • 0

da, mi am dat seama dupa ca acea eroare nu este legata de definirea variabilei...

Esti sigur ca nu ai uitat vreo paranteza  inainte sa adaugi dialogul acesta? inainte  de case DIALOG_ANSWER pe undeva

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
1 minute ago, Mister said:

da, mi am dat seama dupa ca acea eroare nu este legata de definirea variabilei...

Esti sigur ca nu ai uitat vreo paranteza  inainte sa adaugi dialogul acesta? inainte  de case DIALOG_ANSWER pe undeva

@Mister Nu cred, uite ce e dupa/inainte de asta.

 

CMD:answer(playerid, params[]) {
    if(AnswerNow == 0) return SCM(playerid, -1, "Nu este un sondaj inceput!");
    if(PlayerInfo[playerid][pAdmin] != 0 || PlayerInfo[playerid][pHelper] != 0) { }
    else if(PlayerInfo[playerid][pMember] != FactionAns) return SCM(playerid, -1, "Nu poti vota acum!");
    if(GetPVarInt(playerid, "Voted") == 1) return SCM(playerid, -1, "Ai votat deja!");
    new members[256];
    format(members, sizeof(members), "%s - %d voturi\n%s - %d voturi\n%s - %d voturi", LeaderName[0], LeaderVotes[0], LeaderName[1], LeaderVotes[1], LeaderName[2], LeaderVotes[2]);
    ShowPlayerDialog(playerid, DIALOG_ANSWER, DIALOG_STYLE_LIST, "Answer", members, "Ok", "Cancel");
    return 1;
}
 case DIALOG_ANSWER: {
 if(!response) return 1;
    format(string, sizeof(string), "L-ai votat pe %s!", LeaderName[listitem]);
    SCM(playerid, COLOR_YELLOW, string);
    LeaderVotes[listitem] ++;
    SetPVarInt(playerid, "Voted", 1);
    }

 

Dialog_answer  fiind la sfarsitul gm ului

Link to comment
Share on other sites

  • 0

codul de mai jos

case DIALOG_ANSWER: {
 if(!response) return 1;
    format(string, sizeof(string), "L-ai votat pe %s!", LeaderName[listitem]);
    SCM(playerid, COLOR_YELLOW, string);
    LeaderVotes[listitem] ++;
    SetPVarInt(playerid, "Voted", 1);
    }

 

 

Trebuie la public ondialogresponse, sa inteleg ca el este sub comanda answer?

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
5 minutes ago, Mister said:

codul de mai jos

case DIALOG_ANSWER: {
 if(!response) return 1;
    format(string, sizeof(string), "L-ai votat pe %s!", LeaderName[listitem]);
    SCM(playerid, COLOR_YELLOW, string);
    LeaderVotes[listitem] ++;
    SetPVarInt(playerid, "Voted", 1);
    }

 

 

Trebuie la public ondialogresponse, sa inteleg ca el este sub comanda answer?

@MisterImi poti spune mai exact unde trb? Asa e la mn.  (p.s sunt mai multe chestii in continuare,  cu if, case x, etc.)

 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new sendername[30];
    new string[300];
    if(strfind(inputtext, "%", true) != -1)
    {
        SendClientMessage(playerid, COLOR_GENANNOUNCE, "SERVER: Invalid dialog input. You can't use %%.");
        ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "Invalid dialog input", "Invalid dialog input", "OK", "Exit");
        return 1;
    }
    if(dialogid == 6267)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    PlayerInfo[playerid][pColor] = 0;
                    Update(playerid, pColorx);
                    SCM(playerid, COLOR_WHITE,"{CECECE}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
                }
                case 1:
                {
                    PlayerInfo[playerid][pColor] = 1;
                    Update(playerid, pColorx);
                    SCM(playerid, COLOR_WHITE,"{4169E1}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
                }
                case 2:
                {
                    PlayerInfo[playerid][pColor] = 2;
                    Update(playerid, pColorx);
                    SCM(playerid, COLOR_WHITE,"{662BBE}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
                }
                case 3:
                {
                    PlayerInfo[playerid][pColor] = 3;
                    Update(playerid, pColorx);
                    SCM(playerid, COLOR_WHITE,"{FFE600}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
                }
                case 4:
                {
                    PlayerInfo[playerid][pColor] = 4;
                    Update(playerid, pColorx);
                    SCM(playerid, COLOR_WHITE,"{FF00FF}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
                }
                case 5:
                {
                    PlayerInfo[playerid][pColor] = 5;
                    Update(playerid, pColorx);
                    SCM(playerid, COLOR_WHITE,"{3FFF3F}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
                }
                case 6:
                {
                    PlayerInfo[playerid][pColor] = 6;
                    Update(playerid, pColorx);
                    SCM(playerid, COLOR_WHITE,"{83D553}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
                }
                case 7:
                {
                    PlayerInfo[playerid][pColor] = 7;
                    Update(playerid, pColorx);
                    SCM(playerid, COLOR_WHITE,"{187700}Server:{FFFFFF} Nick color changed! Hope you like the new color!");
                }
                case 8:
                {
                    PlayerInfo[playerid][pColor] = 8;
                    Update(playerid, pColorx);

Edited by anonim23
Link to comment
Share on other sites

  • 0

unde ai acest rand:

 

  if(dialogid == 6267)
    {

 

vei adauga deaspura lui codul tau

if(dialogid  ==DIALOG_ANSWER) {
 if(!response) return 1;
    format(string, sizeof(string), "L-ai votat pe %s!", LeaderName[listitem]);
    SCM(playerid, COLOR_YELLOW, string);
    LeaderVotes[listitem] ++;
    SetPVarInt(playerid, "Voted", 1);
    }

 

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

@Mister este ok asa? public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new sendername[30];
    new string[300];
    if(strfind(inputtext, "%", true) != -1)
    {
        SendClientMessage(playerid, COLOR_GENANNOUNCE, "SERVER: Invalid dialog input. You can't use %%.");
        ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "Invalid dialog input", "Invalid dialog input", "OK", "Exit");
        return 1;
    }
    if(dialogid  ==DIA?LOG_ANSWER) {?
     if(!response) return 1;
    format(string, sizeof(string), "L-ai votat pe %s!", Lead?erName[listitem]);
    SCM(playerid, COLOR_YELLOW, string);
    LeaderVotes[listitem] ++;??
    SetPV?arI?nt(playerid, "Voted", 1);??????
    }?
    if(dialogid == 6267)
    {
        if(response)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.