23.07.2015, 15:47
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch( dialogid ) { case DIALOG_REGISTER: { if (!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"reg",""COL_WHITE"bad pass.\n"COL_WHITE"type pass to reg.","reg","exit"); 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,"Age",0); INI_WriteInt(File,"Sex",2); INI_WriteInt(File,"Skin",0); INI_WriteInt(File,"Location",0); INI_Close(File); ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT,"Age?","\nType age using numbers.","ok",""); } } case DIALOG_AGE: { if(!response) return Kick(playerid); if(response) { new age, message[64]; age = strval(inputtext); if(age < 13 || age > 70) { ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT,"Age?","Type age using numbers.","Ok",""); SendClientMessage(playerid, 0x33CCFFAA, "at least 13 years!"); } else { PlayerInfo[playerid][pAge] = age; SendClientMessage(playerid, 0x33CCFFAA, message); ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST,"male or female","male\nfemale","Ok",""); } } } case DIALOG_SEX: { if(response) { if(listitem == 0) { PlayerInfo[playerid][pSex] = 0; PlayerInfo[playerid][pSkin] = 20; printf("Skin has been set to 20"); ShowPlayerDialog(playerid, DIALOG_LOCATION, DIALOG_STYLE_LIST,"spawn","LS ","OK",""); } if(listitem == 1) { PlayerInfo[playerid][pSex] = 1; PlayerInfo[playerid][pSkin] = 12; printf("Skin has been set to 12"); ShowPlayerDialog(playerid, DIALOG_LOCATION, DIALOG_STYLE_LIST,"SPAWN","LOS SANTOS","OK",""); } } } case DIALOG_LOCATION: { if(!response) return Kick(playerid); if(response) { new message[64]; if(listitem == 0) { PlayerInfo[playerid][pLocation] = 0; format(message, sizeof(message), "MSG"); SendClientMessage(playerid, 0xFFFFFFFF, message); SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1713.6101,-1912.2190,13.5669,85.9081, 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); } if(listitem == 1) { PlayerInfo[playerid][pLocation] = 1; format(message, sizeof(message), "MSG"); SendClientMessage(playerid, 0xFFFFFFFF, message); SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1642.1584, -2334.1926, -2.6797, 359.7559, 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); } if(listitem == 2) { PlayerInfo[playerid][pLocation] = 2; format(message, sizeof(message), "MSG"); SendClientMessage(playerid, 0xFFFFFFFF, message); SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1642.1584, -2334.1926, -2.6797, 359.7559, 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); } } } 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); GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1642.1584, -2334.1926, -2.6797, 359.7559, 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); } else { Kick(playerid); } return 1; } } } return 1; }
so i add something on register text draw to stop that..and i add that but now every time i click on regist. and i go relog my account was deleted....
if(clickedid == reglog7)
{
if(fexist(UserPath(playerid))) return ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_MSGBOX, "error", "you are alredy regisred!", "ok", ""); // i put this
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"REG!","\nWLC TO OUR SERVER\n{FFFFFF}enjoy\n{FFFFFF}Forum {FFFFFF}www.comingsoon.com\nEnjoy!","Reg","exit");
TextDrawHideForPlayer(playerid, reglog0);
TextDrawHideForPlayer(playerid, reglog1);
TextDrawHideForPlayer(playerid, reglog2);
TextDrawHideForPlayer(playerid, reglog3);
TextDrawHideForPlayer(playerid, reglog4);
TextDrawHideForPlayer(playerid, reglog5);
TextDrawHideForPlayer(playerid, reglog6);
TextDrawHideForPlayer(playerid, reglog7);
}