Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
- new
- string[128],
- sendername[MAX_PLAYER_NAME];
- if(GetPVarInt(playerid, "dialog") != dialogid) { // Confirm the dialogid matches what we have in the PVar
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly trying to spoof a dialog ID (%d).", GetPlayerNameEx(playerid), playerid, dialogid);
- ABroadCast(COLOR_YELLOW, string, 2);
- format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID.", GetPlayerNameEx(playerid));
- AddAutomatedFlag(playerid, string);
- format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID (%d, %d).", GetPlayerNameEx(playerid), dialogid, response);
- Log("logs/crash.log", string);
- return 1;
- }
- DeletePVar(playerid, "dialog"); // Delete the PVar now we're done with it
- if(!isnull(inputtext))
- {
- if(strfind(inputtext, "%s", true) != -1)
- {
- format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly dialog-exploiting by attempting to send a null string.", GetPlayerNameEx(playerid), playerid);
- ABroadCast(COLOR_YELLOW, string, 2);
- format(string, sizeof(string), "%s is possibly dialog-exploiting by attempting to send a null string.", GetPlayerNameEx(playerid));
- AddAutomatedFlag(playerid, string);
- format(string, sizeof(string), "%s has attempted to insert a false string placeholder into a dialog.", GetPlayerNameEx(playerid));
- Log("logs/crash.log", string);
- Kick(playerid);
- return 1;
- }
- }
- if(dialogid == MAINMENU || dialogid == MAINMENU2)
- {
- if(dialogid == MAINMENU)
- {
- if(response == 0)
- {
- SendClientMessage(playerid, COLOR_NEWS, "You have been kicked out automatically.");
- //KillTimer(GetPVarInt(playerid, "MenuTimer"));
- Kick(playerid);
- }
- else
- {
- if(strlen(inputtext))
- {
- new passbuffer[129], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- WP_Hash(passbuffer, sizeof(passbuffer), inputtext);
- //SetTimerEx("MenuCamFix", 1000, false, "i", playerid);
- //KillTimer(GetPVarInt(playerid, "MenuTimer"));
- strcpy(AdminRelogPassword[playerid], passbuffer, 129);
- OnPlayerLogin(playerid, passbuffer);
- }
- else
- {
- new titlestring[64], dstring[512];
- format(titlestring, sizeof(titlestring), "{FFA500}Astensia Roleplay - Login");
- format(dstring, sizeof(dstring), "{FFFFFF}Wrong password.\n\n{FFFFFF}That username is registered, please enter your password below.\n\n{FFA500}Username: {FFFFFF}%s\n\n {FFA500}Password:", GetPlayerNameEx(playerid));
- ShowPlayerDialogEx(playerid,MAINMENU,DIALOG_STYLE_PASSWORD,titlestring,dstring,"Login","Quit");
- if(gPlayerLogTries[playerid] == 2) { SendClientMessage(playerid, COLOR_NEWS, "Wrong password, you have been kicked out automatically."); Kick(playerid); }
- }
- }
- }
- if(dialogid == MAINMENU2)
- {
- if(response == 0)
- {
- SendClientMessage(playerid, COLOR_NEWS, "You have been kicked out automatically.");
- //KillTimer(GetPVarInt(playerid, "MenuTimer"));
- Kick(playerid);
- }
- else if(strlen(inputtext))
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(doesAccountExist(sendername))
- {
- SendClientMessage(playerid, COLOR_YELLOW, "That username is already taken, please choose a different one.");
- return 1;
- }
- new passbuffer[129];
- WP_Hash(passbuffer, sizeof(passbuffer), inputtext);
- //SetTimerEx("MenuCamFix", 1000, false, "i", playerid);
- //KillTimer(GetPVarInt(playerid, "MenuTimer"));
- OnPlayerRegister(playerid,passbuffer);
- }
- }
- }
- else if(dialogid == REGISTRATION_MENU_ONE)
- {
- if(response)
- {
- PlayerInfo[playerid][pSex] = 1;
- }
- else
- {
- PlayerInfo[playerid][pSex] = 2;
- }
- ShowPlayerDialogEx(playerid, REGISTRATION_MENU_TWO, DIALOG_STYLE_INPUT, "{FFA500}Astensia Roleplay - Registration", "{FFFFFF}What do you want your character's age to be?\n\nNote: The age must be no lower than 18 and no higher than 90.", "Done", "");
- }
- else if(dialogid == REGISTRATION_MENU_TWO)
- {
- if(!IsNumeric(inputtext))
- {
- ShowPlayerDialogEx(playerid, REGISTRATION_MENU_TWO, DIALOG_STYLE_INPUT, "{FFA500}Astensia Roleplay - Registration", "{FFFFFF}ENTRY DECLINED: You must enter a number!\n\nWhat do you want your character's age to be?\n\nNote: The age must be no lower than 18 and no higher than 90.", "Done", "");
- return 1;
- }
- new age = strval(inputtext);
- if(age < 18 || age > 90)
- {
- ShowPlayerDialogEx(playerid, REGISTRATION_MENU_TWO, DIALOG_STYLE_INPUT, "{FFA500}Astensia Roleplay - Registration", "{FFFFFF}ENTRY DECLINED: The age can only be from 18 to 90!\n\nWhat do you want your character's age to be?\n\nNote: The age must be no lower than 18 and no higher than 90.", "Done", "");
- return 1;
- }
- PlayerInfo[playerid][pAge] = age;
- SetPlayerVirtualWorld(playerid, 0);
- ShowPlayerDialogEx(playerid, REGISTRATION_MENU_THREE, DIALOG_STYLE_MSGBOX, "{FFA500}Astensia Roleplay - Registration", "{FFFFFF}Have you been referred here by one of our players?", "Yes", "No");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement