Raised This Month: $ Target: $400
 0% 

[Help] How to make *.ini on plugins.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 02-12-2009 , 07:18   [Help] How to make *.ini on plugins.
Reply With Quote #1

I wan to upgrade it. make *.ini for sound path file
This plugins get unapproved

thanks for helping me.

PHP Code:
/*
    English help by: [ANiME|ADMiN][5hp-Evolution]
    Created by: [ANiME|ADMiN][Ilham Sakura] aka ilham92-cc-sakura
    Scripting Help: SnoW (Damage Event)
    Scripting Help: Tuty (Stock)
*/
#include <amxmodx>
#include <fakemeta>
#include <csx>

#define SND1 "player/player_listen.wav"
#define SND2 "player/breathe1noloop.wav"
#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))

new amx_pcvar_0;

public 
plugin_init()
{
    
register_plugin("HE Player Damage Snd""1.0","ilham92-cc-sakura");
    
amx_pcvar_0 register_cvar("he_hit_respawn","1");
}
public 
plugin_precache()
{
    
precache_sound(SND1);
    
precache_sound(SND2);
}
public 
client_damage(attacker,victim,damage,wpnindex,hitplace,TA)
{
    if(
get_pcvar_num(amx_pcvar_0) != && wpnindex != CSW_HEGRENADE)
        return 
PLUGIN_HANDLED;
    
    new 
sound1[129];
    
copy(sound1,128,SND1);

    if(
contain(sound1,".wav"))
    {
        
replace(sound1,128,".wav","");
        
client_cmd(victim"spk %s",sound1);
    }

    new 
sound2[131];
    
copy(sound2,130,SND2);

    if(
contain(sound2,".wav"))
    {
        
replace(sound1,130,".wav","");
        
client_cmd(victim"spk %s",sound2);
    }

    new 
pl_name[32];
    
get_user_name(victim,pl_name31);
    
    
client_cmd(victim"say ^"Damn itHE Grenade Hit Me!^"");
    
client_print(0print_chat"[Grenade]: At who trow grenade. %s! it is time for a payback",pl_name);
    
    if(
get_user_team(victim) == 1)
    {
        
fm_give_item(victim"weapon_knife");
        
fm_give_item(victim"weapon_mp5navy");
        
fm_give_item(victim"item_kevlar");
        
fm_give_item(victim"ammo_9mm");
        
fm_give_item(victim"ammo_9mm");
        
fm_give_item(victim"ammo_9mm");
        
fm_give_item(victim"ammo_9mm");
    }
    if(!
is_user_alive(victim))
    {
        
set_task(0.6,"respawnagain",victim);
        
client_print(0print_chat"[Grenade]: HE kill %s and respwan.",pl_name);
        
client_cmd(victim"say ^"I will get you for my revenge!^"");
    }
    return 
PLUGIN_CONTINUE;
}
public 
respawnagain(victim)
{
    
fm_cs_user_spawn(victim);
}
stock fm_cs_user_spawn(index)
{
    
set_pev(indexpev_deadflagDEAD_RESPAWNABLE);
    
dllfunc(DLLFunc_Spawnindex);
    
set_pev(indexpev_iuser10);

    return 
1;
}
stock fm_give_item(index, const item[])
{
    if (!
equal(item"weapon_"7) && !equal(item"ammo_"5) && !equal(item"item_"5) && !equal(item"tf_weapon_"10))
        return 
0;

    new 
ent fm_create_entity(item);

    if (!
pev_valid(ent))
        return 
0;

    new 
Float:origin[3];
    
pev(indexpev_originorigin);
    
set_pev(entpev_originorigin);
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN);
    
dllfunc(DLLFunc_Spawnent);

    new 
save pev(entpev_solid);
    
dllfunc(DLLFunc_Touchentindex);

    if (
pev(entpev_solid) != save)
        return 
ent;

    
engfunc(EngFunc_RemoveEntityent);
    return -
1;

__________________

Last edited by ilham92-cc-sakura; 02-18-2009 at 09:48.
ilham92-cc-sakura is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-12-2009 , 09:04   Re: How to make *.ini on plugins.
Reply With Quote #2

i would look how its done in the sank sounds plugin if i were you...
__________________
Dr.G is offline
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 02-12-2009 , 09:11   Re: How to make *.ini on plugins.
Reply With Quote #3

ok... is ok... working... no error found...
__________________
ilham92-cc-sakura is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-12-2009 , 09:48   Re: How to make *.ini on plugins.
Reply With Quote #4

Quote:
Originally Posted by ilham92-cc-sakura View Post
I wan to upgrade it. make *.ini for sound path file
Bad idea. Just use a define for the sound path. Unless you are going to use the ini file for other stuff, I wouldn't recommend using it.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 02-12-2009 , 10:46   Re: How to make *.ini on plugins.
Reply With Quote #5

i know... i have try many times to change. i have use some one code, but can't load/play

i need help. change code to able use *.ini files
thx
__________________
ilham92-cc-sakura is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-12-2009 , 15:28   Re: How to make *.ini on plugins.
Reply With Quote #6

Maybe use a cvar for the sound file path string?
fysiks is offline
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 02-14-2009 , 11:28   Re: How to make *.ini on plugins.
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
Maybe use a cvar for the sound file path string?
How? i noob to script. show example...
__________________
ilham92-cc-sakura is offline
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 02-18-2009 , 02:14   Re: How to make *.ini on plugins.
Reply With Quote #8

I still don't know to make *.ini file on plugins.
I need your help. i have try many times. still not work

PHP Code:
new amx_pcvar_0;

public 
plugin_init()
{
    
register_plugin("HE Player Damage Snd""1.0","ilham92-cc-sakura");
    
amx_pcvar_0 register_cvar("he_hit_respawn","1");
}
public 
plugin_precache ()
{
g_snd01 ArrayCreateMAX_FILE_LENGTH );
g_snd02 ArrayCreateMAX_FILE_LENGTH );
loading_file();
}
public 
client_damage(attacker,victim,damage,wpnindex,hitplace,TA)
{
    if(
get_pcvar_num(amx_pcvar_0) != && wpnindex != CSW_HEGRENADE)
        return 
PLUGIN_HANDLED;
    
    new 
sound1[129];
    
copy(sound1,128,SND1);

    if(
contain(sound1,".wav"))
    {
        
replace(sound1,128,".wav","");
        
client_cmd(victim"spk %s",sound1);
    }

    new 
sound2[131];
    
copy(sound2,130,SND2);

    if(
contain(sound2,".wav"))
    {
        
replace(sound1,130,".wav","");
        
client_cmd(victim"spk %s",sound2);
    } 
help...
__________________
ilham92-cc-sakura is offline
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 02-18-2009 , 09:50   Re: [Help] How to make *.ini on plugins.
Reply With Quote #9

I find this script on round sound...

PHP Code:
public plugin_precache()
{
#if !defined old_amxx
g_lstSoundCT ArrayCreateMAX_FILE_LENGTH );
g_lstSoundT  ArrayCreateMAX_FILE_LENGTH );
#endif

loading_file();

this work on my plugins? or need some to modified?
__________________
ilham92-cc-sakura is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-18-2009 , 11:20   Re: How to make *.ini on plugins.
Reply With Quote #10

Quote:
Originally Posted by YamiKaitou View Post
Bad idea. Just use a define for the sound path. Unless you are going to use the ini file for other stuff, I wouldn't recommend using it.

Also, don't double post. If you really need this, I suggest searching. There are other plugins out there that do this already, one example is CSDM, but I am not sure how it does it as I have never needed it.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply



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 16:59.


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