Simple question regarding enum
#1

I'm trying to do something like...

pawn Код:
enum MapNames
{
    Debug_Plains,
    Testing_Palace
}

CurrentMap = random ( sizeof ( MapNames ) );
printf ( "Map: %d (%s)", CurrentMap, MapNames [ CurrentMap ] );
What is it that I'm doing wrong exactly?
Reply
#2

looks good ?
Reply
#3

Quote:
Originally Posted by Anak
Посмотреть сообщение
looks good ?
Quote:

C:\Users\Sky\Desktop\0.3x\gamemodes\sourcemod.pwn( 46) : error 039: constant symbol has no size
C:\Users\Sky\Desktop\0.3x\gamemodes\sourcemod.pwn( 47) : error 028: invalid subscript (not an array or too many subscripts): "MapNames"
C:\Users\Sky\Desktop\0.3x\gamemodes\sourcemod.pwn( 47) : warning 215: expression has no effect
C:\Users\Sky\Desktop\0.3x\gamemodes\sourcemod.pwn( 47) : error 001: expected token: ";", but found "]"
C:\Users\Sky\Desktop\0.3x\gamemodes\sourcemod.pwn( 47) : error 029: invalid expression, assumed zero

4char.
Reply
#4

pawn Код:
new MapNames[][] =
{
    "Debug_Plains",
    "Testing_Palace",
};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)