server-beta icon indicating copy to clipboard operation
server-beta copied to clipboard

[BEHAVIOR DIFFERENCE]: PawnPlus' AmxString and AmxStringBuffer

Open hreesang opened this issue 3 years ago • 0 comments

Description

In SA:MP server, everything works as intended. PawnPlus' string is shown as how it should be. However, in open.mp, everything turns into random symbols that I don't even know what symbols are those.

How to re-produce this behavior difference

native SendClientMessageStr(playerid, color, ConstAmxString:string) = SendClientMessage;
native GetPlayerNameStrImpl(playerid, AmxStringBuffer:name, len) = GetPlayerName;

stock String:GetPlayerNameStr(playerid)
{
    new String:str = str_new_buf(MAX_PLAYER_NAME);
    str_resize(str, GetPlayerNameStrImpl(playerid, str, MAX_PLAYER_NAME));
    return str;
}

public OnPlayerConnect(playerid)
{
    new String:str = str_format("Welcome, %S.", GetPlayerNameStr(playerid));
    SendClientMessageStr(playerid, -1, str);
    print_s(str);
    return 1;
}

Relevant log output

SA:MP Server

Client: Welcome, Hreesang.

Console: Welcome, Hreesang.

open.mp

Client: Ûã0

Console: [Info] Welcome,

open.mp server version

Build 10

Operating system or distribution

Windows 8.1 & Windows 10

Contact information

Hreesang#0614

Additional information

image

hreesang avatar Sep 16 '22 18:09 hreesang