Dialog problem - Rep+ - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog problem - Rep+ (
/showthread.php?tid=566332)
Dialog problem - Rep+ -
NoDi522 - 05.03.2015
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(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, ""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(playerid, DIALOG_SUCCESS_1, DIALOG_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(playerid, PlayerInfo[playerid][pNovac]);
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_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_ORANGE" www.WilderGaming.net","Uredu","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_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 055: start of function body without function header
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(661) : error 055: start of function body without function header
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(662) : error 010: invalid function or declaration
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(664) : error 010: invalid function or declaration
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(668) : error 010: invalid function or declaration
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(671) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB 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;
}
Re: Dialog problem - Rep+ -
CalvinC - 05.03.2015
You closed the OnDialogResponse completely with brackets before the new code, therefore since it's not in any function, it returns errors.
Respuesta: Dialog problem - Rep+ -
JuanStone - 05.03.2015
Код:
#define DIALOG_PRAVILA 54 // id is 54 change and..
PHP код:
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, ""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(playerid, DIALOG_SUCCESS_1, DIALOG_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(playerid, PlayerInfo[playerid][pNovac]);
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_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_ORANGE" www.WilderGaming.net","Uredu","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_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;
}
Re: Dialog problem - Rep+ -
NoDi522 - 05.03.2015
"function heading differs from prototype"
Re: Dialog problem - Rep+ -
Wolfey20 - 05.03.2015
Show that line
Re: Dialog problem - Rep+ -
J0sh... - 05.03.2015
What version of SA-MP are your includes at?
Re: Dialog problem - Rep+ -
NoDi522 - 05.03.2015
Line is empty - 72 line which is empty. I am using 0.3z
Respuesta: Dialog problem - Rep+ -
JuanStone - 05.03.2015
The code that you pass has been compiled well.
Show code the line error.
Re: Dialog problem - Rep+ -
NoDi522 - 05.03.2015
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
Re: Dialog problem - Rep+ -
J0sh... - 05.03.2015
Re-download the 0.3z includes perhaps.