Problem with mini-mode change
#1

Hi.I have problem with compiling this code:

pawn Код:
new ServerArea = 1;

public ChangeMode()
{
    switch(ServerArea)
    {
        case 1: ServerArea = "Deathmatch"; //Line with error
    }
    return 1;
}
error:
pawn Код:
error 006: must be assigned to an array
Reply
#2

You declare a variable as integer and in a public function, you're trying to set a text for it even if it's not an array.

pawn Код:
new ServerArea = 1;
new ServerAreaName[20];

public ChangeMode()
{
    switch(ServerArea)
    {
        case 1: ServerAreaName = "Deathmatch";
    }
    return 1;
}
Reply
#3

ServerArea needs to be an array,

new ServerArea[20];

Adjust the size of the array by your needs.

EDIT: Person above me was faster and more helpful >.>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)