Raised This Month: $ Target: $400
 0% 

Please Help, New Plugin for headshot sounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nyyuu
Junior Member
Join Date: Nov 2006
Location: Brandon, FL
Old 11-14-2006 , 03:51   Please Help, New Plugin for headshot sounds
Reply With Quote #1

Im Trying to make a plugin that instead of just playing the same file over and over when you get a headshot, it randomly pics one so it brings out some fun to the plain old repetitive boringness and has an easy ini file to update to add more sounds or takeaway in the future. Im stuck in a few areas of this however These are some errors i get

Code:
/home/groups/amxmodx/tmp3/text7K5hPl.sma(53) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/text7K5hPl.sma(56) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/text7K5hPl.sma(57) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/text7K5hPl.sma(57 -- 58) : error 001: expected token: "]", but found "new"
/home/groups/amxmodx/tmp3/text7K5hPl.sma(58) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/text7K5hPl.sma(58) : fatal error 107: too many error messages on one line

Compilation aborted.
5 Errors.
The Warnning on line 53 is fine, i started with just a simple plugin withthat to test if it worked and it did
Then on line 56 57 and 58 i dont kno how to rewrite those any other way. .but it could be cuz there values arent finished yet
I also have no clue on how to finish off the list to have the randoms to choose from and how to randomly pic them once the list is done

ALOT of the code is from the headshot_delux, loadingsongsadvance and hlmp
Any help on how to fix any parts up and/or referance/tutorial sites to learn up on (besides the defalt basic documentation)
will be greatly appreciated, Thanks in advance
Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Super HeadShot"
#define VERSION "0.1"
#define AUTHOR "Nyyuu"
#define VIC_MAX 20

new Killer
new Victom
new Headshot
    
//Victom
new listVicWav[20] [200] 
new vicfiledir[200]
new vicsong[VIC_MAX][200]

    public viclist(){
        get_configsdir(vicfiledir,199)
        format(vicfiledir,199,"%s/shsVictom.ini",vicfiledir)
        new trash
        for(new i=0;i<VIC_MAX;i++)
    {    
    read_file(vicfiledir,i,vicsong[i],63,trash)
    // need to find a way to put listVicWav[i][vicsong[i]
    }
        } 



// Killer
new listKilWav[20] [200] 
new kilfiledir[200]
new kilsong[VIC_MAX][200]

    public killist(){
        get_configsdir(kilfiledir,199)
        format(kilfiledir,199,"%s/shsKiller.ini",kilfiledir)
        new trash
        for(new i=0;i<VIC_MAX;i++)
    {    
    read_file(kilfiledir,i,kilsong[i],63,trash)
    // need to find a way to put listkilWav[i][kilsong[i]
    }
        } 

    
    public head_shot() {
    Killer = read_data(1) //get the guy that killed someone
    Victom = read_data(2) //get the guy who died
    Headshot = read_data(3) //was a headshot?
    
    if (Headshot == true) {
        
        //Tempfiles for random song pic
        new temp3 = random(0,20)
        new temp1 = listKilWav[temp3][]
        new temp2 = listVicWav[temp3][]
        
        // plays a random file from killers
        client_cmd(Killer, "spk temp1")
        //plays a random file from victoms
        client_cmd(Victom, "spk temp2")
}
}


   public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event   ("DeathMsg","head_shot","a")     
}
ps, i kno i havent even gotten to the precache yet, the way i was thinking of doing it was similar to the list
Nyyuu is offline
Send a message via ICQ to Nyyuu Send a message via AIM to Nyyuu Send a message via MSN to Nyyuu
The Specialist
BANNED
Join Date: Nov 2006
Old 11-14-2006 , 04:36   Re: Please Help, New Plugin for headshot sounds
Reply With Quote #2

here you go , there was a problem with the way you used random, random only has 1 paramter (max). I beleive it starts at 0 . on line 65 and 66 the arrays wernt indexed properly or something . Note i onlygot it to compile the rest is up to you
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Super HeadShot" #define VERSION "0.1" #define AUTHOR "Nyyuu" #define VIC_MAX 20 new Killer new Victom new Headshot //Victom new listVicWav[20] [200] new vicfiledir[200] new vicsong[VIC_MAX][200] public viclist() {  get_configsdir(vicfiledir,199)  format(vicfiledir,199,"%s/shsVictom.ini",vicfiledir)  new trash  for(new i=0;i<VIC_MAX;i++)  {       read_file(vicfiledir,i,vicsong[i],63,trash)   // need to find a way to put listVicWav[i][vicsong[i]  } }   // Killer new listKilWav[20] [200] new kilfiledir[200] new kilsong[VIC_MAX][200] public killist() {  get_configsdir(kilfiledir,199)  format(kilfiledir,199,"%s/shsKiller.ini",kilfiledir)  new trash  for(new i=0;i<VIC_MAX;i++)  {       read_file(kilfiledir,i,kilsong[i],63,trash)   // need to find a way to put listkilWav[i][kilsong[i]  } } public head_shot() {  Killer = read_data(1) //get the guy that killed someone  Victom = read_data(2) //get the guy who died  Headshot = read_data(3) //was a headshot?    if (Headshot == true)  {     //Tempfiles for random song pic     new temp3 = random(20)     //  Random only has one paramater , the max number to go to (starts at 0)     new temp1 = listKilWav[temp3][199]   new temp2 = listVicWav[temp3][199]     // you have to figure out what value you want your multi-diminesional arrays to hold     // plays a random file from killers   client_cmd(Killer, "spk temp1")   //plays a random file from victoms   client_cmd(Victom, "spk temp2")  } } public plugin_init()  {  register_plugin(PLUGIN, VERSION, AUTHOR)  register_event   ("DeathMsg","head_shot","a")     }
Theres only a couple warning left , you never used the symbols. Hope this helps you somewhat
The Specialist is offline
Send a message via AIM to The Specialist
dutchmeat
Senior Member
Join Date: Sep 2006
Old 11-14-2006 , 04:37   Re: Please Help, New Plugin for headshot sounds
Reply With Quote #3

First of all, use random_num(0,20) instead of random.
But i can't help you with ini files.
dutchmeat is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-14-2006 , 04:47   Re: Please Help, New Plugin for headshot sounds
Reply With Quote #4

well yes if he was looking to generate a random number between a certain number and another you could use
Code:
random_num(min,max);
but since he only wants to generate a random playing of a file , theres no need to do it that way . with this
Code:
random(20);
he can generate a random number between 0(first file) and 20(last file) so in this case random is the best choice IMO.
The Specialist is offline
Send a message via AIM to The Specialist
Nyyuu
Junior Member
Join Date: Nov 2006
Location: Brandon, FL
Old 11-14-2006 , 06:16   Re: Please Help, New Plugin for headshot sounds
Reply With Quote #5

Thank You, The Specialist and dutchmeat so just the hard parts left
Nyyuu is offline
Send a message via ICQ to Nyyuu Send a message via AIM to Nyyuu Send a message via MSN to Nyyuu
dutchmeat
Senior Member
Join Date: Sep 2006
Old 11-14-2006 , 07:31   Re: Please Help, New Plugin for headshot sounds
Reply With Quote #6

You're welcome (this is the part where i start whining for karma ;), but i'll leave it be.)
dutchmeat is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-14-2006 , 07:40   Re: Please Help, New Plugin for headshot sounds
Reply With Quote #7

register the event like this
Code:
register_event("DeathMsg","head_shot","a","3=1")
then you don't need to read_data(3) to see if it was a headshot.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Nyyuu
Junior Member
Join Date: Nov 2006
Location: Brandon, FL
Old 11-14-2006 , 09:35   Re: Please Help, New Plugin for headshot sounds
Reply With Quote #8

cool so the 3=1 is basicly param3 eqipils true so itll go to the head_shot only when thats true? Thanks (and can a new user do karma? dunno if i did it right >_<)
Nyyuu is offline
Send a message via ICQ to Nyyuu Send a message via AIM to Nyyuu Send a message via MSN to Nyyuu
VEN
Veteran Member
Join Date: Jan 2005
Old 11-14-2006 , 14:01   Re: Please Help, New Plugin for headshot sounds
Reply With Quote #9

Quote:
random(20);
he can generate a random number between 0(first file) and 20(last file)
That's incorrect, it will generate the integer in range 0 ... 19.
VEN is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-14-2006 , 16:04   Re: Please Help, New Plugin for headshot sounds
Reply With Quote #10

so if 20 is max it will only generate to number 19?
The Specialist is offline
Send a message via AIM to The Specialist
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 06:55.


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