PDA

View Full Version : What could be wrong?


Whizion
01/12/2011, 12:02 PM
So i have code under OnDialogResponse similar to this:


switch(dialogid)
{
case SOME_DIALOG:
{
new string[128];
format(string, sizeof(string), "Hello, your ID is %d." playerid);
SendClientMessage(playerid, COLOR_SOMETHING, string);
}

case SOME_OTHER_DIALOG:
{
new string[128]; // <- error 021: symbol already defined
format(string, sizeof(string), "Hello, your ID is %d." playerid);
SendClientMessage(playerid, COLOR_SOMETHING, string);
}
}


Even if the "new string[128]" is nested under some if's it still returns an error.

What could it be? Please help, thanks.

niels44
01/12/2011, 12:02 PM
show us the errors u get

Scenario
01/12/2011, 12:15 PM
// <- error 021: symbol already defined

He already did...

---

Is "string[128];" defined anywhere outside of a callback (or if statement)?

Whizion
01/12/2011, 12:22 PM
Is "string[128];" defined anywhere outside of a callback (or if statement)?

Nope, that's why it's so strange. :/

MP2
01/12/2011, 12:30 PM
You either have it as a global variable, or a parameter in a callback/function.