Code:
error 017: undefined symbol "base64_encode"
error 088: number of arguments does not match definition
I've got these errors
base64.inc
PHP Code:
#include <amxmodx>
static const Codes64[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"
public Encode64(s[])
{
new i=0,a=0,x=0,b=0,Result
for (i=1;i<strlen(s);i++) {
x = str_to_num(s[i])
b = b * 256 + x
a = a + 8
while (a >= 6) {
a = a - 6
x = b / (1 << a)
b = b % (1 << a)
Result += Codes64[x + 1]
}
}
if (a > 0) {
x = b << (6 - a);
Result += Codes64[x + 1];
}
return Result;
}
public Decode64(s[])
{
new i=0,a=0,x=0,b=0,Result,ch[1]
for (i = 1; i< strlen(s);i++) {
for (new index = 0; Codes64[index]; index++)
if (s[i]==Codes64[index]) {
x=index-1
break
}
if (x >= 0) {
b = b * 64 + x
a = a + 6
if (a >= 8) {
a = a - 8
x = b >> a
b = b % (1 << a)
x = x % 256
Result += num_to_word(x,ch,1)
}
}
else exit;
}
return Result;
}
error line
PHP Code:
public get_graph_link(const szName[], szMotd[], iLen)
{
static szName64[64];
new iPos;
base64_encode(szName, szName64, charsmax(szName64));
replace_all(szName64, charsmax(szName64), "=", "%%3D");
iPos += formatex(szMotd[iPos], iLen, "<html><head></head><body bgcolor=^"#000000^"><div align=^"center^">");
iPos += formatex(szMotd[iPos], iLen, "<strong><span style=^"color:#ffffff^">%s</span></strong><br /><br />", szName);
iPos += formatex(szMotd[iPos], iLen, "<strong><span style=^"color:#ff0000;^">Day</span></strong><br />");
iPos += formatex(szMotd[iPos], iLen, "<img src=^"http://www.gametracker.com/images/graphs/player_time.php?nameb64=%s&host=%s&start=-1d^" width=^"200^" height=^"150^"/><br /><br />",
szName64, g_szIp);
iPos += formatex(szMotd[iPos], iLen, "<strong><span style=^"color:#ff0000;^">Week</span></strong><br />");
iPos += formatex(szMotd[iPos], iLen, "<img src=^"http://www.gametracker.com/images/graphs/player_time.php?nameb64=%s&host=%s&start=-1w^" width=^"200^" height=^"150^"/><br /><br />",
szName64, g_szIp);
iPos += formatex(szMotd[iPos], iLen, "<strong><span style=^"color:#ff0000;^">Month</span></strong><br />");
iPos += formatex(szMotd[iPos], iLen, "<img src=^"http://www.gametracker.com/images/graphs/player_time.php?nameb64=%s&host=%s&start=-1m^" width=^"200^" height=^"150^"/><br /><br />",
szName64, g_szIp);
iPos += formatex(szMotd[iPos], iLen, "</div></body></html>");
}
PHP Code:
base64_encode(szName, szName64, charsmax(szName64));
__________________