19.03.2010, 22:59
I am creating a registration system using dialogs.
Under OnPlayerRequestClass:
OnDialogResponse
This doesn't create a file though. Thanks for the help.
Under OnPlayerRequestClass:
pawn Код:
if(!udb_Exists(PlayerName(playerid))) return ShowPlayerDialog(playerid, 0,1,"Registration","Please type your desired password below:","Register","Exit Game");
if(udb_Exists(PlayerName(playerid)) && !PlayerData[LoggedIn][playerid]) return ShowPlayerDialog(playerid, 1,1,"Login","Please type your password below:","Login","Exit Game");
pawn Код:
if(dialogid == 0) {
if(response) {
new tmp[256], idx;
tmp = strtok(inputtext, idx);
if(udb_Create(PlayerName(playerid),tmp)) {
dUserSetINT(PlayerName(playerid)).("placeholder",0);
ShowPlayerDialog(playerid,1,1,"Login","Please type your password below:","Login","Exit Game");
return 1;
}
}
else {
Kick(playerid);
}
}