SA-MP Forums Archive
PlayerInfo/AdminLevel - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PlayerInfo/AdminLevel (/showthread.php?tid=589343)



PlayerInfo/AdminLevel - Gogorakis - 18.09.2015

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)



Re: PlayerInfo/AdminLevel - ounce - 18.09.2015

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


Re: PlayerInfo/AdminLevel - J0sh... - 18.09.2015

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.


Re: PlayerInfo/AdminLevel - Gogorakis - 18.09.2015

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
}



Re: PlayerInfo/AdminLevel - jlalt - 18.09.2015

try to add:

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


Re: PlayerInfo/AdminLevel - J0sh... - 18.09.2015

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




Re: PlayerInfo/AdminLevel - Gogorakis - 18.09.2015

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?


Re: PlayerInfo/AdminLevel - J0sh... - 18.09.2015

Your enum has a non capital L on AdminLevel.


Re: PlayerInfo/AdminLevel - saffierr - 18.09.2015

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



Re: PlayerInfo/AdminLevel - J0sh... - 18.09.2015

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