Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_REGISTER:
- {
- if(!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Regisztráció", "Adj meg egy jelszót:", "Rendben", "Mégsem");
- return 1;
- }
- new hash[129];
- WP_Hash(hash, sizeof(hash), inputtext);
- new INI:file = INI_Open(Path(playerid));
- INI_WriteString(file, "Password", hash);
- INI_WriteInt(file, "AdminLevel", 0);
- INI_WriteInt(file, "Money", 0);
- INI_WriteInt(file, "Score", 0);
- INI_WriteInt(file, "Muted", 0);
- INI_WriteInt(file, "Frozen", 0);
- INI_WriteInt(file, "Warnings", 0);
- INI_WriteInt(file, "Duty", 0);
- INI_WriteInt(file, "NoPM", 0);
- INI_WriteInt(file, "Kills", 0);
- INI_WriteInt(file, "Deaths", 0);
- INI_Close(file);
- RepeatedAttempts[playerid] = 0;
- return 1;
- }
- }
- case DIALOG_LOGIN:
- {
- if(!response) return Kick(playerid);
- if(response)
- {
- new hash[129];
- WP_Hash(hash, sizeof(hash), inputtext);
- if(!strcmp(hash, pInfo[playerid][pPass]))
- {
- INI_ParseFile(Path(playerid), "loadaccount_%s", .bExtra = true, .extra = playerid);
- SetPlayerScore(playerid, pInfo[playerid][pScore]);
- // GivePlayerMoney(playerid, pInfo[playerid][Penz]);
- pInfo[playerid][Penz] += pInfo[playerid][Penz];
- if(pInfo[playerid][pWarns] >= MAX_WARNS)
- {
- new string[100];
- format(string, sizeof(string), "[Server]: Kickelve lettél! Túl sok figyelmeztetés! Maximum: %d", MAX_WARNS);
- SCM(playerid, COLOR_RED, string);
- Kick(playerid);
- }
- }
- else
- {
- if(RepeatedAttempts[playerid] >= 3)
- {
- Kick(playerid);
- return 1;
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Bejelentkezés", "Írd be a jelszavad:", "Mehet", "Mégse");
- RepeatedAttempts[playerid]++;
- }
- }
- }
- }
- case DCLASS:
- {
- if(!response) return ShowPlayerDialog(playerid,DCLASS,DIALOG_STYLE_LIST,"{0080AA}Válassz kategóriát","Assault\nSniper\nSupporter","Kiválaszt","");
- if(response)
- {
- if(listitem == 0)
- {
- ResetPlayerWeapons(playerid);
- gClass[playerid] = ASSAULT;
- GivePlayerWeapon(playerid,24,150);
- GivePlayerWeapon(playerid,31,300);
- GivePlayerWeapon(playerid,29,200);
- SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Kiválasztott kategória, Assault.");
- pInfo[playerid][pRank] = 0;
- }
- if(listitem == 1)
- {
- ResetPlayerWeapons(playerid);
- gClass[playerid] = SNIPER;
- GivePlayerWeapon(playerid,24,150);
- GivePlayerWeapon(playerid,29,200);
- GivePlayerWeapon(playerid,34,200);
- SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Kiválasztott kategória, Sniper.");
- pInfo[playerid][pRank] = 1;
- }
- if(listitem == 2)
- {
- ResetPlayerWeapons(playerid);
- SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Kiválasztott kategória, Support.");
- GivePlayerWeapon(playerid,25,200);
- GivePlayerWeapon(playerid,29,200);
- GivePlayerWeapon(playerid,24,150);
- gClass[playerid] = SUPPORT;
- pInfo[playerid][pRank] = 2;
- }
- }
- }
- case DIALOG_VASARLAS:
- {
- if(!response) return 1;
- if(response)
- {
- if(listitem == 0)
- {
- SetPlayerArmour(playerid,100);
- SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Sikeres vásárlás! Páncélzat megvéve!");
- pInfo[playerid][Penz] -= 15000;
- }
- if(listitem == 1)
- {
- SetPlayerHealth(playerid,100);
- SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Sikeres vásárlás! Élet megvéve!");
- pInfo[playerid][Penz] -= 10000;
- }
- if(listitem == 2)
- {
- GivePlayerWeapon(playerid,16,3);
- SendClientMessage(playerid,COLOR_GREEN,"[INFO]: Sikeres vásárlás! Gránát megvéve!");
- pInfo[playerid][Penz] -= 30000;
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement