Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == REGISTER_DIALOG)
- {
- if(!response) Kick(playerid);
- if(response)
- {
- if(strlen(inputtext) > PASS_MAX_LENGHT || strlen(inputtext) < PASS_MIN_LENGHT) return ShowRegisterDialog(playerid);
- new wp_hash[129];
- WP_Hash(wp_hash, sizeof(wp_hash), inputtext);
- new INI: file = INI_Open(GetPlayerFile(playerid) );
- INI_SetTag(file, "Player's File");
- INI_WriteString(file, "Name", GetName(playerid) );
- INI_WriteString(file, "Password", wp_hash);
- //ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST, "Esti baiat sau fata?", "Baiat \nFata", "Selecteaza" , "");
- ShowPlayerDialog(playerid, DIALOG_FULLNAME, DIALOG_STYLE_INPUT, "Nume", "Scrie numele complet", "Ok" , "");
- }
- }
- if(dialogid == DIALOG_FULLNAME) {
- new INI: file = INI_Open(GetPlayerFile(playerid) );
- INI_WriteInt(file, "FullName", strlen(inputtext));
- SendClientMessage(playerid,0xFFFFFFFF,"[{3399FF}NemeSys RPG{FFFFFF}]Bine,deci numele tau este %s.");
- ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST, "Esti baiat sau fata?", "Baiat \nFata", "Selecteaza" , "");
- }
- if(dialogid == DIALOG_SEX) {
- new INI: file = INI_Open(GetPlayerFile(playerid) );
- if(listitem == 0) {
- INI_WriteInt(file, "Sex", strlen("Baiat"));
- SendClientMessage(playerid,0xFFFFFFFF,"[{3399FF}NemeSys RPG{FFFFFF}]Bine,deci esti baiat.");
- ShowPlayerDialog(playerid, DIALOG_VARSTA, DIALOG_STYLE_INPUT, "Varsta", "Cati ani ai?", "Ok" , "");
- }
- if(listitem == 1) {
- INI_WriteInt(file, "Sex", strlen("Fata"));
- SendClientMessage(playerid,0xFFFFFFFF,"[{3399FF}NemeSys RPG{FFFFFF}]Bine,deci esti fata.");
- ShowPlayerDialog(playerid, DIALOG_VARSTA, DIALOG_STYLE_INPUT, "Varsta", "Cati ani ai?", "Ok" , "");
- }
- }
- if(dialogid == DIALOG_VARSTA) {
- new INI: file = INI_Open(GetPlayerFile(playerid) );
- INI_WriteInt(file, "Varsta", strval(inputtext));
- SendClientMessage(playerid,0xFFFFFFFF,"[{3399FF}NemeSys RPG{FFFFFF}]Bine,deci ai %d ani.");
- ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Alege locul unde vrei sa fii spawnat.", "Los Santos \nLas Venturas \nSan Fierro", "Selecteaza" , "");
- }
- if(dialogid == DIALOG_SPAWN) {
- new INI: file = INI_Open(GetPlayerFile(playerid) );
- if(listitem == 0)
- {
- SendClientMessage(playerid,COLOR_WHITE,"[{3399FF}HardCore-Gaming{FFFFFF}]Bine,deci vei fi spawnat in Los Santos");
- INI_WriteInt(file, "Spawn", 1);//LS
- INI_WriteInt(file, "Admin", 0);
- INI_WriteInt(file, "Vip", 0);
- INI_WriteInt(file, "Kills", 0);
- INI_WriteInt(file, "Deaths", 0);
- INI_WriteInt(file, "Hours", 0);
- INI_WriteInt(file, "Minute", 0);
- INI_WriteInt(file, "Second", 0);
- INI_WriteInt(file, "Warnings", 0);
- INI_WriteInt(file, "Jailed", 0);
- INI_WriteInt(file, "Banned", 0);
- INI_WriteInt(file, "BanTime", 0);
- INI_WriteInt(file, "Muted", 0);
- INI_WriteInt(file, "Cash", 0);
- INI_WriteInt(file, "Score", 0);
- #if SAVE_SKIN == true
- INI_WriteInt(file, "Skin", 0);
- #endif
- INI_Close(file);
- SendClientMessage(playerid, XSTADMIN_PRIMARYCOLOR, "[REGISTER] Your account was succesfull register in the database");
- ShowLoginDialog(playerid);
- }
- else if(listitem == 1)
- {
- SendClientMessage(playerid,COLOR_WHITE,"[{3399FF}HardCore-Gaming{FFFFFF}]Bine,deci vei fi spawnat in San Fierro");
- INI_WriteInt(file, "Spawn", 2);//SF
- INI_WriteInt(file, "Admin", 0);
- INI_WriteInt(file, "Vip", 0);
- INI_WriteInt(file, "Kills", 0);
- INI_WriteInt(file, "Deaths", 0);
- INI_WriteInt(file, "Hours", 0);
- INI_WriteInt(file, "Minute", 0);
- INI_WriteInt(file, "Second", 0);
- INI_WriteInt(file, "Warnings", 0);
- INI_WriteInt(file, "Jailed", 0);
- INI_WriteInt(file, "Banned", 0);
- INI_WriteInt(file, "BanTime", 0);
- INI_WriteInt(file, "Muted", 0);
- INI_WriteInt(file, "Cash", 0);
- INI_WriteInt(file, "Score", 0);
- #if SAVE_SKIN == true
- INI_WriteInt(file, "Skin", 0);
- #endif
- INI_Close(file);
- ShowLoginDialog(playerid);
- }
- else if(listitem == 2)
- {
- SendClientMessage(playerid,COLOR_WHITE,"[{3399FF}HardCore-Gaming{FFFFFF}]Bine,deci vei fi spawnat in Las Venturas");
- INI_WriteInt(file, "Spawn", 3);//LV
- INI_WriteInt(file, "Admin", 0);
- INI_WriteInt(file, "Vip", 0);
- INI_WriteInt(file, "Kills", 0);
- INI_WriteInt(file, "Deaths", 0);
- INI_WriteInt(file, "Hours", 0);
- INI_WriteInt(file, "Minute", 0);
- INI_WriteInt(file, "Second", 0);
- INI_WriteInt(file, "Warnings", 0);
- INI_WriteInt(file, "Jailed", 0);
- INI_WriteInt(file, "Banned", 0);
- INI_WriteInt(file, "BanTime", 0);
- INI_WriteInt(file, "Muted", 0);
- INI_WriteInt(file, "Cash", 0);
- INI_WriteInt(file, "Score", 0);
- #if SAVE_SKIN == true
- INI_WriteInt(file, "Skin", 0);
- #endif
- INI_Close(file);
- ShowLoginDialog(playerid);
- }
- }
- if(dialogid == LOGIN_DIALOG)
- {
- if(!response) Kick(playerid);
- if(response)
- {
- new wp_hash[129];
- WP_Hash(wp_hash, sizeof(wp_hash), inputtext);
- if(!strcmp(wp_hash, PlayerInfo[playerid][Password], false) )
- {
- INI_ParseFile(GetPlayerFile(playerid), "loadplayerdata", .bExtra = true, .extra = playerid);
- SpawnPlayer(playerid);
- SetPlayerScore(playerid, PlayerInfo[playerid][Score]);
- GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
- SendClientMessage(playerid, XSTADMIN_PRIMARYCOLOR, "[LOGIN] You sucessfull logged in.");
- #if SAVE_SKIN == true
- SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
- #endif
- if(PlayerInfo[playerid][Admin] > 0) {
- SendClientMessage(playerid, XSTADMIN_PRIMARYCOLOR, "[ADMIN] You logged in as Admin. type: /ah");
- }
- if(PlayerInfo[playerid][Vip] > 0) {
- SendClientMessage(playerid, XSTADMIN_PRIMARYCOLOR, "[VIP] You logged in as VIP . type: /vh");
- }
- }
- else
- {
- SendClientMessage(playerid, XSTADMIN_PRIMARYCOLOR, "[LOGIN] Password is incorrect");
- ShowLoginDialog(playerid);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement