I forgot to mention that rebuyweapons is declared like this:
Code:
char rebuyweapons[WeaponsSlot][WEAPONS_MAX_LENGTH];
Here's the full code
Code:
/**
* Force a client to rebuy their weapons.
*
* @param client The client index.
*/
void ZMarketRebuy(int client, bool autorebuy = false)
{
// If client is dead, then stop.
if (!IsPlayerAlive(client))
{
TranslationPrintToChat(client, "Must be alive");
return;
}
// If client is a zombie, then stop.
if (InfectIsClientInfected(client))
{
TranslationPrintToChat(client, "Must be human");
return;
}
bool zmarketbuyzone = GetConVarBool(g_hCvarsList[CVAR_WEAPONS_ZMARKET_BUYZONE]);
if (!autorebuy && zmarketbuyzone && !WeaponsIsClientInBuyZone(client))
{
TranslationPrintToChat(client, "Weapons zmarket buyzone");
return;
}
// Transfer cookie values into an array.
char rebuyweapons[WeaponsSlot][WEAPONS_MAX_LENGTH];
ZMarketCookiesToArray(client, rebuyweapons, WEAPONS_SLOTS_MAX + 1, sizeof(rebuyweapons[]));
// x = Weapon slot.
for (int x = 0; x < WEAPONS_SLOTS_MAX + 1; x++)
{
// If slot is empty, then stop.
if (!rebuyweapons[x][0])
{
continue;
}
ZMarketEquip(client, rebuyweapons[x], true);
}
}
Code:
stock void ZMarketCookiesToArray(int client, char[][] rebuyweapons, int maxweapons, int maxlen)
{
char rebuycookiename[32];
Handle rebuycookie;
// x = Weapon slot.
for (int x = 0; x < maxweapons; x++)
{
// Format cookie name.
Format(rebuycookiename, sizeof(rebuycookiename), "%s_%d", ZMARKET_COOKIE_REBUY, x);
// Find cookie handle, and retrieve its value.
rebuycookie = FindClientCookie(rebuycookiename);
GetClientCookie(client, rebuycookie, rebuyweapons[x], maxlen);
CloseHandle(rebuycookie);
}
}
When I try as you suggested the compiler gives me two errors but it manages to generate the binary
// zr/weapons/zmarket.inc(116
: warning 213: tag mismatch
// zr/weapons/zmarket.inc(116
: warning 229: index tag mismatch (symbol "rebuyweapons")
What does these errors means? How can I solve that?