SA-MP Forums Archive
[Weird Error]Never Before Seen[By Me][Solved] - 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: [Weird Error]Never Before Seen[By Me][Solved] (/showthread.php?tid=105289)



[Weird Error]Never Before Seen[By Me][Solved] - Tigerbeast11 - 28.10.2009

Ok...

Here is the error:
Код:
(1057) : error 054: unmatched closing brace ("}")
And here is the script:

pawn Код:
if(PlayerKills[killerid] == 45)
        {
                SendClientMessage(playerid, COLOR_YELLOW,"You have gotten 45 kills! You can use /weaps to get all the weapons!");
        new PlayerName[MAX_PLAYER_NAME],
                string[128];
                GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "[Spree]%s has gotten 45 kills and has now unlocked all weapons!", PlayerName);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GivePlayerMoney(playerid,1000);

                PlayerKills[playerid] = 0; //Set the murdered's kill count to 0
                PlayerKills[killerid]++; //Set the killer's kill count +1
               }
           }
       }
    } //Line 1057
}
This may be because I am missing a "return 1;", could someone tell me where to put the "return 1;"
If you can help me solve this, I will be very thankful!

Thnks


Re: [Weird Error]Never Before Seen[By Me] - (.Aztec); - 28.10.2009

We're gonna need the whole OnPlayerDeath to determine where you're missing / have an extra bracket.


Re: [Weird Error]Never Before Seen[By Me] - Tigerbeast11 - 28.10.2009

Quote:
Originally Posted by sizeof(Sky));
We're gonna need the whole OnPlayerDeath to determine where you're missing / have an extra bracket.
Of course

Here you go =P
http://pastebin.com/m7ba107a1



Re: [Weird Error]Never Before Seen[By Me] - Tigerbeast11 - 28.10.2009

Any help?

(sorry for bump)


Re: [Weird Error]Never Before Seen[By Me] - dice7 - 28.10.2009

Delete that brace


Re: [Weird Error]Never Before Seen[By Me] - Tigerbeast11 - 28.10.2009

Which brace? Theres loads there! LOL


Re: [Weird Error]Never Before Seen[By Me] - Tigerbeast11 - 28.10.2009

Plus, i think its cuz i missed out the return 1;, but i dont know where to put it...


Re: [Weird Error]Never Before Seen[By Me] - Streetplaya - 28.10.2009

Your indentation is terrible, learn to indent properly. There must be some thread on the forums, search


Quote:
Originally Posted by Tigerbeast11
Which brace? Theres loads there! LOL
The one with the error message I guess??

Quote:
Originally Posted by Tigerbeast11
Plus, i think its cuz i missed out the return 1;, but i dont know where to put it...
No, it should not be caused by that


Re: [Weird Error]Never Before Seen[By Me] - Tigerbeast11 - 28.10.2009

My indentation is correct, it is because all the lines get messed up when i post...

Quote:

Which brace? Theres loads there! LOL
The one with the error message I guess??

I know its the one with the error!! Duh! But which one?



Re: [Weird Error]Never Before Seen[By Me] - SpiderPork - 28.10.2009

Quote:
Originally Posted by Tigerbeast11
I know its the one with the error!! Duh! But which one?
There's only one with the error, right? Duh!

EDIT: And your code will only work if a player does suicide because of this line,
pawn Код:
if(killerid == INVALID_PLAYER_ID)
it should be;
pawn Код:
if(killerid != INVALID_PLAYER_ID)