Oko pawna

Započeo Pipajer
23. Apr. 2022. Zaključano
409
pregleda
4
postova
Pipajer
2
Rookie
23. Apr. 2022.
kada stisnem da se compilea izbaci mi error 002 " Only a single statement (or expression) can follow each case"
evo vam skripta pa recite sta je u redu a sta nije

link: https://pastebin.com/x5uc71jR
Skrilew
6
Godfather
23. Apr. 2022.
OnDialogResponse pocinje velikim slovom, takodje odredjene stvari nisi otvorio, odredjene nisi zatvorio. Nauci osnove i pogledaj kako se pise kod, topla preporuka da pogledas malo osnove C programskog jezika zbog iste sintakse.

Sredjen kod :
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{ //Otvaramo callback
switch(dialogid)
{ //Otvaramo switch
    case DIALOG_REGISTER:
    { //Otvaramo prvi case
    if(!response) return Kick(playerid);
    if(response)
    { //Otvaramo response
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Unesite vasu lozinku:", "Registruj se", "Odustani");
        new INI:File = INI_Open(UserPath(playerid));
        INI_SetTag(File, "data");
        INI_WriteInt(File, "Lozinka", udb_hash(inputtext));
        INI_WriteInt(File, "Novac", 25000);
        INI_WriteInt(File, "Level", 2);
        INI_WriteInt(File, "Respekti", 0);
        INI_WriteInt(File, "Admin", 0);
        INI_WriteInt(File, "NeededRep", 8);
        INI_WriteInt(File, "Droga", 0);
        INI_Close(File);
        SpawnPlayer(playerid);
        GivePlayerMoney(playerid, 25000);
        SetCameraBehindPlayer(playerid);
        PlayerInfo = 2;
    } //Zatvaramo response
    } //Zatvaramo case
    case DIALOG_LOGIN:
    { //Otvaramo case
        if(!response) return Kick(playerid);
    if(response)
    { //Otvaramo response
        if(udb_hash(inputtext) == PlayerInfo)
        {
            INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra=true, .extra=playerid);
            GivePlayerMoney(playerid, PlayerInfo);
        }
        else
        {
            ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Unesite vasu lozinku:", "Prijavi se", "Odustani");
        }

      } //Zatvaramo response
      } //Zatvaramo case
} //Zatvaramo switch
return 1;
} //Zatvaramo OnDialogResponse
Lakering
4
Made Man
23. Apr. 2022.
V01D wrote on April 23, 2022, 7:31 am:
OnDialogResponse pocinje velikim slovom, takodje odredjene stvari nisi otvorio, odredjene nisi zatvorio. Nauci osnove i pogledaj kako se pise kod, topla preporuka da pogledas malo osnove C programskog jezika zbog iste sintakse.

Sredjen kod :
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{ //Otvaramo callback
switch(dialogid)
{ //Otvaramo switch
    case DIALOG_REGISTER:
    { //Otvaramo prvi case
    if(!response) return Kick(playerid);
    if(response)
    { //Otvaramo response
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Unesite vasu lozinku:", "Registruj se", "Odustani");
        new INI:File = INI_Open(UserPath(playerid));
        INI_SetTag(File, "data");
        INI_WriteInt(File, "Lozinka", udb_hash(inputtext));
        INI_WriteInt(File, "Novac", 25000);
        INI_WriteInt(File, "Level", 2);
        INI_WriteInt(File, "Respekti", 0);
        INI_WriteInt(File, "Admin", 0);
        INI_WriteInt(File, "NeededRep", 8);
        INI_WriteInt(File, "Droga", 0);
        INI_Close(File);
        SpawnPlayer(playerid);
        GivePlayerMoney(playerid, 25000);
        SetCameraBehindPlayer(playerid);
        PlayerInfo = 2;
    } //Zatvaramo response
    } //Zatvaramo case
    case DIALOG_LOGIN:
    { //Otvaramo case
        if(!response) return Kick(playerid);
    if(response)
    { //Otvaramo response
        if(udb_hash(inputtext) == PlayerInfo)
        {
            INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra=true, .extra=playerid);
            GivePlayerMoney(playerid, PlayerInfo);
        }
        else
        {
            ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Unesite vasu lozinku:", "Prijavi se", "Odustani");
        }

      } //Zatvaramo response
      } //Zatvaramo case
} //Zatvaramo switch
return 1;
} //Zatvaramo OnDialogResponse
if(!response) return Kick(playerid);
    if(response)

xD
ElkaIsBack
3
Hustler
26. Apr. 2022.
Pipajer wrote on April 23, 2022, 6:53 am:
kada stisnem da se compilea izbaci mi error 002 " Only a single statement (or expression) can follow each case"
evo vam skripta pa recite sta je u redu a sta nije

link: https://pastebin.com/x5uc71jR
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_PASSWORD, "Register", "Unesite vasu lozinku:", "Registruj se", "Odustani");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File, "data");
INI_WriteInt(File, "Lozinka", udb_hash(inputtext));
INI_WriteInt(File, "Novac", 25000);
INI_WriteInt(File, "Level", 2);
INI_WriteInt(File, "Respekti", 0);
INI_WriteInt(File, "Admin", 0);
INI_WriteInt(File, "NeededRep", 8);
INI_WriteInt(File, "Droga", 0);
INI_Close(File);
SpawnPlayer(playerid);
GivePlayerMoney(playerid, 25000);
SetCameraBehindPlayer(playerid);
PlayerInfo = 2;
}
}
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);
}
else {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Unesite vasu lozinku:", "Prijavi se", "Odustani");
}        
}
}
return 1;
}

Evo ti sredjena komanda, par viticasti zagrada nisi zatvorio. Probaj sad pa javi radil

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha