PDA

View Full Version : Problem with mini-mode change


MrTinder
22/02/2014, 10:53 AM
Hi.I have problem with compiling this code:

new ServerArea = 1;

public ChangeMode()
{
switch(ServerArea)
{
case 1: ServerArea = "Deathmatch"; //Line with error
}
return 1;
}

error:
error 006: must be assigned to an array

Konstantinos
22/02/2014, 10:57 AM
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.


new ServerArea = 1;
new ServerAreaName[20];

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

LocMax
22/02/2014, 10:57 AM
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 >.>