Originally Posted by samp
This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds.
|
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == REGISTERBANK)
{
print("Registerdialog");
if(response)
{
print("Response");
if(strlen(inputtext))
{
print("Inputtext");
new file[100], name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), " ** You succesfully registered your bank account. Account name: %s, Password: %s", name, inputtext);
format(file, sizeof(file), Bankfile, name);
dini_Create(file);
dini_Set(file, "Bank owner", name);
dini_IntSet(file, "Password", num_hash(inputtext));
dini_IntSet(file, "Registered", 1);
dini_IntSet(file, "Cash amount", 0);
dini_IntSet(file, "Logged", 1);
SendClientMessage(playerid, SKY_BLUE, string);
}
else if(!strlen(inputtext))
{
SendClientMessage(playerid, SKY_BLUE, " ** You must fill in a password!");
ShowPlayerDialog(playerid, REGISTERBANK, DIALOG_STYLE_INPUT, "Welcome to your Local Bank! \nI see you don't got a bank account yet.", "Please enter a password, to register your bank account. \nPlease note: It cost's $1000 to register your bank account. \n\nPassword:", "Register", "Cancel");
}
}
else if(!response)
{
SendClientMessage(playerid, SKY_BLUE, " ** You did not register your bank account. Please step by next time.");
}
}
return 0; // Return 0 is for filterscripts right?
}
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
if(dialogid == REGISTERBANK)
{
print("Registerdialog");
if(response)
{
print("Response");
if(strlen(inputtext))
{
print("Inputtext");
new file[100], name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), " ** You succesfully registered your bank account. Account name: %s, Password: %s", name, inputtext);
format(file, sizeof(file), Bankfile, name);
dini_Create(file);
dini_Set(file, "Bank owner", name);
dini_IntSet(file, "Password", num_hash(inputtext));
dini_IntSet(file, "Registered", 1);
dini_IntSet(file, "Cash amount", 0);
dini_IntSet(file, "Logged", 1);
SendClientMessage(playerid, SKY_BLUE, string);
}
else
{
SendClientMessage(playerid, SKY_BLUE, " ** You must fill in a password!");
ShowPlayerDialog(playerid, REGISTERBANK, DIALOG_STYLE_INPUT, "Welcome to your Local Bank! \nI see you don't got a bank account yet.", "Please enter a password, to register your bank account. \nPlease note: It cost's $1000 to register your bank account. \n\nPassword:", "Register", "Cancel");
}
}
else
{
SendClientMessage(playerid, SKY_BLUE, " ** You did not register your bank account. Please step by next time.");
}
}
return 1;
}
return 1; // Return 0 is for filterscripts right?
}