21.12.2011, 20:20
I am kind of stuck right now. I got an enum which handles all the variables for a map, and some of those variables are in charge of some dynamic pickups.
In my case, I am using Incognito's Streamer Plugin and this is how the code looks like, which is not working:
Error:
(Sorry, but I can't really interpret this error message)
This kind of confuses me, since this code does work:
That's how the variable looks like inside the enum:
Shouldn't switch behave the same with integers like if?
In my case, I am using Incognito's Streamer Plugin and this is how the code looks like, which is not working:
pawn Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
switch(pickupid)
{
case MapInfo[currentMap][mGoal]:
{
//Something happens here
}
}
return 1;
}
Код:
error 008: must be a constant expression; assumed zero
This kind of confuses me, since this code does work:
pawn Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
if(pickupid == MapInfo[currentMap][mGoal])
{
}
return 1;
}
That's how the variable looks like inside the enum:
pawn Код:
enum MY_ENUM
{
...
mGoal,
...
};
Shouldn't switch behave the same with integers like if?