#1

Код:
  	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.
4 Errors.
Reply
#2

Can one correct it?
Reply
#3

Quote:
Originally Posted by AzTeCaS
Посмотреть сообщение
Can one correct it?
Looks like your having an typo, or just haven't defined AdminLevel at all.
Reply
#4

one Correct it please
Reply
#5

Quote:
Originally Posted by ******
Посмотреть сообщение
pawn Код:
if(adminlevel[i] <= 3 && adminlevel[i] <= 5 )
Just out of interest - when can a number be less than 6 but not less than 4?
Epic fail.


pawn Код:
new adminlevel[ MAX_PLAYERS ];
Reply
#6

Код:
  	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.
Reply
#7

Quote:
Originally Posted by AzTeCaS
Посмотреть сообщение
Код:
  	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.
Discussion forum topic, not request / ' please ammagahhhhd fix my code plzplzplz '.
At least read the code before you copy paste it so your sure you get everything needed.
Reply
#8

Код:
    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
Reply
#9

Quote:
Originally Posted by AzTeCaS
Посмотреть сообщение
Код:
    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
Have a nice day. I'm out.
Reply
#10

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
Have a nice day. I'm out.
Agree.

new EightChar[LazyBastardzzzz];
Reply
#11

please Correct last problem
Reply
#12

yes i hav the dini includes
Reply
#13

hehe AzTeCaS your a funny guy ... this gives me a good start in the morning over some good ole Hot coffee thanks for the Morning News..
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)