What's wrong with this line?
#1

LINE:
Код:
	  if(!IsPlayerAdmin(playerid)||PlayerInfo[playerid][AdminLevel]<5)return SendClientMessage(playerid,0xFF0000FF,"You're not authorized to use that command");

ERRORS:
Quote:

C:\Users\Administrator\Desktop\KITTENTEST\gamemode s\greekfr.pwn(639) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
C:\Users\Administrator\Desktop\KITTENTEST\gamemode s\greekfr.pwn(639) : warning 215: expression has no effect
C:\Users\Administrator\Desktop\KITTENTEST\gamemode s\greekfr.pwn(639) : error 001: expected token: ";", but found "]"
C:\Users\Administrator\Desktop\KITTENTEST\gamemode s\greekfr.pwn(639) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\KITTENTEST\gamemode s\greekfr.pwn(639) : fatal error 107: too many error messages on one line

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


4 Errors.

ENUM PLAYERINFO
Quote:

enum PlayerInfo
{
Pass[129], //User's password
Adminlevel, //User's admin level
VIPlevel, //User's vip level
Money, //User's money
Scores, //User's scores
Kills, //User's kills
Deaths //User's deaths
}
new pInfo[MAX_PLAYERS][PlayerInfo]; /*This will create a new variable so we can later use it to saving/loading user's info.*/

Reply
#2

pInfo not PlayerInfo here PlayerInfo[playerid][AdminLevel] xD
Reply
#3

new pInfo[MAX_PLAYERS][PlayerInfo]; you have, PlayerInfo[playerid][AdminLevel]<5

I would recommend doing this instead.

pawn Код:
#define CMDLEVEL(%0) if(!IsPlayerAdmin(playerid)|| pInfo[playerid][AdminLevel]< %0) return SendClientMessage(playerid,0xFF0000FF,"You're not authorized to use that command");
Then all you need to do is write, CMDLEVEL(5); much easier when you have a lot of commands.
Reply
#4

Thank you!! Fixed..but..
Quote:

C:\Users\Administrator\Desktop\KITTENTEST\gamemode s\greekfr.pwn(641) : error 017: undefined symbol "AdminLevel"
C:\Users\Administrator\Desktop\KITTENTEST\gamemode s\greekfr.pwn(645) : error 017: undefined symbol "AdminLevel"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

How to "define" them?
Reply
#5

Quote:
Originally Posted by Gogorakis
Посмотреть сообщение
Thank you!! Fixed..but..


How to "define" them?
You haven't yet defined your admin level variable in the script yet...? You should be doing that before commands.
Reply
#6

Lets see those lines
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)