05.01.2011, 19:53
This would be more like it:
pawn Код:
public RegisterPlayer(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, sizeof name);
format(str, sizeof str, "%s.ini", name);
new File:account = fopen(str, io_write);
if (account)
{
strmid(AccountInfo[playerid][aPassword], password, 0, strlen(password), 128);
GetPlayerPos(playerid, AccountInfo[playerid][aX], AccountInfo[playerid][aY], AccountInfo[playerid][aZ]);
GetPlayerFacingAngle(playerid, AccountInfo[playerid][aA]);
new file[128];
format(file, sizeof file, "Password: %s\n", AccountInfo[playerid][aPassword]); // Format
fwrite(account, file); // Save
format(file, sizeof file, "Cash: %d\n", 0); // Format
fwrite(account, file); // Save
format(file, sizeof file, "Score: %d\n", 0); // Format
fwrite(account, file); // Save
format(file, sizeof file, "X: %f\n",AccountInfo[playerid][aX]); // Format
fwrite(account, file); // Save
format(file, sizeof file, "Y: %f\n",AccountInfo[playerid][aY]); // Format
fwrite(account, file); // Save
format(file, sizeof file, "Z: %f\n",AccountInfo[playerid][aZ]); // Format
fwrite(account, file); // Save
format(file, sizeof file, "Angle: %f\n",AccountInfo[playerid][aA]); // Format
fwrite(account, file); // Save
fclose(account); // Close
SendClientMessage(playerid, 0x21DD00FF, "You have successfully registered an account. You may now /login.");
}
}
return 1;
}