#include <a_samp>
#include <dudb>
#include <Dini>
#include <dutils>
new PlayerName[MAX_PLAYER_NAME];
public OnPlayerConnect(playerid)
{
new formatZ[256];
new pName[MAX_PLAYER_NAME];
new string[48];
format(formatZ,sizeof(formatZ),"%s.txt",PlayerName(playerid));
if(!udb_Exists(formatZ))
{
udb_Create(formatZ,"209010");
}
License[playerid] = dUserINT(formatZ).("License");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new formatZ2[256];
new p[MAX_PLAYER_NAME];
new string[56];
format(formatZ2,sizeof(formatZ2),"%s.txt",PlayerName(playerid));
dUserSetINT(formatZ2).("License",License[playerid]);
return 1;
}
C:\Documents and Settings\Eduarth\Desktop\pp.pwn(54) : error 012: invalid function call, not a valid address
C:\Documents and Settings\Eduarth\Desktop\pp.pwn(54) : warning 215: expression has no effect
C:\Documents and Settings\Eduarth\Desktop\pp.pwn(54) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Eduarth\Desktop\pp.pwn(54) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Eduarth\Desktop\pp.pwn(54) : fatal error 107: too many error messages on one line
dUserSetINT(formatZ2).("License",License[playerid]);
pawn Код:
|
#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;
}