Üdv!
Miért nem jeleníti meg a szabályzat dialogot?
/*••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
Regisztráció
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
#include <a_samp>
#include <dudb>
#include <dini>
#pragma unused strtok
#pragma unused ret_memcpy
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define SzAbAlYzAt 7
#define ReGiStEr 8
#define LoGiN 9
#define COLOR_GREEN 0x00FF00FF
#define COLOR_RED 0xFF0000FF
enum pInfo
{
Deaths,
Kills,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new IsLogged[MAX_PLAYERS];
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" tRegistration System by Torran\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#endif
public OnPlayerConnect(playerid)
{
IsLogged[playerid] = 0;
new file[128], string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),\"/tReg/%s.ini\",name);
if(!!fexist(file))
{
format(string, sizeof string, \"Üdv %s! Tiszteld az admint.\", name);
ShowPlayerDialog(playerid, SzAbAlYzAt, DIALOG_STYLE_LIST, \"Szabályzat:\", \"Tiszteld az admint\", \"Elfogad\", \"Elutsaít.\");
}
ShowPlayerDialog(playerid, SzAbAlYzAt, DIALOG_STYLE_LIST, \"Szabályzat:\", string, \"Elfogad\", \"Elutsaít.\");
if(!fexist(file))
{
format(string, sizeof string, \"Üdv %s! \\nTe még nem vagy regisztrálva! \\n\\nKérjük regisztrálj.\", name);
ShowPlayerDialog(playerid, ReGiStEr, DIALOG_STYLE_INPUT, \"Regisztráció\", string, \"Register\", \"Cancel.\");
}
if(fexist(file))
{
format(string, sizeof string, \"Üdv %s! \\nKérjük jelentkezz be! \\n\\nIrd be a jelszódat.\", name);
ShowPlayerDialog(playerid, LoGiN, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Login\", \"Cancel.\");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new file[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),\"/tReg/%s.ini\",name);
if(fexist(file))
{
dini_IntSet(file,\"Score\", GetPlayerScore(playerid));
dini_IntSet(file,\"Deaths\", PlayerInfo[playerid][Deaths]);
dini_IntSet(file,\"Kills\", PlayerInfo[playerid][Kills]);
}
IsLogged[playerid] = 0;
return 1;
}
public OnPlayerDeath(playerid, killerid)
{
PlayerInfo[playerid][Deaths] ++;
PlayerInfo[killerid][Kills] ++;
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == SzAbAlYzAt)
{
if(response)
{
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
SendClientMessage(playerid, COLOR_GREEN, \"--Elfogadtad a szabályzatot!--\");
SendClientMessage(playerid, COLOR_GREEN, \"--Jó játékot kívánnak az Adminok!--\");
ShowPlayerDialog(playerid, ReGiStEr, DIALOG_STYLE_INPUT, \"Regisztráció\", string, \"Register\", \"Cancel.\");
}
else
{
Kick(playerid);
}
}
if(dialogid == ReGiStEr)
{
if(response)
{
new file[128];
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(strlen(inputtext) == 0)
{
format(string, sizeof string, \"Regisztráció \\n\\nÜdv %s! \\nTe még nem vagy regisztrálva! \\n\\nKérjük regisztrálj.\", name);
ShowPlayerDialog(playerid, ReGiStEr, DIALOG_STYLE_INPUT, \"Regisztráció\", string, \"Register\", \"Cancel.\");
return 0;
}
format(file,sizeof(file),\"/tReg/%s.ini\",name);
if(!fexist(file))
{
dini_Create(file);
dini_IntSet(file,\"Password\", udb_hash(inputtext));
dini_IntSet(file,\"Score\", GetPlayerScore(playerid));
dini_IntSet(file,\"Deaths\", PlayerInfo[playerid][Deaths]);
dini_IntSet(file,\"Kills\", PlayerInfo[playerid][Kills]);
format(string, sizeof string, \"Bejelentkezés \\n\\nÜdv %s! \\nTe regisztrálva vagy! \\n\\nKérjük jelentkezz be.\", name);
ShowPlayerDialog(playerid, LoGiN, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Login\", \"Cancel.\");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
GetPlayerName(playerid, name, sizeof(name));
printf(\"%s sikeresen regisztrált!\", name);
}
}
}
if(dialogid == LoGiN)
{
if(response)
{
new file[128];
new string[128];
new PlayerName[24];
if(strlen(inputtext) == 0)
{
GetPlayerName(playerid, PlayerName, sizeof PlayerName);
format(string, sizeof string, \"Bejelentkezés \\n\\nÜdv %s! \\nTe regisztrálva vagy! \\n\\nKérjük jelentkezz be.\", PlayerName);
ShowPlayerDialog(playerid, LoGiN, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Login\", \"Cancel.\");
return 0;
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),\"/tReg/%s.ini\",name);
if(fexist(file))
{
new password = dini_Int(file, \"Password\");
if(udb_hash(inputtext) != password)
{
SendClientMessage(playerid, COLOR_RED, \"***Hiba:Nem jó jelszó!\");
Kick(playerid);
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
printf(\"%s Nem tudott bejelentkezni!\", name);
}
else
{
IsLogged[playerid] = 1;
ResetPlayerMoney(playerid);
SetPlayerScore(playerid, dini_Int(file,\"Score\"));
PlayerInfo[playerid][Deaths] = dini_Int(file,\"Deaths\");
PlayerInfo[playerid][Kills] = dini_Int(file,\"Kills\");
SendClientMessage(playerid, COLOR_GREEN, \"***Sikeresen be jelentkeztél!\");
TogglePlayerSpectating(playerid, 0);
}
}
}
}
return 0;
}