Login system problem
#1

well, I've got my gamemode and when i do /register (mypassword) it creats MY name.cer then when i try to /login it says password does not match, this is what it writes out after i do /register (my pass)

shit pPassword0 pCash0 pAccount0 pAdmin1 pLevel0 pExp0 gPupgrade0 pKills0 pLJ0 pIJ0 pSR0 pWA0 pPEN0 pGun10 pGun20 pGun30 pGun40 pGun50 pGun60 pAmmo18 pAmmo230 pAmmo330 pAmmo410 pAmmo510 pAmmo60.000000 pSHealth90.000000 pHealth2246.600097 pPos_x-1161.900024 pPos_y1029.699951 pPos_z15 pInt255 pLocal3 pTeam160 pModel3657 pPnumber255 pPhousekey255 pPbiskey0 pGang0 pGleader0 pService0 pSleader0 pRealAdmin0 pTOS0 pJob0 pGLicense0 pDLicense0 pResign0 pFLicense0 pAlcahol0 pDPoints0 pGPoints0 pSuspended0 pPaycheck0 pDrugs0 pReset0 pCKey0 pHotwire0 pDonation0 pCLicense0 pStrength0 pTLicense

I dunno why it won't let me login, I won't post the scirpt. Just tell why it wouldn't be readin the password right, will only post the commands

Код:
if(strcmp(cmd, "/regnick", true) == 0 || strcmp(cmd, "/register", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /regnick [password]");
return 1;
}
new passlength = strlen(tmp);
if(passlength > 10)
{
SendClientMessage(playerid, COLOR_RED, "Password Must be shorter then 10 charcters");
return 1;
}
if (gPlayerAccount[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD1, " This name is registered");
return 1;
}
gPlayerAccount[playerid] = 1;
strmid(PlayerInfo[playerid][pPassword], tmp, 0, strlen(cmdtext), 255);
Encript(PlayerInfo[playerid][pPassword]);
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s.cer", playername);
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash];
new File: file = fopen(string, io_read);
if (file)
{
SendClientMessage(playerid, COLOR_GRAD1, " This Name is registered");
fclose(file);
return 1;
}
printf("%s has created an account.", playername);
new File:hFile;
hFile = fopen(string, io_append);
new var[32];//
format(var, 32, "%sn", PlayerInfo[playerid][pPassword]);fwrite(hFile, var);
format(var, 32, "%d pCashn", PlayerInfo[playerid][pCash]);fwrite(hFile, var);
format(var, 32, "%d pAccountn", PlayerInfo[playerid][pAccount]);fwrite(hFile, var);
format(var, 32, "%d pAdminn", PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
format(var, 32, "%d pLeveln", PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
format(var, 32, "%d pExpn", PlayerInfo[playerid][pExp]);fwrite(hFile, var);
format(var, 32, "%d gPupgraden", PlayerInfo[playerid][gPupgrade]);fwrite(hFile, var);
format(var, 32, "%d pKillsn", PlayerInfo[playerid][pKills]);fwrite(hFile, var);
format(var, 32, "%d pLJn", PlayerInfo[playerid][pLJ]);fwrite(hFile, var);
format(var, 32, "%d pIJn", PlayerInfo[playerid][pIJ]);fwrite(hFile, var);
format(var, 32, "%d pSRn", PlayerInfo[playerid][pSR]);fwrite(hFile, var);
format(var, 32, "%d pWAn", PlayerInfo[playerid][pWA]);fwrite(hFile, var);
format(var, 32, "%d pPENn", PlayerInfo[playerid][pPEN]);fwrite(hFile, var);
format(var, 32, "%d pGun1n", PlayerInfo[playerid][pGun1]);fwrite(hFile, var);
format(var, 32, "%d pGun2n", PlayerInfo[playerid][pGun2]);fwrite(hFile, var);
format(var, 32, "%d pGun3n", PlayerInfo[playerid][pGun3]);fwrite(hFile, var);
format(var, 32, "%d pGun4n", PlayerInfo[playerid][pGun4]);fwrite(hFile, var);
format(var, 32, "%d pGun5n", PlayerInfo[playerid][pGun5]);fwrite(hFile, var);
format(var, 32, "%d pGun6n", PlayerInfo[playerid][pGun6]);fwrite(hFile, var);
format(var, 32, "%d pAmmo1n", PlayerInfo[playerid][pAmmo1]);fwrite(hFile, var);
format(var, 32, "%d pAmmo2n", PlayerInfo[playerid][pAmmo2]);fwrite(hFile, var);
format(var, 32, "%d pAmmo3n", PlayerInfo[playerid][pAmmo3]);fwrite(hFile, var);
format(var, 32, "%d pAmmo4n", PlayerInfo[playerid][pAmmo4]);fwrite(hFile, var);
format(var, 32, "%d pAmmo5n", PlayerInfo[playerid][pAmmo5]);fwrite(hFile, var);
format(var, 32, "%d pAmmo6n", PlayerInfo[playerid][pAmmo6]);fwrite(hFile, var);
format(var, 32, "%f pSHealthn", PlayerInfo[playerid][pSHealth]);fwrite(hFile, var);
format(var, 32, "%f pHealthn", PlayerInfo[playerid][pHealth]);fwrite(hFile, var);
format(var, 32, "%f pPos_xn", PlayerInfo[playerid][pPos_x]);fwrite(hFile, var);
format(var, 32, "%f pPos_yn", PlayerInfo[playerid][pPos_y]);fwrite(hFile, var);
format(var, 32, "%f pPos_zn", PlayerInfo[playerid][pPos_z]);fwrite(hFile, var);
if(accountplay)
{
PlayerInfo[playerid][pInt] = 0;
}
format(var, 32, "%d pIntn", PlayerInfo[playerid][pInt]);fwrite(hFile, var);
format(var, 32, "%d pLocaln", PlayerInfo[playerid][pLocal]);fwrite(hFile, var);
format(var, 32, "%d pTeamn", PlayerInfo[playerid][pTeam]);fwrite(hFile, var);
format(var, 32, "%d pModeln", PlayerInfo[playerid][pModel]);fwrite(hFile, var);
format(var, 32, "%d pPnumbern", PlayerInfo[playerid][pPnumber]);fwrite(hFile, var);
format(var, 32, "%d pPhousekeyn", PlayerInfo[playerid][pPhousekey]);fwrite(hFile, var);
format(var, 32, "%d pPbiskeyn", PlayerInfo[playerid][pPbiskey]);fwrite(hFile, var);
format(var, 32, "%d pGangn", PlayerInfo[playerid][pKills]);fwrite(hFile, var);
format(var, 32, "%d pGleadern", PlayerInfo[playerid][pGleader]);fwrite(hFile, var);
format(var, 32, "%d pServicen", PlayerInfo[playerid][pService]);fwrite(hFile, var);
format(var, 32, "%d pSleadern", PlayerInfo[playerid][pSleader]);fwrite(hFile, var);
format(var, 32, "%d pRealAdminn", PlayerInfo[playerid][pRealAdmin]);fwrite(hFile, var);
format(var, 32, "%d pTOSn", PlayerInfo[playerid][pTOS]);fwrite(hFile, var);
format(var, 32, "%d pJobn", PlayerInfo[playerid][pJob]);fwrite(hFile, var);
format(var, 32, "%d pGLicensen", PlayerInfo[playerid][pGLicense]);fwrite(hFile, var);
format(var, 32, "%d pDLicensen", PlayerInfo[playerid][pDLicense]);fwrite(hFile, var);
format(var, 32, "%d pResignn", PlayerInfo[playerid][pResign]);fwrite(hFile, var);
format(var, 32, "%d pFLicensen", PlayerInfo[playerid][pFLicense]);fwrite(hFile, var);
format(var, 32, "%d pAlcaholn", PlayerInfo[playerid][pAlcahol]);fwrite(hFile, var);
format(var, 32, "%d pDPointsn", PlayerInfo[playerid][pDPoints]);fwrite(hFile, var);
format(var, 32, "%d pGPointsn", PlayerInfo[playerid][pGPoints]);fwrite(hFile, var);
format(var, 32, "%d pSuspendedn", PlayerInfo[playerid][pSuspended]);fwrite(hFile, var);
format(var, 32, "%d pPaycheckn", PlayerInfo[playerid][pPaycheck]);fwrite(hFile, var);
format(var, 32, "%d pDrugsn", PlayerInfo[playerid][pDrugs]);fwrite(hFile, var);
format(var, 32, "%d pResetn", PlayerInfo[playerid][pReset]);fwrite(hFile, var);
format(var, 32, "%d pCKeyn", PlayerInfo[playerid][pCKey]);fwrite(hFile, var);
format(var, 32, "%d pHotwiren", PlayerInfo[playerid][pHotwire]);fwrite(hFile, var);
format(var, 32, "%d pDonationn", PlayerInfo[playerid][pDonation]);fwrite(hFile, var);
format(var, 32, "%d pCLicensen", PlayerInfo[playerid][pCLicense]);fwrite(hFile, var);
format(var, 32, "%d pStrengthn", PlayerInfo[playerid][pStrength]);fwrite(hFile, var);
format(var, 32, "%d pTLicensen", PlayerInfo[playerid][pTLicense]);fwrite(hFile, var);
fclose(hFile);
GameTextForPlayer(playerid, "SERVER: Next time you connect type /login password to log in", 5000, 3);
justreg[playerid] = 1;
OnPlayerLogin(playerid,PlayerInfo[playerid][pPassword]);
return 1;
}
Код:
if (strcmp(cmd, "/login", true) ==0 )
{
new tmppass[64];
if (gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /login [password]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encript(tmppass);
if (gdebug){printf("DEBUG enterd %s", tmppass);}
OnPlayerLogin(playerid,tmppass);
return 1;
}

Reply
#2

This looks like a godfather .ini file. Ask in there. if it is.
Reply
#3

Quote:
Originally Posted by Bruzer18
This looks like a godfather .ini file. Ask in there. if it is.
It's not godfather, I've updated the first post, I've put the 2 commands
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)