Pawn Compiler crashes
#1

Howdy!

I have been searching in my gamemode for over 2 hours now and I couldn't find any solution for this shit, I can't compile my gamemode at all.
I have tried to find a missing brackets but could not find any, I went through SA-MP Forum to find a Missing Brackets program and I found two which worked for me, both of them have the same results:

Code:
The bracket which was Opened at line number 16972 was not closed.

Number of Opening brackets : 7003 
Number of Closing brackets 7002
I went to line 16972 as the program say, but nothing seems fishy, it's all fine:

PHP Code:
CMD:boss(playeridparams[])
{
    new 
string[94], mainstr[256], found 0;
    foreach(new 
Player)
    {
        if(
pTeam[i] != NO_GANG && Info[i][Skills][pTeam[i]] > 5000)
        {
            
found++;
            
format(stringsizeof(string), "{FFFFFF}%s (%d) {%06x)(%d skills)\n"GetName(i), iGetPlayerColor(i) >>> 8Info[i][Skills][pTeam[i]]);
            
strcat(mainstrstring);
        }
    }
    if(
found == 0ShowPlayerDialog(playeridWARNDIALOG_STYLE_MSGBOX"Note""{FF0000}No gangs boss found""Close""");
    else 
ShowPlayerDialog(playeridWARNDIALOG_STYLE_MSGBOX"Gang Boss"string"Close""");
    return 
1;

I removed that command to check out if it's the issue and checked the Missing Brackets program again and the results seemed fine. Tried to compile the gamemode again and it crashed ..

I tried to remove the last things I added. Same shit, crashed.

Any ideas of how I could solve this?
Thanks.
Reply
#2

As always, divide and conquer. Comment half of your gamemode, try to compile - if still crashes comment out half of not commented code. Repeat it until it shows errors and does not crash.
Reply
#3

Try to comment HUGE parts of the script to see which sector is causing it... I think this is the best method...
E: Againg misiur was faster than me )
Reply
#4

Quote:
Originally Posted by Misiur
View Post
As always, divide and conquer. Comment half of your gamemode, try to compile - if still crashes comment out half of not commented code. Repeat it until it shows errors and does not crash.
I tried what you said and it seems like there is something wrong with the OnDialogResponse, when I commented it all it didn't crash the compiler, but it kept compiling without stopping. I tried to comment the half of the callback and the same, compiling without stopping.

Any idea why that happens?
Reply
#5

"Not stopping" is still an invalid compiler state. Try commenting out more until you at least get errors.
Reply
#6

I think the issue is from the compiler itself, I have tried to compile my old gamemode that I released (which absolutely should compile for everyone) and it crashed my compiler, I tried to compile a small gamemodes such as bare and grandlarc and it compiled. I installed the server directory from SA-MP again and used it to compile my gamemode and it crashed again.

That's really weird ..
Reply
#7

I'm 99% certain it's the code. Your old GM might have been missing some includes which causes a lot of errors about missing functions and crashes the compiler. Try commenting 99% of your code, and see if you see any errors instead of a crash/hanging compiler.
Reply
#8

if its from the dialogs (which usually is the case) then i would recommend you use this.
https://github.com/Awsomedude/easyDialog

I once had some problem with the dialogs so i converted all of them to ShowDialog. It is time-consuming but worth a shot.
Reply
#9

Had a similar issue, downloaded Zeex compiler and it worked fine.
Reply
#10

It's the compiler. It would crash for me often, while I would just stop building and then try again. It would eventually compile correctly and completely.

It does not happen anymore however. This was with Zeex's compiler.
Reply
#11

I just found out that the pawncc I had was the Russian one, I thought I had Zeex's compiler.
I replaced it with Zeex's compiler and everything worked fine. I knew it, it was not because of the code!

Thank you guys, much thanks!
Reply
#12

Quote:
Originally Posted by oMa37
Посмотреть сообщение
I just found out that the pawncc I had was the Russian one, I thought I had Zeex's compiler.
I replaced it with Zeex's compiler and everything worked fine. I knew it, it was not because of the code!

Thank you guys, much thanks!
The cause is not the compiler itself... It's a bug or however you want to see it, just keep trying and it will eventually compile. You can try replacing the compiler with a redownloaded version if it doesn't want to give in...

I experienced this issue with Zeex's, and by just keep trying it would eventually stop crashing and correctly compile from there on.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)