27.04.2011, 16:09
(
Последний раз редактировалось Ћilvėnas; 28.04.2011 в 05:42.
)
This vat is so љūds.
Hook up your server on the server host.I go, and writes password to registration.I inpu password: writes you a registered.Ant me respawning.I go then again, nothing does not save [Money / XP]
And on the local host everything ok: D
Things trouble?
My register code's:
OnPlayerConnect:
OnDialogResponse:
Please HELP
Hook up your server on the server host.I go, and writes password to registration.I inpu password: writes you a registered.Ant me respawning.I go then again, nothing does not save [Money / XP]
And on the local host everything ok: D
Things trouble?
My register code's:
OnPlayerConnect:
Код:
new string[64],pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"%s jungiasi prie serverio. Sveiki!",pName); SendClientMessageToAll(COLOR_GREEN,string); new pFile[128], w[128]; format(pFile, sizeof(pFile), "users/%s.ini", PlayerName(playerid)); if(!dini_Exists(pFile)) { format(w,sizeof(w),"Uziregistruok,jeigu nori zaisti",PlayerName(playerid)); ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registracija",w,"Registruotis","Iseiti"); } else { format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid)); ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas",w,"Prisijungti","Iseiti"); } return 1; }
Код:
new pFile[128], pIP[16], w[128], gw[128]; GetPlayerIp(playerid, pIP, sizeof(pIP)); format(pFile, sizeof(pFile), "Users/%s.ini", PlayerName(playerid)); if(dialogid == 1) { if(response == 1) { if(strlen(inputtext)) { if(dini_Exists(pFile)) { SendClientMessage(playerid, COLOR_RED, "Tu jau esi uzsiregistraves!"); } else { PlayerPlaySound(playerid,1057,0.0,0.0,0.0); dini_Create(pFile); dini_Set(pFile, "PlayerName", PlayerName(playerid)); dini_Set(pFile, "PlayerIP", pIP); dini_IntSet(pFile, "PasswordHash", udb_hash(inputtext)); dini_IntSet(pFile, "Admin", 0); dini_IntSet(pFile, "Pinigai", 0); dini_IntSet(pFile, "Taskai", 100); dini_IntSet(pFile, "Mirtys", 0); dini_IntSet(pFile, "Nuzudymai", 0); SendClientMessage(playerid, COLOR_GREEN, "Tu UZREGISTRUOTAS!"); format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid)); ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas",w,"Prisijungti","Iseiti"); } } else { SendClientMessage(playerid, COLOR_RED, "Irasyk slaptazodi!"); format(gw,sizeof(gw),"Uzsiregistruok,jeigu nori zaisti",PlayerName(playerid)); ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registracija",gw,"Registruotis","Iseiti"); } } if(response == 0) { format(w,sizeof(w),"Uzsiregistruok,jeigu nori zaisti",PlayerName(playerid)); ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registracija",w,"Registruotis","Iseiti"); } } if(dialogid == 2) { if(response == 1) { if(strlen(inputtext)) { format(pFile, sizeof(pFile), "Users/%s.ini", PlayerName(playerid)); new pass[256]; pass = dini_Get(pFile, "PasswordHash"); if(udb_hash(inputtext) != strval(pass)) { SendClientMessage(playerid, COLOR_RED, "Blogas slaptazodis!"); format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid)); ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas",w,"Prisijungti","Iseiti"); } else { PlayerPlaySound(playerid,1057,0.0,0.0,0.0); if(dini_Int(pFile,"Admin") == 0){pInfo[playerid][Admin]=false;} if(dini_Int(pFile,"Admin") == 1){pInfo[playerid][Admin]=true;} pInfo[playerid][Money] = dini_Int(pFile, "Pinigai"); pInfo[playerid][Taskai] = dini_Int(pFile, "Taskai"); pInfo[playerid][Mirtys] = dini_Int(pFile, "Mirtys"); pInfo[playerid][Killai] = dini_Int(pFile, "Nuzudymai"); GivePlayerMoney(playerid, pInfo[playerid][Money]); SetPlayerScore(playerid, pInfo[playerid][Taskai]); SendClientMessage(playerid, COLOR_GREEN, "PRISIJUNGIAI!"); } } else { SendClientMessage(playerid, COLOR_RED, "Irasyk slaptazodi!"); format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid)); ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas",w,"Prisijungti","Iseiti"); } } if(response == 0) { format(w,sizeof(w),"Prisijunk,jeigu nori zaisti",PlayerName(playerid)); ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas",w,"Prisijungti","Iseiti"); } } return 0; }
