Jump to content

darklesson

Advanced members
  • Content Count

    12
  • Joined

  • Last visited

Posts posted by darklesson


  1. 8 hours ago, V3ct0r said:

    Hello @darklesson,

     

    You cannot use pkodev::pointer::WPacket__WriteLong() function to write strings into the packet. It is intended only for writing 4-byte integers. You should import WPacket::WriteString() / RPacket::ReadString() methods from GameServer.exe / Game.exe for your purpose.

     

     

    Now the text is show up, but result doesn't expected. -[ 1350998044 ]-

    maybe this part i did wrong, can you help me ? @V3ct0r

    int ret = pkodev::pointer::CParser__DoString(
         reinterpret_cast<void*>(pkodev::address::MOD_EXE_VERSION::CParser),
         "GetChaTalentByMod", 
         pkodev::enumSCRIPT_RETURN_STRING, // is that right ?
         2, 
         pkodev::enumSCRIPT_PARAM_LIGHTUSERDATA,
         1, 
         pMainCha,
         pkodev::DOSTRING_PARAM_END
    );
    
    if (ret != 0) {
      // this part I don't know how to
      const char* talent = reinterpret_cast<const char*>(
            pkodev::pointer::CParser__GetReturnNumber(
                  reinterpret_cast<void*>(pkodev::address::MOD_EXE_VERSION::CParser),
                  0
            )
      );
      
      // Get talent color
      unsigned int color = static_cast<unsigned int>(
         	pkodev::pointer::CParser__GetReturnNumber(
             	reinterpret_cast<void*>(pkodev::address::MOD_EXE_VERSION::CParser),
             	1
         	)
      );
    }

     


  2. Hi, I wanna make this mod to show character's talent(string) and got stucked cause of data type (I've made changed on structure)

    	// Get talent data
            pkodev::Talent talentD = ShowPlayerTalent(role);
    	// Write packet
            pkodev::pointer::WPacket__WriteLong(packet, GetRoleID(role)); 
            pkodev::pointer::WPacket__WriteLong(packet, talentD.talent);   // <-- error because its string
            pkodev::pointer::WPacket__WriteLong(packet, talentD.color);      

    this function can be receive string instead of int ...or another way out?

    	// bool WPacket::WriteLong(uLong lo)
    	typedef int(__thiscall* WPacket__WriteLong__Ptr)(void*, int);
    	WPacket__WriteLong__Ptr WPacket__WriteLong = (WPacket__WriteLong__Ptr)(void*)(address::MOD_EXE_VERSION::WPacket__WriteLong);


    Thank in advance.

×
×
  • Create New...