Raised This Month: $170 Target: $400
 42% 

Solved [HELP] Plugin Failing to Compile Without Errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wanderlost
Junior Member
Join Date: Apr 2018
Old 06-14-2018 , 14:54   [HELP] Plugin Failing to Compile Without Errors
Reply With Quote #1

Hi there!

I'm working on a plugin at the moment and I've been familiarizing myself well as I can with Sourcemod/Sourcepawn. I've just tried to add a rather complicated feature to my plugin that handles an array, uses multiple loops, and uses a ton of conditionals. I thought I did everything right, but when I went to compile, it did this:



The local compiler threw this error:



Here's the block of code I've added since the last time I compiled successfully. It's for a half-satirical Sonic gamemode that handles 7 "Chaos Emeralds" that change hands when somebody gets a kill, which handles 2 global variables called steEmeralds[7], which is supposed to be an array of 7 integers (one for each emerald), and steEmScatter, which is an integer used to handle the number of "Chaos Emeralds" that are not currently "held."
Spoiler


Edit: Oh! I should clarify, steMode is called on the player_spawn event, and steMode2 is called on the player_death event.

Any help or suggestions that could get this to compile correctly would be appreciated.
Thank you.

Last edited by Wanderlost; 06-16-2018 at 10:43. Reason: Found and fixed more errors.
Wanderlost is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 06-14-2018 , 22:27   Re: [HELP] Plugin Failing to Compile Without Errors
Reply With Quote #2

It's hard to say since you don't provide the full source, but there's probably at least a bug in the compiler. The end result is it stops instead of reporting any of the errors in your code.

I think this is the problem that trips up the compiler: for {int steNum5 = 0; steNum5 <= 6; steNum5++)

You have an open brace instead of open parenthesis.

There are multiple other mistakes.
  • steEmeralds[] = {0, 0, 0, 0, 0, 0, 0}; should not have brackets, assuming steEmeralds is something like int steEmeralds[7].
  • You can't use FindValueInArray on a basic array, only ArrayLists.
  • else if (steEmNum > 1) should probably be steEmNum1 (or 2).
  • PrintToChatAll("%s stole %i Chaos Emeralds from %s!", steKillName, steEmNum2, steVicName"); has an extra closing double quote. The condition it's inside is the bullet immediately previous, so make sure you're printing the right number as well.
  • int steEmNum3 = steEmNum 1 + steEmNum2; should probably be steNum1.
  • int steNextVictim = steEmeralds[steNum4]; should probably have steNextVictim declared above in a higher scope.
  • Some of your strings don't seem to be declared. They're probably missing since it doesn't make much sense to declare them elsewhere.
Fyren is offline
Wanderlost
Junior Member
Join Date: Apr 2018
Old 06-15-2018 , 00:52   Re: [HELP] Plugin Failing to Compile Without Errors
Reply With Quote #3

Wow! Thanks for that. I guess I was sloppier writing this than I thought. I'll use these notes to revise my code and let you know if this fixes it. I appreciate the help.
Wanderlost is offline
Wanderlost
Junior Member
Join Date: Apr 2018
Old 06-16-2018 , 10:42   Re: [HELP] Plugin Failing to Compile Without Errors
Reply With Quote #4

Yeah, reviewing the code with these notes got me to a place where I was able to operate the compiler properly and got it to function. Unfortunately, the gamemode was fundamentally flawed for team death match, but I still appreciate the help, and I archived the functioning code for potential later use.

That being said, you did me a big favor. Thank you again.
Wanderlost is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:06.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode