[Question]Making a file?
#4

I actually prefer the original function...

Код:
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]");
}
/login command should be pretty simple from there.


Hopefully that code is alright. I'm fairly new to Pawn
Reply


Messages In This Thread
[Question]Making a file? - by Rensieboy14 - 09.01.2010, 22:11
Re: [Question]Making a file? - by CJ101 - 09.01.2010, 22:22
Re: [Question]Making a file? - by Rensieboy14 - 09.01.2010, 22:31
Re: [Question]Making a file? - by Deji - 09.01.2010, 23:09
Re: [Question]Making a file? - by Rensieboy14 - 09.01.2010, 23:23

Forum Jump:


Users browsing this thread: 3 Guest(s)