Pretraga

Pritisnite Enter za pretragu ili Escape za zatvaranje

[Pomoc]Only a singl statament

Započeo MEDO
pre 13 godina
403
pregleda
6
postova
PWN|Medis
Kingpin
pre 13 godina
Skripta koju koristim: DLRP
Detaljan opis problema: Posto sam imao problem sa dialogom poslova naravio sam da uzimaju posao komandaom /posao i izbrsiao sam dialog ali nesto ne radi izabujce ovaj error
C:\Documents and Settings\medis\Desktop\mds\0\gamemodes\0.pwn(1065) : error 002: only a single statement (or expression) can follow each "case"

Dio skripte:
Evo cijelih dialoga nema ih puno
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registracija",""COL_RED"Ukucali ste pogresan password.\n"COL_WHITE"Upisite password da registrujete vas racun.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Novac",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Zemlja",0);
                INI_WriteInt(File,"Godine",0);
                INI_WriteInt(File,"Posao",0);
                INI_Close(File);
               
                SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
}
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo)
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo);
                    SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Ukucali ste pogresan password\n"COL_WHITE"Ukoliko 3 puta pogresis dobijas BAN.","Login","Izlaz");
                }
                return 1;
            }
    }
    return 1;
}

error se desva u pred zadnioj lini ovo return 1; to jes u ovom zadnjem return 1;
Neke slike/video za lakse dobivanje pomoci(neobavezno):
KiLLa
Hustler
pre 13 godina
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registracija",""COL_RED"Ukucali ste pogresan password.\n"COL_WHITE"Upisite password da registrujete vas racun.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Novac",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Zemlja",0);
                INI_WriteInt(File,"Godine",0);
                INI_WriteInt(File,"Posao",0);
                INI_Close(File);
               
                SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
}
        }

        case DIALOG_LOGIN:
        {
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo)
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo);
                    SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Ukucali ste pogresan password\n"COL_WHITE"Ukoliko 3 puta pogresis dobijas BAN.","Login","Izlaz");
                }
                return 1;
            }
    }
    return 1;
}
PWN|Medis
Kingpin
pre 13 godina
isto je 😄 ne ide
PWN|Medis
Kingpin
pre 13 godina
Bumpppppppp oce li iko pomoci
Snooker
Shot Caller
pre 13 godina

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registracija",""COL_RED"Ukucali ste pogresan password.\n"COL_WHITE"Upisite password da registrujete vas racun.","Register","Quit");
            new INI:File = INI_Open(UserPath(playerid));
            INI_SetTag(File,"data");
            INI_WriteInt(File,"Password",udb_hash(inputtext));
            INI_WriteInt(File,"Novac",0);
            INI_WriteInt(File,"Admin",0);
            INI_WriteInt(File,"Zemlja",0);
            INI_WriteInt(File,"Godine",0);
            INI_WriteInt(File,"Posao",0);
            INI_Close(File);
            SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
            SpawnPlayer(playerid);
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if(udb_hash(inputtext) == PlayerInfo)
            {
                INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                GivePlayerMoney(playerid, PlayerInfo);
                SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
            }
            else
            {
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Ukucali ste pogresan password\n"COL_WHITE"Ukoliko 3 puta pogresis dobijas BAN.","Login","Izlaz");
            }
}
    }
    return 1;
}
PWN|Medis
Kingpin
pre 13 godina
hvala radi mozes mi reci sta si promjenio ili smaknuo

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava