SA-MP Forums Archive
2 errors with compiling - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 2 errors with compiling (/showthread.php?tid=265812)



2 errors with compiling - wizarddoctor - 02.07.2011

Hello,

I need some help with this script: http://pastebin.com/h3cuaQJf

I get these errors:

Quote:

C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(221) : warning 217: loose indentation
C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(231) : warning 217: loose indentation
C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(242) : warning 217: loose indentation
C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(257) : warning 217: loose indentation
C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(271) : warning 217: loose indentation
C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(273) : error 010: invalid function or declaration
C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(274) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

And I really don't know how to fix these.
Can someone give me some clues? Thx in advance

wizarddoctor.


Re: 2 errors with compiling - Gazmull - 02.07.2011

Too much returns, remove one of them.


Re: 2 errors with compiling - Sasino97 - 02.07.2011

pawn Код:
return 0;
return 0;
... Remove one.


Re: 2 errors with compiling - wizarddoctor - 02.07.2011

Thx, now there is only one error left:

Quote:

C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(221) : warning 217: loose indentation
C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(231) : warning 217: loose indentation
C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(242) : warning 217: loose indentation
C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(257) : warning 217: loose indentation
C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(271) : warning 217: loose indentation
C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(273) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.




Re: 2 errors with compiling - Shadoww5 - 02.07.2011

Indent your code and these errors will disappear.


Re: 2 errors with compiling - wizarddoctor - 02.07.2011

Indent is like this?

Код:
text {
        text  
        }
?


Re: 2 errors with compiling - Shadoww5 - 03.07.2011

This is an indented code:

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/help"true))
    {
        
SendClientMessage(playerid0xFFFFFFFF"SERVER: This is the /help command!");
        return 
1;
    }
    return 
0;

And this not:

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
if(!
strcmp(cmdtext"/help"true))
    {
SendClientMessage(playerid0xFFFFFFFF"SERVER: This is the /help command!");
        return 
1;
}
    return 
0;
    } 



Re: 2 errors with compiling - wizarddoctor - 03.07.2011

Ok, thank you.


Re: 2 errors with compiling - Gazmull - 03.07.2011

Quote:

C:\Users\Michel\Desktop\SA-MP server\gamemodes\script.pwn(273) : error 010: invalid function or declaration

Remove the remaining return.