Posts: 3,004
Threads: 12
Joined: May 2011
Quote:
Originally Posted by Hansrutger
I haven't done much dini but oh' well.
Inside your enum declaration you should be having something like this:
enum e_PlayerInfo {
Banned_By,
Ban_Reason
};
Have you made those two into arrays? Should be looking like this if you want it to be correct:
enum e_PlayerInfo {
Banned_By[MAX_PLAYER_NAME],
Ban_Reason[128]
};
EDIT:
Nevermind I was stupid, it should maybe work like if you put it into a format.
Код:
format(PlayerInfo[playerid][Banned_By], MAX_PLAYER_NAME, "%s", dini_Get(file, "Banned_By");
|
Banned_By[MAX_PLAYER_NAME + 1]
for the termination \0 cell
also, I suggest to use
memcpy or strcat at least instead of format
Код:
#define strcpy(%0,%1,%2) strcat((%0[0] = '\0', %0), %1, %2);
strcpy(dest, str[], length);
for
this reason
Posts: 3,004
Threads: 12
Joined: May 2011
Quote:
Originally Posted by Speaker
Thanks Well U Made A Mistake
It Should Be
Код:
format(PlayerInfo[playerid][Banned_By], 256, "%s", dini_Get(file, "Banned_By"));
|
He didnt' make a mistake, MAX_PLAYER_NAME is defined to equal to 24, which is the maximum length a nickname on samp can be.
Why do you set it to 256?
I thought Banned_By holds the name of the player who bans the other player.
If so, it should be 24 at max. because nicknames on samp cannot be longer than this.
Posts: 760
Threads: 22
Joined: May 2011
Reputation:
0
Aye I forget about the \ thanks, should probably fix this in my own gamemode since I never really thought about it.
Ї\_(ツ)_/Ї