Registration Issue - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Registration Issue (
/showthread.php?tid=135289)
Registration Issue -
zallomallo - 19.03.2010
I am creating a registration system using dialogs.
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");
OnDialogResponse
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);
}
}
This doesn't create a file though. Thanks for the help.