Bemásoltam onnan a login-os és regisztrációs részt, de :
C:\\Users\\Pál Család\\Desktop\\dini.pwn(23) : error 010: invalid function or declaration
C:\\Users\\Pál Család\\Desktop\\dini.pwn(28) : error 021: symbol already defined: \"GetPlayerName\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(30) : error 021: symbol already defined: \"format\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(32) : error 010: invalid function or declaration
C:\\Users\\Pál Család\\Desktop\\dini.pwn(37) : error 010: invalid function or declaration
C:\\Users\\Pál Család\\Desktop\\dini.pwn(39) : error 021: symbol already defined: \"n\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(39) : error 021: symbol already defined: \"file\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(43) : error 010: invalid function or declaration
C:\\Users\\Pál Család\\Desktop\\dini.pwn(45) : error 021: symbol already defined: \"dini_IntSet\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(46) : error 010: invalid function or declaration
C:\\Users\\Pál Család\\Desktop\\dini.pwn(49) : error 010: invalid function or declaration
C:\\Users\\Pál Család\\Desktop\\dini.pwn(50) : error 010: invalid function or declaration
C:\\Users\\Pál Család\\Desktop\\dini.pwn(85) : error 010: invalid function or declaration
C:\\Users\\Pál Család\\Desktop\\dini.pwn(125) : error 010: invalid function or declaration
C:\\Users\\Pál Család\\Desktop\\dini.pwn(126) : warning 203: symbol is never used: \"cmd\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(126) : warning 203: symbol is never used: \"dcmd_login\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(126) : warning 203: symbol is never used: \"dcmd_register\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(126) : warning 203: symbol is never used: \"file\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(126) : warning 203: symbol is never used: \"idx\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(126) : warning 203: symbol is never used: \"n\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(126) : warning 203: symbol is never used: \"ret_memcpy\"
C:\\Users\\Pál Család\\Desktop\\dini.pwn(126) : warning 203: symbol is never used: \"strtok\"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
14 Errors.
És így másoltam be:
#include <a_samp>
#include <dini>
#include <zcmd>
#define GREY 0xAFAFAFAA
#define GREEN 0x33AA33AA
#define YELLOW 0xFFFF00AA
#define WHITE 0xFFFFFFAA
#define LIGHTBLUE 0x33CCFFAA
#define ORANGE 0xFF9900AA
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == \'\\0\') && (dcmd_%1(playerid, \"\"))) || (((%3)[(%2) + 1] == \' \') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
enum gPInfo
{
Logged,
Regged,
Level
};
new PInfo[MAX_PLAYERS][gPInfo];
PInfo[playerid][Logged] = 0;
PInfo[playerid][Regged] = 0;
PInfo[playerid][Level] = 0;
new n[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid,n,sizeof(n));
format(file,sizeof(file),\"MyAdmin/Users/%s.txt\",n);
if(!dini_Exists(file))
{
SendClientMessage(playerid,LIGHTBLUE,\"You are not registered, Please /register!\");
PInfo[playerid][Regged] = 0;
PInfo[playerid][Logged] = 0;
return 1;
}
new n[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid,n,sizeof(n));
format(file,sizeof(file),\"MyAdmin/Users/%s.txt\",n);
PInfo[playerid][Logged] = 0;
if(dini_Exists(file))
{
dini_IntSet(file,\"Logged\",0);
return 1;
}
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
dcmd(register,8,cmdtext);
dcmd_register(playerid,params[])
{
new file[256],n[MAX_PLAYER_NAME];
GetPlayerName(playerid,n,MAX_PLAYER_NAME);
format(file,sizeof(file),\"MyAdmin/Users/%s.txt\",n);
if(dini_Exists(file)) return SendClientMessage(playerid,YELLOW,\"You are already registered!\");
if(PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,LIGHTBLUE,\"You are already registered!\");
if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,ORANGE,\"You are already registered, and logged in!\");
if(strlen(params))
{
if(!dini_Exists(file))
{
dini_Create(file);
dini_Set(file,\"Password\",params);
dini_IntSet(file,\"Regged\",1);
dini_IntSet(file,\"Logged\",0);
dini_IntSet(file,\"Level\",0);
SendClientMessage(playerid,LIGHTBLUE,\"Congratulations, you have just registered, please /login\");
PInfo[playerid][Regged] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid,GREY,\"USAGE: /register <Password>\");
return 1;
}
return 1;
}
dcmd(login,5,cmdtext);
dcmd_login(playerid,params[])
{
new file[256],n[MAX_PLAYER_NAME];
GetPlayerName(playerid,n,MAX_PLAYER_NAME);
format(file,sizeof(file),\"MyAdmin/Users/%s.txt\",n);
if(!dini_Exists(file)) return SendClientMessage(playerid,YELLOW,\"You are not registered! Please /register\");
if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,LIGHTBLUE,\"You are already logged in!\");
if(PInfo[playerid][Regged] == 0) return SendClientMessage(playerid,ORANGE,\"You are not registered! Please /register\");
if(strlen(params))
{
new pass[256];
pass = dini_Get(file,\"Password\");
if(dini_Exists(file))
{
if(strcmp(params,pass,false) != 0)
{
SendClientMessage(playerid,YELLOW,\"Wrong Password!\");
}
else
{
dini_IntSet(file,\"Logged\",1);
PInfo[playerid][Logged] = 1;
PInfo[playerid][Level] = dini_Int(file,\"Level\");
SendClientMessage(playerid,YELLOW,\"You have now logged in!\");
return 1;
}
}
}
else
{
SendClientMessage(playerid,GREY,\"USAGE: /login <Password>\");
return 1;
}
return 1;
}
dcmd(setlevel,8,cmdtext);
HELP ME
Dupla hozzászólás automatikusan összefûzve. ( 2012. június 20. - 14:13:10 )
próbáltam így is:
#include <a_samp>
#include <dini>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == \'\\0\') && (dcmd_%1(playerid, \"\"))) || (((%3)[(%2) + 1] == \' \') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define GREY 0xAFAFAFAA
#define GREEN 0x33AA33AA
#define YELLOW 0xFFFF00AA
#define WHITE 0xFFFFFFAA
#define LIGHTBLUE 0x33CCFFAA
#define ORANGE 0xFF9900AA
enum gPInfo
{
Logged,
Regged,
Level
};
new PInfo[MAX_PLAYERS][gPInfo];
public OnPlayerConnect(playerid)
{
PInfo[playerid][Logged] = 0;
PInfo[playerid][Regged] = 0;
PInfo[playerid][Level] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
dcmd(register,8,cmdtext);
new n[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid,n,sizeof(n));
format(file,sizeof(file),\"MyAdmin/Users/%s.txt\",n);
if(dini_Exists(file))
{
SendClientMessage(playerid,LIGHTBLUE,\"You are registered, Please /login!\");
PInfo[playerid][Regged] = 1;
PInfo[playerid][Logged] = 0;
return 1;
}
if(!dini_Exists(file))
{
SendClientMessage(playerid,LIGHTBLUE,\"You are not registered, Please /register!\");
PInfo[playerid][Regged] = 0;
PInfo[playerid][Logged] = 0;
return 1;
}
new n[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid,n,sizeof(n));
format(file,sizeof(file),\"MyAdmin/Users/%s.txt\",n);
PInfo[playerid][Logged] = 0;
if(dini_Exists(file))
{
dini_IntSet(file,\"Logged\",0);
return 1;
}
dcmd_register(playerid,params[])
{
new file[256],n[MAX_PLAYER_NAME];
GetPlayerName(playerid,n,MAX_PLAYER_NAME);
format(file,sizeof(file),\"MyAdmin/Users/%s.txt\",n);
if(dini_Exists(file)) return SendClientMessage(playerid,YELLOW,\"You are already registered!\");
if(PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,LIGHTBLUE,\"You are already registered!\");
if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,ORANGE,\"You are already registered, and logged in!\");
if(strlen(params))
if(!dini_Exists(file))
{
dini_Create(file);
dini_Set(file,\"Password\",params);
dini_IntSet(file,\"Regged\",1);
dini_IntSet(file,\"Logged\",0);
dini_IntSet(file,\"Level\",0);
SendClientMessage(playerid,LIGHTBLUE,\"Congratulations, you have just registered, please /login\");
PInfo[playerid][Regged] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid,GREY,\"USAGE: /register <Password>\");
return 1;
}
return 1;
}
dcmd(login,5,cmdtext);
dcmd_login(playerid,params[])
{
new file[256],n[MAX_PLAYER_NAME];
GetPlayerName(playerid,n,MAX_PLAYER_NAME);
format(file,sizeof(file),\"MyAdmin/Users/%s.txt\",n);
if(!dini_Exists(file)) return SendClientMessage(playerid,YELLOW,\"You are not registered! Please /register\");
if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,LIGHTBLUE,\"You are already logged in!\");
if(PInfo[playerid][Regged] == 0) return SendClientMessage(playerid,ORANGE,\"You are not registered! Please /register\");
if(strlen(params))
{
new pass[256];
pass = dini_Get(file,\"Password\");
if(dini_Exists(file))
{
if(strcmp(params,pass,false) != 0)
{
SendClientMessage(playerid,YELLOW,\"Wrong Password!\");
}
else
{
dini_IntSet(file,\"Logged\",1);
PInfo[playerid][Logged] = 1;
PInfo[playerid][Level] = dini_Int(file,\"Level\");
SendClientMessage(playerid,YELLOW,\"You have now logged in!\");
return 1;
}
}
}
else
{
SendClientMessage(playerid,GREY,\"USAGE: /login <Password>\");
return 1;
}
return 1;
}
És így is:
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(31) : error 017: undefined symbol \"dcmd_register\"
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(50) : warning 217: loose indentation
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(50) : error 021: symbol already defined: \"n\"
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(59) : warning 217: loose indentation
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(59) : error 017: undefined symbol \"dcmd_register\"
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(60) : warning 217: loose indentation
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(61) : warning 219: local variable \"file\" shadows a variable at a preceding level
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(61) : warning 219: local variable \"n\" shadows a variable at a preceding level
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(67) : error 017: undefined symbol \"params\"
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(71) : warning 217: loose indentation
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(71) : error 017: undefined symbol \"params\"
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(80) : warning 217: loose indentation
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(80) : error 029: invalid expression, assumed zero
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(85) : warning 225: unreachable code
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(87) : error 010: invalid function or declaration
C:\\Users\\Pál Család\\Desktop\\regteszt.pwn(124) : warning 203: symbol is never used: \"dcmd_login\"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase