Account bugging when changing enum that's a string...
#1

Hi guys.

I'm having a major problem in the script I am using. I don't know how to explain it really. But I'll use the ban command as an example. When you ban a player you put a reason so when they attempt to log in it shows them why they are banned or when an admin wants to check the ban reason. How ever, when you do this and it puts the ban reason and saves it onto their account, when you unban them, their account bugs and says 'incorrect password', even though, I know it's 100% correct. This does it for every command like the ban command, for example, offline prison command, is a command where you offline prison someone with a reason so they log back in and see why, but that also bugs it, because of the string bit changing/saving/editing or whatever.

Here is a bit out of the ban command where it does the st ring:
pawn Код:
format(string, sizeof(string), "Ban Reason: %s - Banned by: %s",result,sendername);
strmid(PlayerInfo[giveplayerid][pBanReason], string, 0, strlen(string), 255);
Код:
pBanReason[128]
I am using an old file system but that's obviously not the cause.

Not sure what other codes to show, so I hope that's enough...
Please help!
Reply
#2

For future reference, I think you can just do this.

pawn Код:
format(PlayerInfo[giveplayerid][pBanReason], 128, "Ban Reason: %s - Banned by: %s",result,sendername);
Regardless, Pawn doesn't support 3D arrays which is what that is. You would need another variable outside the enum to handle the string. Like this.

pawn Код:
new pBanReason[MAX_PLAYERS];
Not sure if that would solve it but it would solve one of your problems.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)