SA-MP Forums Archive
What could be wrong? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What could be wrong? (/showthread.php?tid=300635)



What could be wrong? - Whizion - 01.12.2011

So i have code under OnDialogResponse similar to this:

pawn Код:
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.


Re: What could be wrong? - niels44 - 01.12.2011

show us the errors u get


Re: What could be wrong? - Scenario - 01.12.2011

Quote:

// <- error 021: symbol already defined

He already did...

---

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


Re: What could be wrong? - Whizion - 01.12.2011

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
Is "string[128];" defined anywhere outside of a callback (or if statement)?
Nope, that's why it's so strange. :/


Re: What could be wrong? - MP2 - 01.12.2011

You either have it as a global variable, or a parameter in a callback/function.