compound statement not closed at the end of file -
Jamould - 01.07.2009
Just wondering how I fix this error (1524) : error 030: compound statement not closed at the end of file (started at line 657)
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!IsPlayerConnected(playerid)) return 0;
new string[MAX_STRING];
new cmd[MAX_STRING];
new giveplayerid, moneys, idx, weaponid;
new tmp[MAX_STRING], tmp2[MAX_STRING], tmp3[MAX_STRING];
new Float:x, Float:y, Float:z;
cmd = strtok(cmdtext, idx);
strmid(tmp, cmd, 1, strlen(cmd));
for (new k=0;tmp[k];k++) {
if ('a' <= tmp[k] <= 'z' || 'A' <= tmp[k] <= 'Z' || 0 <= tmp[k] <= 9) {
}
Re: compound statement not closed at the end of file -
ledzep - 01.07.2009
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!IsPlayerConnected(playerid)) return 0;
new string[MAX_STRING];
new cmd[MAX_STRING];
new giveplayerid, moneys, idx, weaponid;
new tmp[MAX_STRING], tmp2[MAX_STRING], tmp3[MAX_STRING];
new Float:x, Float:y, Float:z;
cmd = strtok(cmdtext, idx);
strmid(tmp, cmd, 1, strlen(cmd));
for (new k=0;tmp[k];k++) {
if ('a' <= tmp[k] <= 'z' || 'A' <= tmp[k] <= 'Z' || 0 <= tmp[k] <= 9) {
}
}
}
Closing all your brackets would be a good start.
And I feel obligated to add:
https://sampwiki.blast.hk/wiki/Fast_Commands
Re: compound statement not closed at the end of file -
Jamould - 01.07.2009
Thanks. I know I needed to close my brackets but I wasnt sure where I needed to close them. But this brings up new errors
Re: compound statement not closed at the end of file -
ledzep - 01.07.2009
Alright, well post it if you need help figuring it out.
Re: compound statement not closed at the end of file -
Jamould - 01.07.2009
Thanks.
C:\Program Files\Sa mp\pawno\Gangs.pwn(659 -- 671) : warning 209: function "OnPlayerCommandText" should return a value
C:\Program Files\Sa mp\pawno\Gangs.pwn(659 -- 672) : error 010: invalid function or declaration
C:\Program Files\Sa mp\pawno\Gangs.pwn(659 -- 685) : error 010: invalid function or declaration
C:\Program Files\Sa mp\pawno\Gangs.pwn(659 -- 687) : error 010: invalid function or declaration
C:\Program Files\Sa mp\pawno\Gangs.pwn(659 -- 687) : fatal error 107: too many error messages on one line
Re: compound statement not closed at the end of file -
ledzep - 01.07.2009
Goto pastebin and post your whole:
Код:
public OnPlayerCommandText(...)
{
...
}
With C syntax highlighting
Re: compound statement not closed at the end of file -
Jamould - 01.07.2009
That is the whole Onplayercommand
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!IsPlayerConnected(playerid)) return 0;
new string[MAX_STRING];
new cmd[MAX_STRING];
new giveplayerid, moneys, idx, weaponid;
new tmp[MAX_STRING], tmp2[MAX_STRING], tmp3[MAX_STRING];
new Float:x, Float:y, Float:z;
cmd = strtok(cmdtext, idx);
strmid(tmp, cmd, 1, strlen(cmd));
for (new k=0;tmp[k];k++) {
if ('a' <= tmp[k] <= 'z' || 'A' <= tmp[k] <= 'Z' || 0 <= tmp[k] <= 9) {
}
}
}
Re: compound statement not closed at the end of file -
ledzep - 01.07.2009
What includes do you have at the top of your script?
You should at least have:
Код:
#include <core>
#include <a_samp>
Re: compound statement not closed at the end of file -
Jamould - 01.07.2009
Ive got them. It might be easier if I post the whole script
Re: compound statement not closed at the end of file -
refshal - 01.07.2009
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!IsPlayerConnected(playerid)) return 0;
new string[MAX_STRING];
new cmd[MAX_STRING];
new giveplayerid, moneys, idx, weaponid;
new tmp[MAX_STRING], tmp2[MAX_STRING], tmp3[MAX_STRING];
new Float:x, Float:y, Float:z;
cmd = strtok(cmdtext, idx);
strmid(tmp, cmd, 1, strlen(cmd));
for (new k=0;tmp[k];k++) {
if ('a' <= tmp[k] <= 'z' || 'A' <= tmp[k] <= 'Z' || 0 <= tmp[k] <= 9)
return 1;
}
return 0;
}
EDIT: Not sure...