Код:
if(strcmp(cmdtext, "/register", true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /register [password]");
}
else
{
if (!dini_Exists(udb_encode(playername)))
{
dini_Create(udb_encode(playername));
dini_IntSet(udb_encode(playername), "password", udb_hash(tmp));
dini_IntSet(udb_encode(playername), "adminlevel", 0);
format(string, sizeof(string), "Account %s created! You can now login with /login %s", playername, tmp);
SendClientMessage(playerid, COLOR_YELLOW, string);
adminlevel[playerid] = 0;
}
else
{
format(string, sizeof(string), "%s is already registered.", playername,tmp);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
}
return 1;
}
if(strcmp(cmd, "/login", true) == 0)
{
new tmp[256], tmp2[256];
if(logged[playerid] == -2) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are jailed.");
else
if(logged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are already logged in.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /login [password]");
}
else
{
if (dini_Exists(udb_encode(playername)))
{
tmp2 = dini_Get(udb_encode(playername), "password");
if (udb_hash(tmp) != strval(tmp2))
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "Invalid Password");
}
else
{
logged[playerid] = 1;
format(string, sizeof(string), "%s, you are now logged in .", playername);
SendClientMessage(playerid, COLOR_GREEN, string);
GivePlayerMoney(playerid, money[playerid]);
}
}
else
{
format(string, sizeof(string), "You are not registered Type /register [password] to create an account!", playername);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
}
return 1;
}
Код:
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(261) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(261) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(262) : warning 217: loose indentation
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(264) : error 017: undefined symbol "COLOR_WHITE"
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(268) : error 017: undefined symbol "dini_Exists"
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(270) : error 017: undefined symbol "dini_Create"
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(271) : error 017: undefined symbol "dini_IntSet"
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(272) : error 017: undefined symbol "dini_IntSet"
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(273) : error 017: undefined symbol "string"
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(273) : error 017: undefined symbol "string"
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(273) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(273) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
11 Errors.
ok fix this please