mám registraciu cez y_ini a ulozi sa mi čo som nahral na servery a ked sa pozrem do SF tak všetko mam na 0
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"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
Dotaz
Macko 2
Dobrý Večer,
mám registraciu cez y_ini a ulozi sa mi čo som nahral na servery a ked sa pozrem do SF tak všetko mam na 0
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"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
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,"Score",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Dny",0);
INI_WriteInt(File,"Minut",0);
INI_WriteInt(File,"Hodin",0);
INI_WriteInt(File,"Sekund",0);
INI_WriteInt(File,"Obcanka",0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1685.8154,-2333.9470,-2.6797,1.1942,46, 1, 16, 1, 24, 7);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
}
}
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]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
new string[256];
format(string,256,"[ Nahrané Dny: %d || Hodiny: %d || Minuty: %d || Sekundy: %d]",PlayerInfo[playerid][pDny],PlayerInfo[playerid][pHodiny],PlayerInfo[playerid][pMinuty],PlayerInfo[playerid][pSekundy]);
SendClientMessage(playerid, COLOR_RED, string);
return 1;
}
}
}
return 1;
}
Link to comment
Share on other sites
5 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now