S
S
Sanders Rocket2020-07-16 11:41:17
C++ / C#
Sanders Rocket, 2020-07-16 11:41:17

How to do replace and regex_search?

Hello everyone, I'm new to c++, I have a couple of questions.
There is this code:

bool CALLBACK incomingRPC(stRakNetHookParams* params) // определение callback-функции, которая будет вызвана, если от сервера был получен новый RPC.
{
  if (params->packetId == ScriptRPCEnumeration::RPC_ScrCreate3DTextLabel) 
  {
    char text[256];

    params->bitStream->ResetReadPointer();
    params->bitStream->SetReadOffset(0xD8);
    SF->getRakNet()->DecodeString(text, 256, params->bitStream);
    if (strstr(text,"{73B461}Номер бизнеса: {FFFFFF}")) {
      SF->getSAMP()->getChat()->AddChatMessage(-1, "Text: %s", text);
    }
  };

  return true; // успешно завершаем обработку RPC.
};

1. I need to remove \n from the incoming char text, how to do it?
2. How can I take from the text below only 154 [can be any number], Hotel [can be ammo / shooting gallery, etc.], Leonardo_Reyes [any nickname in the English layout of the Nick_Name format]
{73B461}Номер бизнеса: {FFFFFF}154 
{73B461}Тип бизнеса: {FFFFFF}Отель 
{73B461}Владелец: {FFFFFF}Leonardo_Reyes 
{73B461}Крыша: {FFFFFF}ЛКН 
{CB2424}Входа нет!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question