Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_AGE)
- {
- if(!response)
- {
- Kick(playerid);
- }
- else
- {
- if(strlen(inputtext))
- {
- new age = strval(inputtext);
- if(age > 100 || age < 16)
- {
- ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "{8EB2D6}Veikėjo sukūrimas | {FFFFFF}2/2","Kiek jūsų veikėjui metų?\n\n\n\n{FF0000}(( nuo 16 iki 100 ))","Tęsti","");
- }
- else
- {
- PlayerInfo[playerid][pAge] = age;
- new
- string[ 64 ]
- ;
- format(string, sizeof(string), "{8EB2D6}Veikėjo informacija: {FFFFFF}jums {8EB2D6}%d {FFFFFF}.",age);
- SendClientMessage(playerid, -1, string);
- GivePlayerCash(playerid, 600);
- SaveAccountStats(playerid);
- SpawnPlayer(playerid);
- }
- }
- else
- {
- return 0;
- }
- }
- }
- if(dialogid == DIALOG_SEX)
- {
- if(response)
- {
- PlayerInfo[playerid][pSex] = 1;
- SendClientMessage(playerid, -1, "{8EB2D6}Veikėjo informacija: {FFFFFF}jūs esate {8EB2D6}vyras.");
- SetPlayerSkin(playerid, 60);
- PlayerInfo[playerid][pSkin] = 60;
- ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "{8EB2D6}Veikėjo sukūrimas | {FFFFFF}2/2","Kiek jūsų veikėjui metų?\n\n\n\n{FF0000}(( nuo 16 iki 100 ))","Tęsti","");
- }
- else
- {
- PlayerInfo[playerid][pSex] = 2;
- SendClientMessage(playerid, -1, "{8EB2D6}Veikėjo informacija: {FFFFFF}jūs esate {8EB2D6}moteris.");
- SetPlayerSkin(playerid, 233);
- PlayerInfo[playerid][pSkin] = 233;
- ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "{8EB2D6}Veikėjo sukūrimas | {FFFFFF}2/2","Kiek jūsų veikėjui metų?\n\n\n\n{FF0000}(( nuo 16 iki 100 ))","Tęsti","");
- }
- }
- switch( dialogid )
- {
- case DIALOG_REGISTER:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{FFFFFF}[Registracija] {8EB2D6}City Of Angels: RPG","Norint žaisti mūsų serveryje būtina užsiregistruoti.\n\n\n\nĮrašykite jūsų sugalvotą slaptažodį žėmiau:","Tęsti","Atšaukti");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File,"Cash",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Sex",0);
- INI_WriteInt(File,"Age",0);
- INI_WriteFloat(File,"Pos_x",0);
- INI_WriteFloat(File,"Pos_y",0);
- INI_WriteFloat(File,"Pos_z",0);
- INI_WriteInt(File,"Skin",0);
- INI_Close(File);
- ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, "{8EB2D6}Veikėjo sukūrimas | {FFFFFF}1/2","Pasirinkite jūsų veikėjo lytį.\n\n\n\nDėmėsio: pasirinkta lytis gali įtakoti jūsų tolimėsnį žaidimą.","Vyras","Moteris");
- }
- }
- case DIALOG_LOGIN:
- {
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- new
- tmp2[ 256 ],
- playername2[ MAX_PLAYER_NAME ]
- ;
- GetPlayerName(playerid, playername2, sizeof(playername2));
- format(tmp2, sizeof(tmp2), "~w~Sveikas~n~~g~%s", playername2);
- GameTextForPlayer(playerid, tmp2, 5000, 1);
- SetTimerEx("UnsetFirstSpawn", 5000, false, "i", playerid);
- GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
- SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{FFFFFF}[Prisijungimas] {8EB2D6}City Of Angels: RPG","{FFFFFF}Norint tęsti savo žaidimą mūsų serveryje būtina prisijungti.\n\n\n\nĮrašykite slaptažodį žėmiau:","Tęsti","Atšaukti");
- }
- return 1;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment