26.12.2010, 11:51
PHP код:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string3[128];
format(string3, sizeof(string3), "fcrp/users/%s.ini", PlayerName(playerid));
new File: hFile = fopen(string3, io_write);
if (hFile)
{
strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
new var[32];
format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
format(var, 32, "DonateRank=%d\n",PlayerInfo[playerid][pDonateRank]);fwrite(hFile, var);
format(var, 32, "Registered=%d\n",PlayerInfo[playerid][pRegistered]);fwrite(hFile, var);
format(var, 32, "Sex=%d\n",PlayerInfo[playerid][pSex]);fwrite(hFile, var);
format(var, 32, "Age=%d\n",PlayerInfo[playerid][pAge]);fwrite(hFile, var);
format(var, 32, "Experience=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
format(var, 32, "Bank=%d\n",PlayerInfo[playerid][pBank]);fwrite(hFile, var);
format(var, 32, "Skin=%d\n",PlayerInfo[playerid][pSkin]);fwrite(hFile, var);
format(var, 32, "Drugs=%d\n",PlayerInfo[playerid][pDrugs]);fwrite(hFile, var);
format(var, 32, "Materials=%d\n",PlayerInfo[playerid][pMaterials]);fwrite(hFile, var);
format(var, 32, "Job=%d\n",PlayerInfo[playerid][pJob]);fwrite(hFile, var);
format(var, 32, "PlayingHours=%d\n",PlayerInfo[playerid][pPlayingHours]);fwrite(hFile, var);
format(var, 32, "AllowedPayday=%d\n",PlayerInfo[playerid][pAllowedPayday]);fwrite(hFile, var);
format(var, 32, "PayCheck=%d\n",PlayerInfo[playerid][pPayCheck]);fwrite(hFile, var);
format(var, 32, "Faction=%d\n",PlayerInfo[playerid][pFaction]);fwrite(hFile, var);
format(var, 32, "Rank=%d\n",PlayerInfo[playerid][pRank]);fwrite(hFile, var);
format(var, 32, "HouseKey=%d\n",PlayerInfo[playerid][pHouseKey]);fwrite(hFile, var);
format(var, 32, "BizKey=%d\n",PlayerInfo[playerid][pBizKey]);fwrite(hFile, var);
format(var, 32, "SpawnPoint=%d\n",PlayerInfo[playerid][pSpawnPoint]);fwrite(hFile, var);
format(var, 32, "Banned=%d\n",PlayerInfo[playerid][pBanned]);fwrite(hFile, var);
format(var, 32, "Warnings=%d\n",PlayerInfo[playerid][pWarnings]);fwrite(hFile, var);
format(var, 32, "CarLic=%d\n",PlayerInfo[playerid][pCarLic]);fwrite(hFile, var);
format(var, 32, "FlyLic=%d\n",PlayerInfo[playerid][pFlyLic]);fwrite(hFile, var);
format(var, 32, "WepLic=%d\n",PlayerInfo[playerid][pWepLic]);fwrite(hFile, var);
format(var, 32, "PhoneNumber=%d\n",PlayerInfo[playerid][pPhoneNumber]);fwrite(hFile, var);
format(var, 32, "PhoneC=%d\n",PlayerInfo[playerid][pPhoneC]);fwrite(hFile, var);
format(var, 32, "PhoneBook=%d\n",PlayerInfo[playerid][pPhoneBook]);fwrite(hFile, var);
format(var, 32, "ListNumber=%d\n",PlayerInfo[playerid][pListNumber]);fwrite(hFile, var);
format(var, 32, "Donator=%d\n",PlayerInfo[playerid][pDonator]);fwrite(hFile, var);
format(var, 32, "Jailed=%d\n",PlayerInfo[playerid][pJailed]);fwrite(hFile, var);
format(var, 32, "JailTime=%d\n",PlayerInfo[playerid][pJailTime]);fwrite(hFile, var);
format(var, 32, "Products=%d\n",PlayerInfo[playerid][pProducts]);fwrite(hFile, var);
format(var, 32, "CrashX=%f\n",PlayerInfo[playerid][pCrashX]);fwrite(hFile, var);
format(var, 32, "CrashY=%f\n",PlayerInfo[playerid][pCrashY]);fwrite(hFile, var);
format(var, 32, "CrashZ=%f\n",PlayerInfo[playerid][pCrashZ]);fwrite(hFile, var);
format(var, 32, "CrashInt=%d\n",PlayerInfo[playerid][pCrashInt]);fwrite(hFile, var);
format(var, 32, "CrashW=%d\n",PlayerInfo[playerid][pCrashW]);fwrite(hFile, var);
format(var, 32, "Crashed=%d\n",PlayerInfo[playerid][pCrashed]);fwrite(hFile, var);
fclose(hFile);
SendClientMessage(playerid, COLOR_YELLOW2, "[INFO:] Registration successful.");
}
}
return 1;
}