Enums are freaking me out -
Sellize - 20.01.2013
http://pastebin.com/nP91nWsN
This is freaking me out so bad!
how can i make it so that it will actually just set the isMuted to 1?
the errors i get when compiling my shit:
Код:
C:\Users\x3990.003\Desktop\SELLIZE CNR\filterscripts\essentials.pwn(281) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
C:\Users\x3990.003\Desktop\SELLIZE CNR\filterscripts\essentials.pwn(281) : warning 215: expression has no effect
C:\Users\x3990.003\Desktop\SELLIZE CNR\filterscripts\essentials.pwn(281) : error 001: expected token: ";", but found "]"
C:\Users\x3990.003\Desktop\SELLIZE CNR\filterscripts\essentials.pwn(281) : error 029: invalid expression, assumed zero
C:\Users\x3990.003\Desktop\SELLIZE CNR\filterscripts\essentials.pwn(281) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Enums are freaking me out -
Threshold - 20.01.2013
Can you show us some code please? We need to see it if we're going to fix it.
EDIT: Lol at Vince's response, but I completely agree.
(Double Posts are for noobs)
Re: Enums are freaking me out -
Vince - 20.01.2013
Do you even look at your own script? How can you do it right three times and then fuck it up?
pawn Код:
enum PlayerInfo
{
isMuted,
isJailed,
}
new Info[MAX_PLAYERS][PlayerInfo];
pawn Код:
public OnPlayerConnect(playerid)
{
Info[playerid][isMuted] = 0;
Info[playerid][isJailed] = 0;
return 1;
}
pawn Код:
PlayerInfo[targetid][isMuted] = 1;
Re: Enums are freaking me out -
Sellize - 20.01.2013
Quote:
Originally Posted by Vince
Do you even look at your own script? How can you do it right three times and then fuck it up?
pawn Код:
enum PlayerInfo { isMuted, isJailed, } new Info[MAX_PLAYERS][PlayerInfo];
pawn Код:
public OnPlayerConnect(playerid) { Info[playerid][isMuted] = 0; Info[playerid][isJailed] = 0; return 1; }
pawn Код:
PlayerInfo[targetid][isMuted] = 1;
|
That gave me the same errors my friend
Re: Enums are freaking me out -
Threshold - 20.01.2013
My god... I would search for a picture of a facepalm meme or something, but I am really shocked right now. Literally... in a state of shock...
pawn Код:
PlayerInfo[targetid][isMuted] = 1;
pawn Код:
Info[MAX_PLAYERS][PlayerInfo];
Do you see a difference in these lines?
ITS OBVIOUS, ONE SAYS PLAYERINFO, THE OTHER SAYS INFO!!
Re: Enums are freaking me out -
Sellize - 20.01.2013
Quote:
Originally Posted by BenzoAMG
My god... I would search for a picture of a facepalm meme or something, but I am really shocked right now. Literally... in a state of shock...
pawn Код:
PlayerInfo[targetid][isMuted] = 1;
pawn Код:
Info[MAX_PLAYERS][PlayerInfo];
Do you see a difference in these lines?
ITS OBVIOUS, ONE SAYS PLAYERINFO, THE OTHER SAYS INFO!!
|
Awesome! Oh and i searched it up for you
http://www.******.nl/imgres?um=1&hl=...P6IHYDA&zoom=1
Re: Enums are freaking me out -
InfiniTy. - 20.01.2013
Are you gonna decide what are you gonna use.. ?
PlayerInfo or Info.. lol
You need to use Info .. playerinfo is the name of the enum
@BenzoAMG just use
it's simplier
Re: Enums are freaking me out -
Sellize - 20.01.2013
Quote:
Originally Posted by Adytza.
Are you gonna decide what are you gonna use.. ?
PlayerInfo or Info.. lol
You need to use Info .. playerinfo is the name of the enum
|
But why do I need to use Info while the enum is called PlayerInfo? that's what is bugging me
Re: Enums are freaking me out -
InfiniTy. - 20.01.2013
Quote:
Originally Posted by Sellize
But why do I need to use Info while the enum is called PlayerInfo? that's what is bugging me
|
pawn Код:
enum PlayerInfo
{
isMuted,
isJailed,
}
new Info[MAX_PLAYERS][PlayerInfo];
pawn Код:
new Info[MAX_PLAYERS][PlayerInfo];
==> You need to use Info and not PlayerInfo.. playerinfo is the enum info is the variabile you will use..
You could do this if you want to use PlayerInfo and not Info :
pawn Код:
enum Info
{
isMuted,
isJailed,
}
new PlayerInfo[MAX_PLAYERS][Info];
Re: Enums are freaking me out -
LarzI - 20.01.2013
Quote:
Originally Posted by Sellize
But why do I need to use Info while the enum is called PlayerInfo? that's what is bugging me
|
The enum is what you put into the 2nd dimension in the array "Info", that's why you have to use Info while the enum is called PlayerInfo.