Writing a string to playerfiles
#1

I'm trying to write a string to someones player file, when they are banned.
What I'm trying to do;
Код:
PlayerInfo[playerid][pBanReason] = reason;
PlayerInfo[playerid][pBannedBy] = GetPlayerNameEx(giveplayerid);
I've tried things like
strcpy(PlayerInfo[playerid][pBanReason], reason, sizeof(reason));
that just gives an error... I'm not sure how to go about doing this?
Reply
#2

Sorry, I misread your issue.
Reply
#3

Maybe this ?
pawn Код:
format(PlayerInfo[playerid][pBanReason], sizeof(PlayerInfo[playerid][pBanReason]), "%s", reason);
Reply
#4

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
Maybe this ?
pawn Код:
format(PlayerInfo[playerid][pBanReason], sizeof(PlayerInfo[playerid][pBanReason]), "%s", reason);
That gives me errors.
I got
strcpy(PlayerInfo[playerid][pBannedBy], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
That works without error, it's just the ban reason I can't seem to get to work. I'll look into that tutorial...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)