Jump to content
  • 0

Problema rezolvare Erroare 010:


Question

Posted

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);
    }

12 answers to this question

Recommended Posts

  • 0
Posted

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
  • 0
Posted (edited)
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
  • 0
Posted

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
  • 0
Posted
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

  • 0
Posted

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
  • 0
Posted (edited)
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
  • 0
Posted

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
  • 0
Posted

@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)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.