17.04.2015, 19:30
Hi everyone how to make that it wont show spawn(for request class) until he wont login/register when he connects??
Код:
public OnPlayerConnect(playerid) { bla bla bla return 1; } public OnPlayerRequestClass(playerid, classid) { SetupPlayerForClassSelection(playerid); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == DIALOG_REGISTER) { gPlayerLogged[playerid] = 1; //bla bla bla } if (dialogid == DIALOG_LOGIN) { //bla bla bla new tmp; tmp = dini_Int(file, "Password"); if(udb_hash(inputtext) != tmp) { //bla bla bla } else { gPlayerLogged[playerid] = 1; //bla bla bla if(!response) return Kick(playerid); } } return 1; } function SetupPlayerForClassSelection(playerid) { new name[MAX_PLAYER_NAME], file[126]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), PLAYERS, name); if(fexist(file)) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "{FF8040}Login!", "{FF0000}Welcome back!\n {44FF00}Please login.", "Login", "Leave"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "{FF8040}Register", "{FF0000}Welcome!\n You are new here!\n {44FF00}Please register", "Register", "Leave"); } }