Dialog problem - Rep+
#1

Hello. I have got a problem with dialogs. I am making "pravila" or on English "rules" command with dialogs. I've got some errors,so take a look:

- OnDialogResponse:

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch( 
dialogid )
    {
        case 
DIALOG_REGISTER:
        {
            if (!
response) return Kick(playerid);
            if(
response)
            {
                if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD""COL_WHITE"Registracija",""COL_WHITE"Poљtovani,upisali ste nedozvoljivu lozinku.\n"COL_WHITE"Upiљite vasu lozinku kako biste se registrirali na server.\nVazno je znati da"COL_LIGHTBLUE" WG zajednica"COL_WHITE" nece nikad odat vasu lozinku.\nAko imate dodatnih problema kontaktirajte nas na webu!","Registracija","Izlaz");
                new 
INI:File INI_Open(UserPath(playerid));
                
INI_SetTag(File,"data");
                
INI_WriteInt(File,"Password",udb_hash(inputtext));
                
INI_WriteInt(File,"Score",0);
                
INI_WriteInt(File,"Novac",0);
                
INI_WriteInt(File,"Administrator",0);
                
INI_WriteInt(File,"Viplevel",0);
                
INI_WriteInt(File,"Banka",0);
                
INI_WriteInt(File,"Banovan",0);
                
INI_WriteInt(File,"Ubojstva",0);
                
INI_WriteInt(File,"Smrti",0);
                
INI_Close(File);
                
SpawnPlayer(playerid);
                
ShowPlayerDialog(playeridDIALOG_SUCCESS_1DIALOG_STYLE_MSGBOX,""COL_WHITE"Uspjesna registracija",""COL_WHITE"Poљtovani,uspjeљno ste registrirali novi account.\nZa vaљu sigurnost preporučavamo vam da odradite 'relog' kako bismo spremili podatke.\nUzivajte igrajuci na nasem serveru!","Uredu","");
            }
        }
        case 
DIALOG_LOGIN:
        {
            if ( !
response ) return Kick playerid );
            if( 
response )
            {
                if(
udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
                {
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                    
GivePlayerMoney(playeridPlayerInfo[playerid][pNovac]);
                    
SetPlayerScore(playeridPlayerInfo[playerid][pScore]);
                    
ShowPlayerDialog(playeridDIALOG_SUCCESS_2DIALOG_STYLE_MSGBOX,""COL_WHITE"Uspjesno logiranje",""COL_WHITE"Poљtovani,uspjeљno ste se ulogirali na vas account.\nNastavite sa igrom tamo gdje ste stali.\nUzivanje na nasem serveru zeli vam"COL_LIGHTBLUE" WG Administracija.\n\n"COL_WHITE"Ako imate dodatnih problema u vezi accounta kontaktirajte nas na webu!\n"COL_ORANGEwww.WilderGaming.net","Uredu","");
                }
                else
                {
                    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,""COL_WHITE"Logiranje",""COL_WHITE"Poљtovani,upisali ste pogreљnu lozinku.\n"COL_WHITE"Molimo vas da pazljivo unesete tocnu lozinku.\nImate"COL_LIGHTBLUE" 30 sekundi"COL_WHITE" da unesete lozinku uprotivnom ćete biti kikovani sa servera.","Login","Izlaz");
                }
                return 
1;
            }
         }
        
     }
}
{
    {
        if(
dialogid == DIALOG_PRAVILA//verify if our dialog id is = with dialog created and if exist
        
{
             if(
response// press the Accept button
              
{
                 
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Procitali ste osnovna RP pravila.");
            }
            return 
1;
        }
    }
    return 
0;

Defines:
PHP код:
#define DIALOG_PRAVILA 5 
Errors:

PHP код:
C:\Users\Dino Covic\Desktop\SAMP Server\pawno\include\a_samp.inc(72) : error 025: function heading differs from prototype
C
:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(657) : warning 209: function "S@@_OnDialogResponse" should return a value
C
:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(659) : error 055start of function body without function header
C
:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(661) : error 055start of function body without function header
C
:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(662) : error 010invalid function or declaration
C
:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(664) : error 010invalid function or declaration
C
:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(668) : error 010invalid function or declaration
C
:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(671) : error 010invalid function or declaration
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
7 Errors

Error Lines:

PHP код:
{
    {
        if(
dialogid == DIALOG_PRAVILA//verify if our dialog id is = with dialog created and if exist
        
{
             if(
response// press the Accept button
              
{
                 
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Procitali ste osnovna RP pravila.");
            }
            return 
1;
        }
    }
    return 
0;

Reply
#2

You closed the OnDialogResponse completely with brackets before the new code, therefore since it's not in any function, it returns errors.
Reply
#3

Код:
#define DIALOG_PRAVILA 54 // id is 54 change and..
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
DIALOG_REGISTER:
        {
            if (!
response) return Kick(playerid);
            if(
response)
            {
                if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD""COL_WHITE"Registracija",""COL_WHITE"Poљtovani,upisali ste nedozvoljivu lozinku.\n"COL_WHITE"Upiљite vasu lozinku kako biste se registrirali na server.\nVazno je znati da"COL_LIGHTBLUE" WG zajednica"COL_WHITE" nece nikad odat vasu lozinku.\nAko imate dodatnih problema kontaktirajte nas na webu!","Registracija","Izlaz");
                new 
INI:File INI_Open(UserPath(playerid));
                
INI_SetTag(File,"data");
                
INI_WriteInt(File,"Password",udb_hash(inputtext));
                
INI_WriteInt(File,"Score",0);
                
INI_WriteInt(File,"Novac",0);
                
INI_WriteInt(File,"Administrator",0);
                
INI_WriteInt(File,"Viplevel",0);
                
INI_WriteInt(File,"Banka",0);
                
INI_WriteInt(File,"Banovan",0);
                
INI_WriteInt(File,"Ubojstva",0);
                
INI_WriteInt(File,"Smrti",0);
                
INI_Close(File);
                
SpawnPlayer(playerid);
                
ShowPlayerDialog(playeridDIALOG_SUCCESS_1DIALOG_STYLE_MSGBOX,""COL_WHITE"Uspjesna registracija",""COL_WHITE"Poљtovani,uspjeљno ste registrirali novi account.\nZa vaљu sigurnost preporucavamo vam da odradite 'relog' kako bismo spremili podatke.\nUzivajte igrajuci na nasem serveru!","Uredu","");
            }
        }
        case 
DIALOG_LOGIN:
        {
            if(!
response) return Kick(playerid);
            if(
response)
            {
                if(
udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
                {
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                    
GivePlayerMoney(playeridPlayerInfo[playerid][pNovac]);
                    
SetPlayerScore(playeridPlayerInfo[playerid][pScore]);
                    
ShowPlayerDialog(playeridDIALOG_SUCCESS_2DIALOG_STYLE_MSGBOX,""COL_WHITE"Uspjesno logiranje",""COL_WHITE"Poљtovani,uspjeљno ste se ulogirali na vas account.\nNastavite sa igrom tamo gdje ste stali.\nUzivanje na nasem serveru zeli vam"COL_LIGHTBLUE" WG Administracija.\n\n"COL_WHITE"Ako imate dodatnih problema u vezi accounta kontaktirajte nas na webu!\n"COL_ORANGEwww.WilderGaming.net","Uredu","");
                }
                else
                {
                    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,""COL_WHITE"Logiranje",""COL_WHITE"Poљtovani,upisali ste pogreљnu lozinku.\n"COL_WHITE"Molimo vas da pazljivo unesete tocnu lozinku.\nImate"COL_LIGHTBLUE" 30 sekundi"COL_WHITE" da unesete lozinku uprotivnom cete biti kikovani sa servera.","Login","Izlaz");
                }
            }
        }
        case 
DIALOG_PRAVILA//verify if our dialog id is = with dialog created and if exist
        
{
            if(
response// press the Accept button
            
{
                 
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Procitali ste osnovna RP pravila.");
            }
        }
    }
    return 
true;

Reply
#4

"function heading differs from prototype"
Reply
#5

Show that line
Reply
#6

What version of SA-MP are your includes at?
Reply
#7

Line is empty - 72 line which is empty. I am using 0.3z
Reply
#8

The code that you pass has been compiled well.

Show code the line error.
Reply
#9

PHP код:
C:\Users\Dino Covic\Desktop\SAMP Server\pawno\include\a_samp.inc(72) : error 025: function heading differs from prototype 
Line: http://prntscr.com/6cyjo1
Reply
#10

Re-download the 0.3z includes perhaps.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)