21.09.2015, 22:19
I have this code which Vince made for me (thanks Vince), for selecting random gamemode and changing it, i'm getting a warning at this line:
warning 224: indeterminate array size in "sizeof" expression (symbol "")
Full code:
Thanks.
warning 224: indeterminate array size in "sizeof" expression (symbol "")
Код:
static const FILE_NAMES[][] = {
Код:
new randomIndex;
static gCurrentIndex = -1;
public ChangeGame(playerid)
{
static const FILE_NAMES[][] = {
"bare",
"barron",
"bandito"
};
do
{
randomIndex = random(sizeof(FILE_NAMES));
}
while(randomIndex == gCurrentIndex);
gCurrentIndex = randomIndex;
new rconCommand[16 + sizeof(FILE_NAMES[])];
format(rconCommand, sizeof(rconCommand), "changemode %s.amx", FILE_NAMES[gCurrentIndex]);
SendRconCommand(rconCommand);
return 1;
}
