15.04.2018, 11:46
I create the account and the file is created PlayerName.ini with BanReason=None. How to enter /q this removed "None" BanReason= . If he bans someone, BanReason saves and load(BanReason=TestBan). Only there is a problem. The player is not banned and has BanReason=None. But when the player types /q, is removed "None" and is saved BanReason= . Only "None" is not saved w BanReason when leaving the server /q . How to repair?
OnDialogResponse
Код:
enum pInfo
{
pBanReason[50]
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Код:
LoadAccounts(playerid)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(dini_Exists(file))
{
format(PlayerInfo[playerid][pBanReason], 50, "%s", dini_Get(file, "BanReason"));
}
}
SaveAccounts(playerid)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(dini_Exists(file))
{
dini_Set(file, "BanReason", PlayerInfo[playerid][pBanReason]);
}
}
Код:
dini_Create(file); dini_Set(file, "Password", inputtext); dini_Set(file, "BanReason", "None");



? I hope you're not serious, that's not how you store values into arrays.