05.03.2015, 10:49
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:
Defines:
Errors:
Error Lines:
- 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;
}
PHP код:
#define DIALOG_PRAVILA 5
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.
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;
}