09.01.2010, 23:09
I actually prefer the original function...
/login command should be pretty simple from there.
Hopefully that code is alright. I'm fairly new to Pawn
Код:
new tmpstring[32]; new sendername[MAX_PLAYER_NAME]; GetPlayerName(playerid, sendername, sizeof(sendername)); format(tmpstring, sizeof(tmpstring), "users\%s.dat", sendername); new File: file = fopen(tmpstring, io_write); if (hFile){ strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255); new tmp[32]; //-----GETS ADMIN LEVEL----- format(tmp, sizeof(tmp), "AdminLevel=%d\n\r",PlayerInfo[playerid][pAdmin]); fwrite(file, tmp); PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid); fclose(file); SendClientMessage(playerid, 0x777700FF, "Registered! You can login by using /login [password]"); }
Hopefully that code is alright. I'm fairly new to Pawn