Necklace and Helm
Moderator: Forum Moderator
-
- Peon
- Posts: 8
- Joined: Tue May 22, 2007 2:49 am
Necklace and Helm
Hey everyone. I searched for this, but nothing came up about it..
I would like to change the Necklace and Helm to if someone buys them, they are not charged, they can be used always until you die.. How can this be done? Thanks in advance.
I would like to change the Necklace and Helm to if someone buys them, they are not charged, they can be used always until you die.. How can this be done? Thanks in advance.
- YamiKaitou
- Forum Moderator
- Posts: 1925
- Joined: Wed Feb 01, 2006 4:33 pm
- Contact:
Re: Necklace and Helm
Look at the code of an old version, then alter your copy to mimic that
No support via PM or Email
-
- Peon
- Posts: 8
- Joined: Tue May 22, 2007 2:49 am
Re: Necklace and Helm
ok, but which file(s)? i haven't used this code before :/
thanks
thanks
-
- Spell Breaker
- Posts: 398
- Joined: Sun Apr 27, 2008 10:11 pm
Re: Necklace and Helm
items.inl remove
in events.inl remove
in ultimates.inl remove
in items.h remove
thats pretty much it
Code: Select all
g_iFlag[ITEM_NECKLACE] |= ITEM_CHARGEABLE;
g_iFlag[ITEM_HELM] |= ITEM_CHARGEABLE;
case ITEM_NECKLACE:
{
g_iNecklaceCharges[id] += NECKLACE_CHARGES;
}
case ITEM_HELM:
{
g_iHelmCharges[id] += HELM_CHARGES;
}
case ITEM_NECKLACE:
{
g_iNecklaceCharges[id] = 0;
}
case ITEM_HELM:
{
g_iHelmCharges[id] = 0;
}
Code: Select all
// Lets remove a charge from the helm!
ITEM_RemoveCharge( iVictim, ITEM_HELM );
Code: Select all
ITEM_RemoveCharge( id, ITEM_NECKLACE );
Code: Select all
#define NECKLACE_CHARGES 4
#define HELM_CHARGES 3
new g_iNecklaceCharges[33]; // Holds the number of charges left in the player's necklace
new g_iHelmCharges[33]; // Holds the number of charges left in the player's helm

-
- Peon
- Posts: 8
- Joined: Tue May 22, 2007 2:49 am
Re: Necklace and Helm
thanks for the reply.
i did what whosyourdaddy said to do, i restarted my server with "rcon quit" and it still appears the 4 and 3 charges.. also, in items.inl i changed
to
but it still appears as 3000, i don't know why if i changed it and restarted my server.. any ideas?
thanks again.
i did what whosyourdaddy said to do, i restarted my server with "rcon quit" and it still appears the 4 and 3 charges.. also, in items.inl i changed
Code: Select all
ITEM_COST[ITEM_HELM] = 3000; // Helm of Excellence
Code: Select all
ITEM_COST[ITEM_HELM] = 1500; // Helm of Excellence
thanks again.
-
- Spell Breaker
- Posts: 398
- Joined: Sun Apr 27, 2008 10:11 pm
-
- Peon
- Posts: 8
- Joined: Tue May 22, 2007 2:49 am
Re: Necklace and Helm
ooo, no, didn't realize that i needed to recompile it 
thanks hehe

thanks hehe
-
- Peon
- Posts: 8
- Joined: Tue May 22, 2007 2:49 am
Re: Necklace and Helm
it gives me an error when trying to complie..
i'm guessing that there is more code to be removed besides the one you mentioned?
Code: Select all
war3ft/war3ft.inl(1911) : error 017: undefined symbol "g_iNecklaceCharges"
-
- Spell Breaker
- Posts: 398
- Joined: Sun Apr 27, 2008 10:11 pm
Re: Necklace and Helm
ya sorry forgot one line just go into war3ft.inl and removexiownthisplacex wrote:it gives me an error when trying to complie..i'm guessing that there is more code to be removed besides the one you mentioned?Code: Select all
war3ft/war3ft.inl(1911) : error 017: undefined symbol "g_iNecklaceCharges"
Code: Select all
g_iNecklaceCharges[id] = 0;
g_iHelmCharges[id] = 0;

-
- Peon
- Posts: 8
- Joined: Tue May 22, 2007 2:49 am
Re: Necklace and Helm
thanks, that seemed to work!
another thing though :p how can i check to see if the user is an admin? like, if i want to disable mole for all users besides admin, what kind of code would i use to check that validation?
another thing though :p how can i check to see if the user is an admin? like, if i want to disable mole for all users besides admin, what kind of code would i use to check that validation?
-
- Spell Breaker
- Posts: 398
- Joined: Sun Apr 27, 2008 10:11 pm
-
- Peon
- Posts: 8
- Joined: Tue May 22, 2007 2:49 am
Re: Necklace and Helm
hmm, you mean like this? :
Code: Select all
// Observe Chat for players wanting to play sounds
// Plugin by MistaGee
//
// Whenever a player sez "* something", the server will look for
// /sounds/misc/something.wav. If the file exists, all players
// will play it (if they have got it).
//
#include <amxmodx>
#include <amxmisc>
public plugin_init(){
register_plugin("Chat Sounds", "1.0", "MistaGee")
register_concmd("say", "cmd_chatsnd", -1, " ")
register_cvar("amx_csnd_dir", "misc") // Directory to search the sounds in
register_cvar("amx_csnd_hide", "0") // Alows to hide the sound CMD if it is valid
}
public cmd_chatsnd(id,level,cid){
new csnd_saidtext[32]
read_argv(1, csnd_saidtext, 31)
// Only procees if said text starts with a /
// prevents unwanted sound playing
///////////////////////////////////////////////////////////////////// CODE IS HERE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
if(is_user_admin(id) && csnd_saidtext[0] != '/'){ //////////////////// CODE IS HERE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// Put together the sound's filename
new csnd_file[63]
new csnd_dir[32]
get_cvar_string("amx_csnd_dir", csnd_dir, 32)
format(csnd_file, 62, "sound/%s%s.wav", csnd_dir, csnd_saidtext)
if(file_exists(csnd_file)){
// Get the player's name who started all this shit
new plname[32]
get_user_name(id, plname, 31)
// Get all players
new players[32], plnum = 0
get_players(players, plnum)
for(new i = 0; i < plnum; i++){
console_print(players[i], "[AMXX] %s asked to play sound '%s'!", plname, csnd_file)
console_cmd(players[i], "spk %s", csnd_file)
}// play the sound to each player
// To hide the said CMD, suppress further scripts
if(get_cvar_num("amx_csnd_hide")) return PLUGIN_HANDLED
} // If the wanted file exists
// Function that tests if a file exists: bool:file_exists(file[])
} // slash-start check
return PLUGIN_CONTINUE
} // Function :: cmd_chatsnd
-
- Spell Breaker
- Posts: 398
- Joined: Sun Apr 27, 2008 10:11 pm