Ldudb.inc
#1

Every time I attempt to compile the LuxAdmin script, theses errors appear. I've tried replacing the includes that come with it and also tried a fresh new copy of LuxAdmin but with no success. If anyone can help me with this then please do come forth, I will reward anything that is of use and or helpful to me in this situation, thanks. The error lines are as follows:

pawn Код:
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(45) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(45) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(46) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(46) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(47) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(47) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(48) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(48) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(49) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(49) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(50) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(50) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(51) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(51) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(52) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(52) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(53) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(53) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(54) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(54) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(55) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(55) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(56) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(56) : error 033: array must be indexed (variable "tmp")
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(57) : error 017: undefined symbol "strreplace"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(57) : error 033: array must be indexed (variable "tmp")

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
Reply
#2

No one has a solution?
Reply
#3

Or this is an error provided by loss of bracket, or the compiler did not found a strreplace function. I think it's about the second one.
Reply
#4

Well do you have any solutions on fixing this? I've tried replacing it countless times and then compiling it etc but nothing seems to work.
Reply
#5

It's obvious, i've already told what the solution is. Put the strreplace function to your GM/FS and then compile. Because compiler has told you "I didn't found a strreplace function"
Reply
#6

These are the only things with strreplace:

pawn Код:
stock udb_encode(nickname[]) {
  new tmp[MAX_STRING];
  set(tmp,nickname);
  tmp=strreplace("_","_00",tmp);
  tmp=strreplace(";","_01",tmp);
  tmp=strreplace("!","_02",tmp);
  tmp=strreplace("/","_03",tmp);
  tmp=strreplace("\\","_04",tmp);
  tmp=strreplace("[","_05",tmp);
  tmp=strreplace("]","_06",tmp);
  tmp=strreplace("?","_07",tmp);
  tmp=strreplace(".","_08",tmp);
  tmp=strreplace("*","_09",tmp);
  tmp=strreplace("<","_10",tmp);
  tmp=strreplace(">","_11",tmp);
  tmp=strreplace("{","_12",tmp);
  tmp=strreplace("}","_13",tmp);
  tmp=strreplace(" ","_14",tmp);
  tmp=strreplace("\"","_15",tmp);
  tmp=strreplace(":","_16",tmp);
  tmp=strreplace("|","_17",tmp);
  tmp=strreplace("=","_18",tmp);
  return tmp;
}

stock udb_decode(nickname[]) {
  new tmp[MAX_STRING];
  set(tmp,nickname);
  tmp=strreplace("_01",";",tmp);
  tmp=strreplace("_02","!",tmp);
  tmp=strreplace("_03","/",tmp);
  tmp=strreplace("_04","\\",tmp);
  tmp=strreplace("_05","[",tmp);
  tmp=strreplace("_06","]",tmp);
  tmp=strreplace("_07","?",tmp);
  tmp=strreplace("_08",".",tmp);
  tmp=strreplace("_09","*",tmp);
  tmp=strreplace("_10","<",tmp);
  tmp=strreplace("_11",">",tmp);
  tmp=strreplace("_12","{",tmp);
  tmp=strreplace("_13","}",tmp);
  tmp=strreplace("_14"," ",tmp);
  tmp=strreplace("_15","\"",tmp);
  tmp=strreplace("_16",":",tmp);
  tmp=strreplace("_17","|",tmp);
  tmp=strreplace("_18","=",tmp);
  tmp=strreplace("_00","_",tmp);
  return tmp;
}
Are sure I need to add these?
Reply
#7

But where's the 'strreplace' function? You called it but the compiler says it don't know where to find it.
Reply
#8

That's all there was. No function related to strreplace, see for yourself:

pawn Код:
/*
================================================================================
-------------------------------------------------
LuX Administration System v1.6 Beta

Data Include v3.0
-------------------------------------------------
================================================================================

ORIGINAL DUDB functions By DracoBlue
*/


#if defined _dudb_included
  #endinput
#endif

#define _dudb_included
#pragma library dutils

#include <dutils>
#include <dini>
#define dUser(%1).( udb_User(%1,
#define dUserINT(%1).( udb_UserInt(%1,
#define dUserSet(%1).( udb_UserSet(%1,
#define dUserSetINT(%1).( udb_UserSetInt(%1,
#define dUserSetFLOAT(%1).( udb_UserSetFloat(%1,
#define dUserFLOAT(%1).( udb_UserFloat(%1,

stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}

stock udb_encode(nickname[]) {
  new tmp[MAX_STRING];
  set(tmp,nickname);
  tmp=strreplace("_","_00",tmp);
  tmp=strreplace(";","_01",tmp);
  tmp=strreplace("!","_02",tmp);
  tmp=strreplace("/","_03",tmp);
  tmp=strreplace("\\","_04",tmp);
  tmp=strreplace("[","_05",tmp);
  tmp=strreplace("]","_06",tmp);
  tmp=strreplace("?","_07",tmp);
  tmp=strreplace(".","_08",tmp);
  tmp=strreplace("*","_09",tmp);
  tmp=strreplace("<","_10",tmp);
  tmp=strreplace(">","_11",tmp);
  tmp=strreplace("{","_12",tmp);
  tmp=strreplace("}","_13",tmp);
  tmp=strreplace(" ","_14",tmp);
  tmp=strreplace("\"","_15",tmp);
  tmp=strreplace(":","_16",tmp);
  tmp=strreplace("|","_17",tmp);
  tmp=strreplace("=","_18",tmp);
  return tmp;
}

stock udb_decode(nickname[]) {
  new tmp[MAX_STRING];
  set(tmp,nickname);
  tmp=strreplace("_01",";",tmp);
  tmp=strreplace("_02","!",tmp);
  tmp=strreplace("_03","/",tmp);
  tmp=strreplace("_04","\\",tmp);
  tmp=strreplace("_05","[",tmp);
  tmp=strreplace("_06","]",tmp);
  tmp=strreplace("_07","?",tmp);
  tmp=strreplace("_08",".",tmp);
  tmp=strreplace("_09","*",tmp);
  tmp=strreplace("_10","<",tmp);
  tmp=strreplace("_11",">",tmp);
  tmp=strreplace("_12","{",tmp);
  tmp=strreplace("_13","}",tmp);
  tmp=strreplace("_14"," ",tmp);
  tmp=strreplace("_15","\"",tmp);
  tmp=strreplace("_16",":",tmp);
  tmp=strreplace("_17","|",tmp);
  tmp=strreplace("_18","=",tmp);
  tmp=strreplace("_00","_",tmp);
  return tmp;
}


stock udb_Exists(nickname[]) {
  new tmp[MAX_STRING];
  format(tmp,sizeof(tmp),"LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return fexist(tmp);
}


stock udb_Remove(nickname[]) {
  new tmp[MAX_STRING];
  format(tmp,sizeof(tmp),"LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_Remove(tmp);
}

stock udb_UserSetInt(nickname[],key[],value) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_IntSet(fname,key,value);
}

stock udb_UserSetFloat(nickname[],key[],Float:value) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_FloatSet(fname,key,value);
}

stock udb_UserSet(nickname[],key[],value[]) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_Set(fname,key,value);
}

stock udb_User(nickname[],key[]) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  format(fname,sizeof(fname),dini_Get(fname,key));
  return fname;
}

stock Float:udb_UserFloat(nickname[],key[]) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_Float(fname,key);
}

stock udb_UserInt(nickname[],key[]) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_Int(fname,key);
}
stock udb_Create(nickname[])
{
  if (udb_Exists(nickname)) return false;
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  dini_Create(fname);
  return true;
}

stock udb_RenameUser(nickname[],newnick[]) {
  new oldfname[MAX_STRING];
  new newfname[MAX_STRING];
  format(oldfname,sizeof(oldfname),"LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  format(newfname,sizeof(newfname),"LuxAdmin/Accounts/%s.sav",udb_encode(newnick));
  return frenametextfile(oldfname,newfname);
}
Reply
#9

So that's a point of the problem. stock calls a function named 'strreplace' but don't know where it is declared.

Use this one:
pawn Код:
/*
================================================================================
-------------------------------------------------
LuX Administration System v1.6 Beta

Data Include v3.0
-------------------------------------------------
================================================================================

ORIGINAL DUDB functions By DracoBlue
*/


#if defined _dudb_included
  #endinput
#endif

#define _dudb_included
#pragma library dutils

#include <dutils>
#include <dini>
#define dUser(%1).( udb_User(%1,
#define dUserINT(%1).( udb_UserInt(%1,
#define dUserSet(%1).( udb_UserSet(%1,
#define dUserSetINT(%1).( udb_UserSetInt(%1,
#define dUserSetFLOAT(%1).( udb_UserSetFloat(%1,
#define dUserFLOAT(%1).( udb_UserFloat(%1,

stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}

stock udb_encode(nickname[]) {
  new tmp[MAX_STRING];
  set(tmp,nickname);
  tmp=strreplace("_","_00");
  tmp=strreplace(";","_01");
  tmp=strreplace("!","_02");
  tmp=strreplace("/","_03");
  tmp=strreplace("\\","_04");
  tmp=strreplace("[","_05");
  tmp=strreplace("]","_06");
  tmp=strreplace("?","_07");
  tmp=strreplace(".","_08");
  tmp=strreplace("*","_09");
  tmp=strreplace("<","_10");
  tmp=strreplace(">","_11");
  tmp=strreplace("{","_12");
  tmp=strreplace("}","_13");
  tmp=strreplace(" ","_14");
  tmp=strreplace("\"","_15");
  tmp=strreplace(":","_16");
  tmp=strreplace("|","_17");
  tmp=strreplace("=","_18");
  return tmp;
}

stock udb_decode(nickname[]) {
  new tmp[MAX_STRING];
  set(tmp,nickname);
  tmp=strreplace("_01",";");
  tmp=strreplace("_02","!");
  tmp=strreplace("_03","/");
  tmp=strreplace("_04","\\");
  tmp=strreplace("_05","[");
  tmp=strreplace("_06","]");
  tmp=strreplace("_07","?");
  tmp=strreplace("_08",".");
  tmp=strreplace("_09","*");
  tmp=strreplace("_10","<");
  tmp=strreplace("_11",">");
  tmp=strreplace("_12","{");
  tmp=strreplace("_13","}");
  tmp=strreplace("_14"," ");
  tmp=strreplace("_15","\");
  tmp=strreplace("
_16",":");
  tmp=strreplace("
_17","|");
  tmp=strreplace("
_18","=");
  tmp=strreplace("
_00","_");
  return tmp;
}


stock udb_Exists(nickname[]) {
  new tmp[MAX_STRING];
  format(tmp,sizeof(tmp),"
LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return fexist(tmp);
}


stock udb_Remove(nickname[]) {
  new tmp[MAX_STRING];
  format(tmp,sizeof(tmp),"
LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_Remove(tmp);
}

stock udb_UserSetInt(nickname[],key[],value) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"
LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_IntSet(fname,key,value);
}

stock udb_UserSetFloat(nickname[],key[],Float:value) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"
LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_FloatSet(fname,key,value);
}

stock udb_UserSet(nickname[],key[],value[]) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"
LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_Set(fname,key,value);
}

stock udb_User(nickname[],key[]) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"
LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  format(fname,sizeof(fname),dini_Get(fname,key));
  return fname;
}

stock Float:udb_UserFloat(nickname[],key[]) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"
LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_Float(fname,key);
}

stock udb_UserInt(nickname[],key[]) {
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"
LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  return dini_Int(fname,key);
}
stock udb_Create(nickname[])
{
  if (udb_Exists(nickname)) return false;
  new fname[MAX_STRING];
  format(fname,sizeof(fname),"
LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  dini_Create(fname);
  return true;
}

stock udb_RenameUser(nickname[],newnick[]) {
  new oldfname[MAX_STRING];
  new newfname[MAX_STRING];
  format(oldfname,sizeof(oldfname),"
LuxAdmin/Accounts/%s.sav",udb_encode(nickname));
  format(newfname,sizeof(newfname),"
LuxAdmin/Accounts/%s.sav",udb_encode(newnick));
  return frenametextfile(oldfname,newfname);
}

stock strreplace(dest[], source[])
{
    new count = strlen(source);
    for(new i = 0; i < count; i++)
    {
        dest[i] = source[i];
    }
    dest[count] = 0;
}
Reply
#10

Sorry for being such a noob, but I have these errors as well:

pawn Код:
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\dutils.inc(22) : error 017: undefined symbol "MAX_PLAYERS"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(168) : warning 203: symbol is never used: "ret_memcpy"
C:\Users\Graham\Desktop\GTA - San Andreas\samp03e_svr_win32\pawno\include\ldudb.inc(168) : error 013: no entry point (no public functions)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)