View Full Version : Can any one see where im going wrong
blobby
08-19-2007, 03:23 PM
Well hello all lol
So 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
/home/groups/amxmodx/tmp3/phpr9CWd6.sma(109) : error 018: initialization data exceeds declared size
/home/groups/amxmodx/tmp3/phpr9CWd6.sma(161) : error 018: initialization data exceeds declared size
Now 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
blobby
08-19-2007, 03:24 PM
Ok how do i post my code it says that there are too many charactors in the file :(
Regards
Blobby
FeuerSturm
08-19-2007, 07:46 PM
okay, i corrected the errors:
the problem in the statssounds.sma was just a warning that you
don't have the code indented properly, that doesn't look nice but
the plugin compiles and works.
there's a few problems within your stats.sma:
1. problem on line 89:
new g_Sounds[7][] = {
the variable had to store 7 sounds by default, as you added 4 sounds
it has to store 11 now. Furthermore the comma after the last sound name
has to be removed, otherwise you tell the plugin that another sound will
follow after that.
so killing those 2 bugs it will look like this:
new g_Sounds[11][] = {
"multikill",
"ultrakill",
"killingspree",
"rampage",
"unstoppable",
"monsterkill",
"ludacrisskill",
"megakill",
"godlike",
"wickedsick",
"holyshit"
}
2. problem on line 145:
new g_DoubleKillSound[3][] = {
has to be new g_DoubleKillSound[7][] = {
the variable had to store 3 sounds by default, as you added 4 sounds
it has to store 7 now. Furthermore the comma after the last sound name
has to be removed, otherwise you tell the plugin that another sound will
follow after that.
so killing those 2 bugs it will look like this:
new g_DoubleKillSound[7][] = {
"doublekill",
"multikill",
"ludacrisskill",
"megakill",
"wickedsick",
"godlike",
"holyshit"
}
last problem is: your sounds won't be played at all!
The plugin is coded the way it only plays upto 7 sounds,
you will have to change some lines to make it play all of your sounds!
on line 659:
if ( (a >>= 1) > 6 ) a = 6
has to be if ( (a >>= 1) > 10 ) a = 10
"a" is the number of the sound that has to be played.
you enumerated the sounds with the function (problem 1), so
"multikill" is sound #0 (a == 0 --> "multikill") up to a == 10 --> "holyshit".
to be honest i haven't looked through the complete code as i never really
was interested in the stats/statssounds, try it and let me know if your sounds
are all played.
if 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.
by the way, there will be no hudmessages that announce your sounds,
they will just be played!
blobby
08-20-2007, 08:57 AM
Lol now i feel really dumb lol thanks so much feuersturm m8 much appreciated m8
Thanks and regards
Blobby
blobby
08-20-2007, 10:20 AM
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 appreciated
Regards
Blobby
=[
blobby
08-20-2007, 02:54 PM
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 this
Regards
Blobby
FeuerSturm
08-22-2007, 04:11 PM
basically the menu should have nothing to do with your standard sounds,
but it could be that it's dynamically generated, so i'll have a look at that.
but then i don't know why one of your sounds should be played but not the rest?!
i'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.
blobby
08-25-2007, 12:08 PM
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 :p
Regards
Blobby
blobby
08-26-2007, 09:25 AM
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 this
/home/groups/amxmodx/tmp3/phpviSAMX.sma(122) : error 001: expected token: "}", but found "-string-"
/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "HolyShit"
/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "HolyShitSound"
/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "LudacrissKill"
/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "LudacrissKillSound"
/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "MegaKill"
/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "MegaKillSound"
/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "WickedSick"
/home/groups/amxmodx/tmp3/phpviSAMX.sma(1037) : warning 203: symbol is never used: "WickedSickSound"
And im guessing this is because in the code i can see this for all the other sounds
if ( KillingStreak || KillingStreakSound ){
g_streakKills[ killer ][ 0 ]++
g_streakKills[ killer ][ 1 ] = 0
new a = g_streakKills[ killer ][ 0 ] - 3
if ( (a > -1) && !( a % 2 ) ) {
if ( (a >>= 1) > 10 ) a = 10
if ( KillingStreak ){
set_hudmessage(0, 100, 255, 0.05, 0.55, 2, 0.02, 6.0, 0.01, 0.1, -1)
for (new i=1;i<=get_maxplayers();i++){
if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue
ShowSyncHudMsg(i, g_left_sync, "%L",i,g_KillingMsg[ a ], killer_name)
}
}
if ( KillingStreakSound ) client_cmd( 0 , "spk misc/%s" , g_Sounds[ a ] )
I 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 great
Regards
Blobby
P.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 =]
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:
if(KillingStreak || KillingStreakSound)
{
g_streakKills[killer][0]++
g_streakKills[killer][1] = 0
new a = g_streakKills[killer][0] - 3
if((a > -1) && !(a % 2))
{
if((a >>= 1) > 10)
a = 10
if(KillingStreak)
{
set_hudmessage(0, 100, 255, 0.05, 0.55, 2, 0.02, 6.0, 0.01, 0.1, -1)
for(new i = 1; i <= get_maxplayers(); i++)
{
if(g_Killers[i][0] && g_DeathStats[i] > get_gametime())
continue
ShowSyncHudMsg(i, g_left_sync, "%L",i,g_KillingMsg[a], killer_name)
}
}
if(KillingStreakSound)
client_cmd(0, "spk misc/%s", g_Sounds[a])
} // MISSING
} // MISSINGNow, 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:
/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.
Cheers!
blobby
08-26-2007, 12:30 PM
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 now
Regards
Blobby
blobby
08-31-2007, 06:41 PM
Boo hoo Please help me im still not having any joy with this at all
Regards
Blobby
blobby
09-08-2007, 12:10 PM
I still haven't got this working :p did you ever get chance to look at this FeuerSturm i was just wondering that was all
Regards
Blobby
Ok, I allowed attachments to the scripting help forum, this way you can post your difficulty and someone can look at it.
Cheers!
blobby
09-08-2007, 03:44 PM
Thnaks zor i will post this up now
blobby
09-08-2007, 03:47 PM
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 great
Regards
Blobby
blobby
09-12-2007, 09:38 AM
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
Regards
Blobby
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.