[C++]Item Shop in joc
Scris: Sâm Ian 27, 2024 12:56 pm
Pentru a functiona corect itemshopul in joc trebuie doar sa modificam functia do_in_game_mall din cmd_general.cpp
Intram in cmd_general.cpp si cautam functia ACMD do_in_game_mall
Selectam toata functia pana la final si o inlocuim cu:
Ulterior modificam URL de aici
Intram in cmd_general.cpp si cautam functia ACMD do_in_game_mall
Selectam toata functia pana la final si o inlocuim cu:
Cod: Selectaţi tot
ACMD(do_in_game_mall)
{
char buf[512+1];
char sas[33];
MD5_CTX ctx;
const char sas_key[] = "17APWl72AqQ8";
char language[3];
strcpy(language, "ro");//If you have multilanguage, update this
snprintf(buf, sizeof(buf), "%u%u%s", ch->GetPlayerID(), ch->GetAID(), sas_key);
MD5Init(&ctx);
MD5Update(&ctx, (const unsigned char *) buf, strlen(buf));
#ifdef __FreeBSD__
MD5End(&ctx, sas);
#else
static const char hex[] = "0123456789abcdef";
unsigned char digest[16];
MD5Final(digest, &ctx);
int i;
for (i = 0; i < 16; ++i) {
sas[i+i] = hex[digest[i] >> 4];
sas[i+i+1] = hex[digest[i] & 0x0f];
}
sas[i+i] = '\0';
#endif
snprintf(buf, sizeof(buf), "mall https://shop.4metin.ro/?pid=%u&lang=%s&sid=%d&sas=%s",
ch->GetPlayerID(), language, g_server_id, sas);
ch->ChatPacket(CHAT_TYPE_COMMAND, buf);
}
Ulterior modificam URL de aici
Cod: Selectaţi tot
snprintf(buf, sizeof(buf), "mall https://shop.4metin.ro/?pid=%u&lang=%s&sid=%d&sas=%s",