PlayerInfo/AdminLevel
#1

I'm a newbie lol. What's the prob here? (I copy-pasted it from somewhere)

Код:
C:\Users\Administrator\Desktop\test\gamemodes\Untitled.pwn(449) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
C:\Users\Administrator\Desktop\test\gamemodes\Untitled.pwn(449) : warning 215: expression has no effect
C:\Users\Administrator\Desktop\test\gamemodes\Untitled.pwn(449) : error 001: expected token: ";", but found "]"
C:\Users\Administrator\Desktop\test\gamemodes\Untitled.pwn(449) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\test\gamemodes\Untitled.pwn(449) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Line:
Код:
				if(PlayerInfo[i][AdminLevel] >= 1 && PlayerInfo[i][AdminLevel] < 6)
Reply
#2

Код:
if(PlayerInfo[i][AdminLevel] == 1 && PlayerInfo[i][AdminLevel] == 6)
Try this.
Reply
#3

Quote:
Originally Posted by ounce
Посмотреть сообщение
Код:
if(PlayerInfo[i][AdminLevel] == 1 && PlayerInfo[i][AdminLevel] == 6)
Try this.
Nonononono. If AdminLevel is 1 and is AdminLevel 6 do this
Wrong.

Please show your PlayerInfo enum.
Reply
#4

Quote:
Originally Posted by ounce
Посмотреть сообщение
Код:
if(PlayerInfo[i][AdminLevel] == 1 && PlayerInfo[i][AdminLevel] == 6)
Try this.
Same..

Код:
C:\Users\Administrator\Desktop\test\gamemodes\Untitled.pwn(449) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
C:\Users\Administrator\Desktop\test\gamemodes\Untitled.pwn(449) : warning 215: expression has no effect
C:\Users\Administrator\Desktop\test\gamemodes\Untitled.pwn(449) : error 001: expected token: ";", but found "]"
C:\Users\Administrator\Desktop\test\gamemodes\Untitled.pwn(449) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\test\gamemodes\Untitled.pwn(449) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
EDIT: Player enum

Код:
enum PlayerInfo
{
    Pass[129], //User's password
    Adminlevel, //User's admin level
    VIPlevel, //User's vip level
    Armylevel,
    FBIlevel,
    Money, //User's money
    Scores, //User's scores
    Kills, //User's kills
    Deaths //User's deaths
}
Reply
#5

try to add:

PHP код:
enum info
{
AdminLevel
};
new 
PlayerInfo[MAX_PLAYERS][info]; 
in the top after includes
Reply
#6

PHP код:
enum PlayerInfo
{
    
Pass[129], //User's password
    
AdminLevel//User's admin level
    
VIPlevel//User's vip level
    
Armylevel,
    
FBIlevel,
    
Money//User's money
    
Scores//User's scores
    
Kills//User's kills
    
Deaths //User's deaths

Reply
#7

Quote:
Originally Posted by Jamester
Посмотреть сообщение
PHP код:
enum PlayerInfo
{
    
Pass[129], //User's password
    
AdminLevel//User's admin level
    
VIPlevel//User's vip level
    
Armylevel,
    
FBIlevel,
    
Money//User's money
    
Scores//User's scores
    
Kills//User's kills
    
Deaths //User's deaths

isn't it the same?
Reply
#8

Your enum has a non capital L on AdminLevel.
Reply
#9

Quote:
Originally Posted by Jamester
Посмотреть сообщение
Your enum has a non capital L on AdminLevel.
I think that should fix your problem,
Change this
PHP код:
if(PlayerInfo[i][AdminLevel] >= && PlayerInfo[i][AdminLevel] < 6
To
PHP код:
if(PlayerInfo[i][AdminLevel] < && PlayerInfo[i][AdminLevel] < 6
Reply
#10

Quote:
Originally Posted by saffierr
Посмотреть сообщение
I think that should fix your problem,
Change this
PHP код:
if(PlayerInfo[i][AdminLevel] >= && PlayerInfo[i][AdminLevel] < 6
To
PHP код:
if(PlayerInfo[i][AdminLevel] < && PlayerInfo[i][AdminLevel] < 6
What are you trying to do there? If his AdminLevel is smaller than 1, it's gonna be smaller than 6!
I think he just wants to make a command that checks if player is a admin(1) and is level 1 - 5
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)