Enums are freaking me out
#1

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.
Reply
#2

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)
Reply
#3

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;
Reply
#4

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
Reply
#5

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!!
Reply
#6

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
Reply
#7

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
Код:
:picard:
it's simplier
Reply
#8

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
Reply
#9

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];
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)