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