if (strcmp(cmdtext, "/admins", true) == 0)
{
new count = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Administrators Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(adminlevel[i] <= 3 && adminlevel[i] <= 5 )
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "%s (ID:%i)", sendername, i);
SendClientMessage(playerid, COLOR_WHITE, string);
count++;
}
}
}
if (count == 0) SendClientMessage(playerid, COLOR_WHITE,"There are no admins online.Try /mods ,If there are any mods online.");
return 1;
}
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(264) : error 017: undefined symbol "adminlevel" C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(264) : warning 215: expression has no effect C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(264) : error 001: expected token: ";", but found "]" C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(264) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(264) : 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 Код:
|
new adminlevel[ MAX_PLAYERS ];
if (strcmp(cmdtext, "/admins", true) == 0)
{
new count = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Administrators Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
new adminlevel[ MAX_PLAYERS ];
{
GetPlayerName(i, sendename, sizeof(sendername));
format(string, 128, "%s (ID:%i)", sendername, i);
SendClientMessage(playerid, COLOR_WHITE, string);
count++;
}
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(266) : error 017: undefined symbol "sendename" C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(266) : error 017: undefined symbol "sendername" C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(266) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(266) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
|
Код:
if (strcmp(cmdtext, "/admins", true) == 0)
{
new count = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Administrators Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
new adminlevel[ MAX_PLAYERS ];
{
GetPlayerName(i, sendename, sizeof(sendername));
format(string, 128, "%s (ID:%i)", sendername, i);
SendClientMessage(playerid, COLOR_WHITE, string);
count++;
}
Код:
C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(266) : error 017: undefined symbol "sendename" C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(266) : error 017: undefined symbol "sendername" C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(266) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrateur\Bureau\BWS\gamemodes\[BWS]Mode.pwn(266) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
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.
|
Код:
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. |