compound statement not closed at the end of file
#1

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) {
 }
Reply
#2

Код:
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
Reply
#3

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
Reply
#4

Alright, well post it if you need help figuring it out.
Reply
#5

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
Reply
#6

Goto pastebin and post your whole:

Код:
public OnPlayerCommandText(...)
{
    ...
}
With C syntax highlighting
Reply
#7

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) {
        }
    }
}
Reply
#8

What includes do you have at the top of your script?

You should at least have:

Код:
#include <core>
#include <a_samp>
Reply
#9

Ive got them. It might be easier if I post the whole script
Reply
#10

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...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)