Can any one see where im going wrong
by blobby · 2007-08-19 · 16 replies · 1560 views · 5 downloads
From the first post
rn
rnSo after alot of annoyance i have finally got round to doing my stats sounds so if one of you lovely pro scripters would look at the following code for me and maby try and figure out why this isn't compiling for me the compile errors i get is
rn
rn/home/groups/amxmodx/tmp3/phpr9CWd6.sma(109) : error 018: initialization data exceeds declared size
rn/home/groups/amxmodx/tmp3/phpr9CWd6.sma(161) : error 018: initialization data exceeds declared size
rn
rnNow i dont know what that actually means so if any one can help me here is the code and also if you could check and see if the sounds i have added will play in game
Archived builds from the server loose
These compiled builds sat loose in the server's script folder rather than attached to a post. They are matched to this release by comparing their decompiled Pawn against the source published above, so treat the attribution as strong but not certain. Versions come from the register_plugin() call recovered from the bytecode.
| stats.amxx | v1.01 | 32 KB | Download | |
| stats_113.amxx | v1.01 | 32 KB | Download | |
| stats.sma | Plugin Source | 32 KB | Download Compile | |
| stats.zip | Archive | 40 KB | Download | |
| stats_187.sma | Plugin Source | 32 KB | Download Compile | |
| stats_207.sma | Plugin Source | 32 KB | Download Compile | |
| stats_210.sma | Plugin Source | 32 KB | Download Compile |
Added later in the thread
| statssounds.sma | Plugin Source | 1 KB | 1 dl | Download Compile |
| stats.sma | Plugin Source | 33 KB | 1 dl | Download Compile |
| stats.sma | Plugin Source | 33 KB | 2 dl | Download Compile |
| stats_dod.txt | Config / Docs | 50 KB | Download | |
| statssounds.sma | Plugin Source | 1 KB | 1 dl | Download Compile |
The thread
All 17 posts from 3 people on Can any one see where im going wrong, kept as they were written.
Threads: 47
Joined: Apr 2007
Well hello all lolrnrnSo after alot of annoyance i have finally got round to doing my stats sounds so if one of you lovely pro scripters would look at the following code for me and maby try and figure out why this isn't compiling for me the compile errors i get isrnrn/home/groups/amxmodx/tmp3/phpr9CWd6.sma(109) : error 018: initialization data exceeds declared sizern/home/groups/amxmodx/tmp3/phpr9CWd6.sma(161) : error 018: initialization data exceeds declared sizernrnNow i dont know what that actually means so if any one can help me here is the code and also if you could check and see if the sounds i have added will play in game
Threads: 47
Joined: Apr 2007
Ok how do i post my code it says that there are too many charactors in the file :( nnRegardsnnBlobby
Threads: 15
Joined: Jun 2007
okay, i corrected the errors:rnrnthe problem in the statssounds.sma was just a warning that yourndon't have the code indented properly, that doesn't look nice butrnthe plugin compiles and works.rnrnthere's a few problems within your stats.sma:rnrn1. problem on line 89:rn
new g_Sounds[7][] = {rnthe variable had to store 7 sounds by default, as you added 4 soundsrnit has to store 11 now. Furthermore the comma after the last sound namernhas to be removed, otherwise you tell the plugin that another sound willrnfollow after that.rnrnso killing those 2 bugs it will look like this:rnnew g_Sounds[11][] = { rn "multikill", rn "ultrakill", rn "killingspree", rn "rampage", rn "unstoppable", rn "monsterkill", rn "ludacrisskill",rn "megakill",rn "godlike",rn "wickedsick",rn "holyshit"rn}rnrnrnrn2. problem on line 145:rnnew g_DoubleKillSound[3][] = {rnhas to be new g_DoubleKillSound[7][] = {rnthe variable had to store 3 sounds by default, as you added 4 soundsrnit has to store 7 now. Furthermore the comma after the last sound namernhas to be removed, otherwise you tell the plugin that another sound willrnfollow after that.rnrnso killing those 2 bugs it will look like this:rnnew g_DoubleKillSound[7][] = {rn "doublekill",rn "multikill",rn "ludacrisskill",rn "megakill",rn "wickedsick",rn "godlike",rn "holyshit"rn}rnrnrnlast problem is: your sounds won't be played at all!rnThe plugin is coded the way it only plays upto 7 sounds,rnyou will have to change some lines to make it play all of your sounds!rnrnon line 659:rnif ( (a >>= 1) > 6 ) a = 6rnhas to be if ( (a >>= 1) > 10 ) a = 10rn"a" is the number of the sound that has to be played.rnyou enumerated the sounds with the function (problem 1), sorn"multikill" is sound #0 (a == 0 --> "multikill") up to a == 10 --> "holyshit". rnrnto be honest i haven't looked through the complete code as i never reallyrnwas interested in the stats/statssounds, try it and let me know if your soundsrnare all played.rnif so, lucky you, if not, let me know and i'll see if i can get some time to get through that big bunch of code.rnrnby the way, there will be no hudmessages that announce your sounds,rnthey will just be played!Threads: 47
Joined: Apr 2007
Lol now i feel really dumb lol thanks so much feuersturm m8 much appreciated m8nnThanks and regardsnnBlobby
Threads: 47
Joined: Apr 2007
Ok i have installed this on to my server and all is good but it only plays one of the new sounds witch is ludacrisskill and then it dosent play any more sounds after that ive browsed over it to see if could spot any thing but i couldn't see anything out of place so i wounded if you would maby look and see if you can see any problems with the sounds playing for me feuersturm any help will be much appreciatednnRegardsnnBlobbynn=[
Threads: 47
Joined: Apr 2007
Ok ive just spotted if you have seen the stats plugin has its own menu and in it you can turn on and off the sounds you want and dont want well i have just spotted that all the sounds that i have added are set as off and when i try and turn them on it just closes the menu =[ Do you know what maby could cause thisnnRegardsnnBlobby
Threads: 15
Joined: Jun 2007
basically the menu should have nothing to do with your standard sounds,rnbut it could be that it's dynamically generated, so i'll have a look at that.rnbut then i don't know why one of your sounds should be played but not the rest?!rnrni'll try to get some time to look at it tomorrow after work, i'm a bit busy at the moment, sorry to let you wait.
Threads: 47
Joined: Apr 2007
Oooo man have i been busy ive just got a new job on a building site and its like mayhem lol but im still doing bits and bobs when i can dont worrie aboyut the wait m8 i would rather wait and have it work than it not work :pnnRegardsnnnBlobby
Threads: 47
Joined: Apr 2007
Ok i think i have found the problem but i dont know where to start to fix it basicly when i complie it i get thisnn/home/groups/amxmodx/tmp3/phpviSAMX.sma(122) : error 001: expected token: "}", but found "-string-"n/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "HolyShit"n/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "HolyShitSound"n/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "LudacrissKill"n/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "LudacrissKillSound"n/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "MegaKill"n/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "MegaKillSound"n/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "WickedSick"n/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "WickedSickSound"nnAnd im guessing this is because in the code i can see this for all the other soundsn
n if ( KillingStreak || KillingStreakSound ){ n g_streakKills[ killer ][ 0 ]++n g_streakKills[ killer ][ 1 ] = 0n new a = g_streakKills[ killer ][ 0 ] - 3n if ( (a > -1) && !( a % 2 ) ) {n if ( (a >>= 1) > 10 ) a = 10n if ( KillingStreak ){n set_hudmessage(0, 100, 255, 0.05, 0.55, 2, 0.02, 6.0, 0.01, 0.1, -1)n for (new i=1;i<=get_maxplayers();i++){n if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )n continuen ShowSyncHudMsg(i, g_left_sync, "%L",i,g_KillingMsg[ a ], killer_name) n }n }n if ( KillingStreakSound ) client_cmd( 0 , "spk misc/%s" , g_Sounds[ a ] )nnnnI dont know if im fully correct but im guessing i need to add the following code for the other sounds to make them work if any one can help it would be greatnnRegardsnnBlobbynnP.S Ive also added messages to the language file for each sound so if you could also tell me how i get those to be displayed =]Threads: 75
Joined: Jun 2006
Well blobby, first in my books if you have coded this piece of work, you need to adopt a better habit for you white space. As I have said many times, gone are the days when white space took up memory in both the c and exe. Here is the best way from my point of view to space out your programming projects, for 2 reasons, its easy to see where the curly braces are and are not, and shows a defined start and finish to things, as well its much neater for others to be able to read:nn
if(KillingStreak || KillingStreakSound)n{ n g_streakKills[killer][0]++n g_streakKills[killer][1] = 0n new a = g_streakKills[killer][0] - 3n n if((a > -1) && !(a % 2)) n {n if((a >>= 1) > 10) n a = 10nn if(KillingStreak)n {n set_hudmessage(0, 100, 255, 0.05, 0.55, 2, 0.02, 6.0, 0.01, 0.1, -1)nn for(new i = 1; i <= get_maxplayers(); i++)n {n if(g_Killers[i][0] && g_DeathStats[i] > get_gametime())n continuen n ShowSyncHudMsg(i, g_left_sync, "%L",i,g_KillingMsg[a], killer_name) n }n [COLOR=Black]}[/COLOR]n n if(KillingStreakSound) n client_cmd(0, "spk misc/%s", g_Sounds[a])n [COLOR=Red]}[/COLOR][COLOR=Red] // MISSING[/COLOR]n[COLOR=Red]} // MISSING[/COLOR]Now, first thing about this, I believe because the 2 missing curly braces are there the remainder of the file wasn't read. And this is most likely the only error here, however, I would need to be able to see the whole file so I can figure out where the line numbers are located, if this is the are where the following is, then were good:nn/home/groups/amxmodx/tmp3/phpviSAMX.sma(122) : error 001: expected token: "}", but found "-string-"Notice the 122, that is line number in the sma file where the first error occurred. Let me know if this little bit helps.nnCheers!
Threads: 47
Joined: Apr 2007
Hi there zor well the plugin was scripted by sidluke but ive asked around and every one seems to think he no longer does any thing for amx so i cant get in contact with him to ask him the best way to add my sounds so they work. Im new to making plugins so im finding it kinda tuff to do but im ploding on ok at the moment i see what your saying with setting the code out its much easier to understand whats happening. I would be able to attach the file but i think ive had the right to post attachments taken away for some reason Umm if it is possible could i have this back pretty please :p thanks for you help zor im going to have a look at this nownnRegardsnnBlobby
Threads: 47
Joined: Apr 2007
Boo hoo Please help me im still not having any joy with this at allnnRegardsnnBlobby
Threads: 47
Joined: Apr 2007
I still haven't got this working :p did you ever get chance to look at this FeuerSturm i was just wondering that was allrnrnRegardsrnrnBlobby
Threads: 75
Joined: Jun 2006
Ok, I allowed attachments to the scripting help forum, this way you can post your difficulty and someone can look at it.nnCheers!
Threads: 47
Joined: Apr 2007
Thnaks zor i will post this up now
Threads: 47
Joined: Apr 2007
I have here attached the stats sma files and the language file if any one has time just to give this a thorough look over. The reason im asking is only one of my new sounds seem to play and it has replaced godlike if any one can see whats the matter or just show me via here so i can get this working that would be greatrnrnRegardsrnrnBlobby
Threads: 47
Joined: Apr 2007
Feuersturm did you ever get chance to look over this for me ??? or if any one else can help me out here it would be much appreciated nnRegardsnnBlobby

