19.03.2011, 11:37
Hey guys, i get this erros:
In this code:
Error lines:
Exacly in:
Thanks very much!
Код:
C:\Users\Ricardo\Desktop\Mini-DM\Mini-DM\Freedoom\filterscripts\adminric.pwn(26) : error 017: undefined symbol "file" C:\Users\Ricardo\Desktop\Mini-DM\Mini-DM\Freedoom\filterscripts\adminric.pwn(26) : error 017: undefined symbol "file" C:\Users\Ricardo\Desktop\Mini-DM\Mini-DM\Freedoom\filterscripts\adminric.pwn(26) : error 029: invalid expression, assumed zero C:\Users\Ricardo\Desktop\Mini-DM\Mini-DM\Freedoom\filterscripts\adminric.pwn(26) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
pawn Код:
#include <a_samp>
#include <dini>
#include <dudb>
#include <zcmd>
#include <sscanf>
new IsLogged[MAX_PLAYERS];
new gLogged[MAX_PLAYERS];
new gRegistred[MAX_PLAYERS];
enum pInfo
{
AdminLevel,
Cash,
Score,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
COMMAND:register(playerid, params[])
{
new name[MAX_PLAYER_NAME];
new id;
GetPlayerName(playerid, name, sizeof(name));
if(!sscanf(params, "u", id))
{
format(file,sizeof(file),"/RicAdmin/users/%s.ini",name);
if(!fexist(file))
{
dini_Create(file);
dini_IntSet(file,"Password", udb_hash(tmp));
dini_IntSet(file,"AdminLevel", 0);
dini_IntSet(file,"Cash", 0);
dini_IntSet(file,"Score", 0);
SendClientMessage(playerid, eadmin, "[System]: Account Created!");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
GetPlayerName(playerid, name, sizeof(name));
printf("%s has registered a account!", name);
}
else
{
SendClientMessage(playerid, COLOR, " Account Already Found In Database");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
return 1;
}
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /register [password]");
}
COMMAND:login(playerid, params[])
{
new PlayerName[24];
if(!sscanf(params, "u", id))
{
new name[MAX_PLAYER_NAME];
if(IsLogged[playerid] == 1)
{
else
{
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"%s.ini",name);
if(fexist(file))
{
tmp2 = dini_Get(file, "Password");
if(udb_hash(tmp) != strval(tmp2))
{
SendClientMessage(playerid, COLOR, "Login Failed!");
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
printf("%s has failed to login", name);
else
{
IsLogged[playerid] = 1;
SetPlayerMoney(playerid, dini_Int(file, "Cash"));
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
SendClientMessage(playerid, COLOR, "[System]: Account Logged into!");
}
}
}
}
}
else return SendCLientMessage(playerid, 0xFFFFFFFF, "You already are logged in!");
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /login [password]");
}
public OnPlayerDisconnect(playerid)
{
IsLogged[playerid] = 0;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(gLogged[playerid] == 0)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER:Use /login [password] to save your stats!");
return 1;
}
return 1;
}
public OnPlayerConnect(playerid)
{
if(gRegistred[playerid] == 1)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Use /login to login into your account!");
return 1;
}
if(gRegistred[playerid] == 0)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Use /register to register your account!");
return 1;
}
return 1;
}
pawn Код:
COMMAND:register(playerid, params[])
{
new name[MAX_PLAYER_NAME];
new id;
GetPlayerName(playerid, name, sizeof(name));
if(!sscanf(params, "u", id))
{
format(file,sizeof(file),"/RicAdmin/users/%s.ini",name);
if(!fexist(file))
{
dini_Create(file);
dini_IntSet(file,"Password", udb_hash(tmp));
dini_IntSet(file,"AdminLevel", 0);
dini_IntSet(file,"Cash", 0);
dini_IntSet(file,"Score", 0);
SendClientMessage(playerid, eadmin, "[System]: Account Created!");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
GetPlayerName(playerid, name, sizeof(name));
printf("%s has registered a account!", name);
}
else
{
SendClientMessage(playerid, COLOR, " Account Already Found In Database");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
return 1;
}
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /register [password]");
}
pawn Код:
format(file,sizeof(file),"/RicAdmin/users/%s.ini",name);