Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted

Am o problema:

error 010: invalid function or declaration

La publicul:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new file[256];
    new name[MAX_PLAYER_NAME];
    new Registre[250];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    if(dialogid == RegisterName)
    {
        if(!response) Kick(playerid);
        {
        if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid,RegisterName,DIALOG_STYLE_INPUT,"Inregistrare","{FF0000}Parola invalida\n{FFA500}Te rog scrie o parola corecta!","Inregistrare","Iesire");
	    format(file,sizeof(file),"%s.cfg", name);
	    if(!fexist(file))
		{
			dini_Create(file);
			dini_IntSet(file, "Password", udb_hash(inputtext));
			dini_IntSet(file, "Money", 2500);
			dini_IntSet(file, "Score", 1);
			dini_IntSet(file, "BCR", 1000);
			dini_IntSet(file, "RobSkill", 1);
			dini_IntSet(file, "TerSkill", 1);
			dini_IntSet(file, "Admin", 0);
			dini_IntSet(file, "Warnings", 0);
			dini_IntSet(file, "WantedLevel", 0);
			dini_IntSet(file, "Jail", 0);
			dini_IntSet(file, "RentalOwner", 0);
			dini_IntSet(file, "Drugs", 0);
			dini_IntSet(file, "C4", 0);
			dini_IntSet(file, "Skin", -1);
			dini_IntSet(file, "Level", 0);
			dini_IntSet(file, "PremiumPoints", 0);
			dini_IntSet(file, "Exp", 0);
            format(Registre,sizeof(Registre),"{FFFF00}Multumim pentru inregistrare!\n{FFFF00}Acum trebuie sa te conectezi.",name);
            ShowPlayerDialog(playerid,LoginName,DIALOG_STYLE_INPUT,"Login",Registre,"Conectare","Iesire");
			GameTextForPlayer(playerid, "~r~Registered!", 3000, 1);
		}
		}
    }
    if(dialogid == LoginName)
    {
        if(!response) Kick(playerid);
        {
        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid,LoginName,DIALOG_STYLE_INPUT,"Login","parola invalida!\nTe rog scrie-ti parola","Conectare","Iesire");
	    format(file,sizeof(file),"%s.cfg", name);
	  	if(udb_hash(inputtext) != dini_Int(file, "Password")) return ShowPlayerDialog(playerid,LoginName,DIALOG_STYLE_INPUT,"Login","Parola gresita!\nTe rog scrie-ti parola","Conectare","Iesire");
		else
		{
    	IsPlayerLogged[playerid] = 1;
 	    SetPlayerMoney(playerid, dini_Int(file, "Money"));
		SetPlayerScore(playerid, dini_Int(file, "Score"));
		AccountInfo[playerid][aLevel] = dini_Int(file, "Admin");
		AccountInfo[playerid][Level] = dini_Int(file, "Level");
		AccountInfo[playerid][Exp] = dini_Int(file, "Exp");
		AccountInfo[playerid][Warnings] = dini_Int(file, "Warnings");
		AccountInfo[playerid][PremiumPoints] = dini_Int(file, "PremiumPoints");
		PlayerSkin[playerid] = dini_Int(file,"Skin");
		SetPlayerWantedLevel(playerid, dini_Int(file, "WantedLevel"));
		SendClientMessage(playerid, GREY, "Acum esti conectat.");
		GameTextForPlayer(playerid, "~r~Logged In!", 3000, 1);
		}
		}
    }
    if(dialogid == DIALOG_SHOP)
	{
	    if(response)
			{
			  	if(listitem == 0)
			   	{
					new string1[500],string2[500],string5[2400];
			        format(string1, sizeof(string1), "Jucatorii activi pot primii puncte premium.");
			        format(string2, sizeof(string2), "Cu care se poat cumpara Bani,Admin,level si multe altele.");
			        format(string5, sizeof(string5), "%s\n%s\n\n%s\n%s", string1, string2);
			        ShowPlayerDialog(playerid, DIALOG_SHOP2, DIALOG_STYLE_MSGBOX, "Info", string5, "Close", "");
				}
				if(listitem == 2)
				{
				    if(AccountInfo[playerid][aLevel] > 0)
				    {
				        SendClientMessage(playerid, ERROR, "Esti deja admin.");
				        return 1;
					}
					if(AccountInfo[playerid][PremiumPoints] <= 59)
					{
					    ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Nu ai destule puncte", "Ai nevoie de 500 de puncte pentru a cumpara admin.", "Close", "");
					    return 1;
					}
					AccountInfo[playerid][PremiumPoints] -= 500;
					AccountInfo[playerid][aLevel] = 1;
					new strings[200],namef[30];
					SendClientMessage(playerid, COLOR_YELLOW, "Ai cumparat admin 1!(-500 PP)");
					GetPlayerName(playerid, namef, sizeof(name));
					format(strings, sizeof(strings), "/shop: %s a cumparat admin 1.",namef);
					ABroadCast(COLOR_YELLOW,strings,6);
				}
				if(listitem == 6)
				{
				    if(AccountInfo[playerid][Warnings] <= 0)
                    {
						SendClientMessage(playerid, COLOR_RED, "Nu au nici-un warn.");
						return 1;
					}
					if(AccountInfo[playerid][PremiumPoints] <= 49)
                    {
						ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Nu ai destule puncte", "Ai nevoie de 50 de puncte pentru ati sterge warn-urile.", "Close", "");
						return 1;
					}
					AccountInfo[playerid][PremiumPoints] -= 50;
					AccountInfo[playerid][Warnings] = 0;
					new strings[200],namef[30];
					SendClientMessage(playerid, COLOR_YELLOW, "Ti-ai sters toate warn-urile! (-50 premium points)");
					GetPlayerName(playerid, namef, sizeof(name));
					format(strings, sizeof(strings), "/shop: %s si-a sters warningurile.",namef);
					ABroadCast(COLOR_YELLOW,strings,6);
					}
				if(AccountInfo[playerid][PremiumPoints] <= 49)
				{
						ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Nu ai destule puncte", "Ai nevoie de 50 de puncte pentru ati sterge warn-urile.", "Close", "");
						return 1;
				}
				if(listitem == 11)
				{
				    new strings[256];
				    if(AccountInfo[playerid][PremiumPoints] < 29) return SCM(playerid, COLOR_WHITE, "Nu ai suficiente puncte premium!");
				    AccountInfo[playerid][PremiumPoints] -= 30;
					GivePlayerMoney(playerid, 300000);
			        SCM(playerid, COLOR_YELLOW, "Ai cumparat $300.000 pentru 1 punct premium.");
			        format(strings, sizeof(strings), "/shop: %s a cumparat 300,000$.",name);
					ABroadCast(COLOR_YELLOW,strings,6);
				}
				if(listitem == 12)
				{
				    new strings[256];
				    if(AccountInfo[playerid][PremiumPoints] < 49) return SCM(playerid, COLOR_WHITE, "Nu ai suficiente puncte premium!");
				    AccountInfo[playerid][PremiumPoints] -= 50;
					GivePlayerMoney(playerid, 3000000);
			        SCM(playerid, COLOR_YELLOW, "Ai cumparat $3,000.000 pentru 10 puncte premium.");
			        format(strings, sizeof(strings), "/shop: %s a cumparat 300,000$.",name);
					ABroadCast(COLOR_YELLOW,strings,6);
				}
				if(listitem == 13)
				{
				    new strings[256];
				    if(AccountInfo[playerid][PremiumPoints] < 89) return SCM(playerid, COLOR_WHITE, "Nu ai suficiente puncte premium!");
				    AccountInfo[playerid][PremiumPoints] -= 90;
					GivePlayerMoney(playerid, 70000000);
			        SCM(playerid, COLOR_YELLOW, "Ai cumparat $70.000.000 pentru 70 puncte premium.");
			        format(strings, sizeof(strings), "/shop: %s a cumparat 70,000,000$.",name);
					ABroadCast(COLOR_YELLOW,strings,6);
     				}
        		}
			}
	return 1;
	}
	return 1;
}

La linia:

        		}
			}
	return 1;
	}
	return 1; /*<-- ASTA!\*
}

URGENT!

iar daca ma ajutati va dau +1

1 answer to this question

Recommended Posts

  • 0
Posted

Incearca asa:

 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new file[256];
    new name[MAX_PLAYER_NAME];
    new Registre[250];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    if(dialogid == RegisterName)
    {
        if(!response) Kick(playerid);
        {
        if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid,RegisterName,DIALOG_STYLE_INPUT,"Inregistrare","{FF0000}Parola invalida\n{FFA500}Te rog scrie o parola corecta!","Inregistrare","Iesire");
        format(file,sizeof(file),"%s.cfg", name);
        if(!fexist(file))
        {
            dini_Create(file);
            dini_IntSet(file, "Password", udb_hash(inputtext));
            dini_IntSet(file, "Money", 2500);
            dini_IntSet(file, "Score", 1);
            dini_IntSet(file, "BCR", 1000);
            dini_IntSet(file, "RobSkill", 1);
            dini_IntSet(file, "TerSkill", 1);
            dini_IntSet(file, "Admin", 0);
            dini_IntSet(file, "Warnings", 0);
            dini_IntSet(file, "WantedLevel", 0);
            dini_IntSet(file, "Jail", 0);
            dini_IntSet(file, "RentalOwner", 0);
            dini_IntSet(file, "Drugs", 0);
            dini_IntSet(file, "C4", 0);
            dini_IntSet(file, "Skin", -1);
            dini_IntSet(file, "Level", 0);
            dini_IntSet(file, "PremiumPoints", 0);
            dini_IntSet(file, "Exp", 0);
            format(Registre,sizeof(Registre),"{FFFF00}Multumim pentru inregistrare!\n{FFFF00}Acum trebuie sa te conectezi.",name);
            ShowPlayerDialog(playerid,LoginName,DIALOG_STYLE_INPUT,"Login",Registre,"Conectare","Iesire");
            GameTextForPlayer(playerid, "~r~Registered!", 3000, 1);
        }
        }
    }
    if(dialogid == LoginName)
    {
        if(!response) Kick(playerid);
        {
        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid,LoginName,DIALOG_STYLE_INPUT,"Login","parola invalida!\nTe rog scrie-ti parola","Conectare","Iesire");
        format(file,sizeof(file),"%s.cfg", name);
          if(udb_hash(inputtext) != dini_Int(file, "Password")) return ShowPlayerDialog(playerid,LoginName,DIALOG_STYLE_INPUT,"Login","Parola gresita!\nTe rog scrie-ti parola","Conectare","Iesire");
        else
        {
        IsPlayerLogged[playerid] = 1;
         SetPlayerMoney(playerid, dini_Int(file, "Money"));
        SetPlayerScore(playerid, dini_Int(file, "Score"));
        AccountInfo[playerid][aLevel] = dini_Int(file, "Admin");
        AccountInfo[playerid][Level] = dini_Int(file, "Level");
        AccountInfo[playerid][Exp] = dini_Int(file, "Exp");
        AccountInfo[playerid][Warnings] = dini_Int(file, "Warnings");
        AccountInfo[playerid][PremiumPoints] = dini_Int(file, "PremiumPoints");
        PlayerSkin[playerid] = dini_Int(file,"Skin");
        SetPlayerWantedLevel(playerid, dini_Int(file, "WantedLevel"));
        SendClientMessage(playerid, GREY, "Acum esti conectat.");
        GameTextForPlayer(playerid, "~r~Logged In!", 3000, 1);
        }
        }
    }
    if(dialogid == DIALOG_SHOP)
    {
        if(response)
            {
                  if(listitem == 0)
                   {
                    new string1[500],string2[500],string5[2400];
                    format(string1, sizeof(string1), "Jucatorii activi pot primii puncte premium.");
                    format(string2, sizeof(string2), "Cu care se poat cumpara Bani,Admin,level si multe altele.");
                    format(string5, sizeof(string5), "%s\n%s\n\n%s\n%s", string1, string2);
                    ShowPlayerDialog(playerid, DIALOG_SHOP2, DIALOG_STYLE_MSGBOX, "Info", string5, "Close", "");
                }
                if(listitem == 2)
                {
                    if(AccountInfo[playerid][aLevel] > 0)
                    {
                        SendClientMessage(playerid, ERROR, "Esti deja admin.");
                        return 1;
                    }
                    if(AccountInfo[playerid][PremiumPoints] <= 59)
                    {
                        ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Nu ai destule puncte", "Ai nevoie de 500 de puncte pentru a cumpara admin.", "Close", "");
                        return 1;
                    }
                    AccountInfo[playerid][PremiumPoints] -= 500;
                    AccountInfo[playerid][aLevel] = 1;
                    new strings[200],namef[30];
                    SendClientMessage(playerid, COLOR_YELLOW, "Ai cumparat admin 1!(-500 PP)");
                    GetPlayerName(playerid, namef, sizeof(name));
                    format(strings, sizeof(strings), "/shop: %s a cumparat admin 1.",namef);
                    ABroadCast(COLOR_YELLOW,strings,6);
                }
                if(listitem == 6)
                {
                    if(AccountInfo[playerid][Warnings] <= 0)
                    {
                        SendClientMessage(playerid, COLOR_RED, "Nu au nici-un warn.");
                        return 1;
                    }
                    if(AccountInfo[playerid][PremiumPoints] <= 49)
                    {
                        ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Nu ai destule puncte", "Ai nevoie de 50 de puncte pentru ati sterge warn-urile.", "Close", "");
                        return 1;
                    }
                    AccountInfo[playerid][PremiumPoints] -= 50;
                    AccountInfo[playerid][Warnings] = 0;
                    new strings[200],namef[30];
                    SendClientMessage(playerid, COLOR_YELLOW, "Ti-ai sters toate warn-urile! (-50 premium points)");
                    GetPlayerName(playerid, namef, sizeof(name));
                    format(strings, sizeof(strings), "/shop: %s si-a sters warningurile.",namef);
                    ABroadCast(COLOR_YELLOW,strings,6);
                    }
                if(AccountInfo[playerid][PremiumPoints] <= 49)
                {
                        ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Nu ai destule puncte", "Ai nevoie de 50 de puncte pentru ati sterge warn-urile.", "Close", "");
                        return 1;
                }
                if(listitem == 11)
                {
                    new strings[256];
                    if(AccountInfo[playerid][PremiumPoints] < 29) return SCM(playerid, COLOR_WHITE, "Nu ai suficiente puncte premium!");
                    AccountInfo[playerid][PremiumPoints] -= 30;
                    GivePlayerMoney(playerid, 300000);
                    SCM(playerid, COLOR_YELLOW, "Ai cumparat $300.000 pentru 1 punct premium.");
                    format(strings, sizeof(strings), "/shop: %s a cumparat 300,000$.",name);
                    ABroadCast(COLOR_YELLOW,strings,6);
                }
                if(listitem == 12)
                {
                    new strings[256];
                    if(AccountInfo[playerid][PremiumPoints] < 49) return SCM(playerid, COLOR_WHITE, "Nu ai suficiente puncte premium!");
                    AccountInfo[playerid][PremiumPoints] -= 50;
                    GivePlayerMoney(playerid, 3000000);
                    SCM(playerid, COLOR_YELLOW, "Ai cumparat $3,000.000 pentru 10 puncte premium.");
                    format(strings, sizeof(strings), "/shop: %s a cumparat 300,000$.",name);
                    ABroadCast(COLOR_YELLOW,strings,6);
                }
                if(listitem == 13)
                {
                    new strings[256];
                    if(AccountInfo[playerid][PremiumPoints] < 89) return SCM(playerid, COLOR_WHITE, "Nu ai suficiente puncte premium!");
                    AccountInfo[playerid][PremiumPoints] -= 90;
                    GivePlayerMoney(playerid, 70000000);
                    SCM(playerid, COLOR_YELLOW, "Ai cumparat $70.000.000 pentru 70 puncte premium.");
                    format(strings, sizeof(strings), "/shop: %s a cumparat 70,000,000$.",name);
                    ABroadCast(COLOR_YELLOW,strings,6);
                     
                }
            }
        }
            
    }
    return 1;
}

g4JGBJX.gif.31953391ab64171df562293ad37a0875.gif.9d26b39cd3270634d9cf89dcb43fba87.gif

 

 

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.