FakeNick - problem

dphome

Well-known member
Joined
Mar 21, 2020
Messages
458
Solutions
9
Reaction score
166
Location
Poland
Hmm, what is wrong?
PHP:
void RakClient::name_hook(const char *buf, const char *fmt, const char *name, const int id)
{
    BYTE nameLen = (BYTE)strlen(name);
    BitStream bsSend;
    bsSend.Write(buf);
    bsSend.Write(fmt);
    bsSend.Write(nameLen);
    bsSend.Write(name, nameLen);
    bsSend.Write(id);
    g_RakClient->RPC(RPC_SetPlayerName, &bsSend);
}

void cmd_nick(char *params)
{
    if (params[0] == '\0')
        return addMessageToChatWindow("USAGE: /nick <id>");

    const int playerid = atoi(params);
    const char *x, *y;
    g_RakClient->name_hook(x,y,"test_test", playerid);
}
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
458
Solutions
9
Reaction score
166
Location
Poland
i try make it in many ways and this is shit example for set player name
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
458
Solutions
9
Reaction score
166
Location
Poland
like that not working too
PHP:
void cmd_nick(char *params)
{
    if (params[0] == '\0')
        return addMessageToChatWindow("USAGE: /nick <id>");

    int playerid = atoi(params);

    g_RakClient->name_hook("test_test", playerid);
}

void RakClient::name_hook(char* name, int id)
{
    char buf[256], fmt[256];
    BitStream bsSend;
    bsSend.Read(buf);
    bsSend.Read(fmt);
    bsSend.Write((BYTE)strlen(name));
    bsSend.Write(name, strlen(name));
    bsSend.Write(id);
    g_RakClient->RPC(RPC_SetPlayerName, &bsSend);
}
 

0x_

Wtf I'm not new....
Staff member
Administrator
Joined
Feb 18, 2013
Messages
1,123
Reaction score
174
What are you trying to do?
Unless you have some custom RakClientInterface::RPC function which invokes the local rpc handler you're just sending a client rpc to the server.

If you want to change your nickname on the server you have to re-join or send RPC_ClientJoin but just set and reconnect is what you want to do.
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
458
Solutions
9
Reaction score
166
Location
Poland
i try make it like that
RUGTXhP.png
gKH06JU.png


w/o RakClient.h and RakClient.cpp, only in cheat_samp.cpp not working too
PHP:
void cmd_nick(char *params)
{
    if (params[0] == '\0')
        return addMessageToChatWindow("USAGE: /nick <id>");

    // {'onSetPlayerName', {playerId = 'uint16'}, {name = 'string8'}, {success = 'bool8'}}
    uint16_t playerId = atoi(params);
    uint8_t success = 1;
    const char *name = "Test_Test";
    BYTE nameLen = (BYTE)strlen(name);

    BitStream bsSend;
    bsSend.Write(playerId);
    bsSend.Write(nameLen);
    bsSend.Write(name, nameLen);
    bsSend.Write(success);
    g_RakClient->RPC(RPC_SetPlayerName, &bsSend);
}

void initChatCmds(void)
{
    if (g_m0dCommands == true)
        return;

    cheat_state_text("initiated modcommands");
    addClientCommand("nick", cmd_nick);
    g_m0dCommands = true;
}
 

Attachments

  • 1653136595743.png
    1653136595743.png
    78.5 KB · Views: 2

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,461
Solutions
5
Reaction score
913
Location
Israel
G0d dam
It's an RPC you get from the server not send to the server!

You have 2 options.
1. Make a hook to a large part of samp's raknet functions (whatever you don't do because it will be especially complicated for you since you still don't even differentiate between packages..)

2. You use sobeit "welcome to ez edit memory samp"
Play with the g_player->...etc, get to the point of the player's name and edit. It should work for you
 

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,461
Solutions
5
Reaction score
913
Location
Israel
Forge another player's name
C++:
g_Players->pRemotePlayer[Target]->strPlayerName
Forge your own name
C++:
g_Players->strLocalPlayerName
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
458
Solutions
9
Reaction score
166
Location
Poland
I know this, but i trying to create with RakNet. When I do this then I past here code.
 

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,461
Solutions
5
Reaction score
913
Location
Israel
I know this, but i trying to create with RakNet. When I do this then I past here code.
So I explained to you above what you need to do. I recommend you click on something simpler, call the RPC function (like you do in updatepingscore in sobeit) look at the set_player_name function, you can take the offset from the creditor of the offset that I published there recently..
 

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,461
Solutions
5
Reaction score
913
Location
Israel
Or use the simplest sampfuncs easy life. The DL supporter is also good for you.
 
Top