Hello. I'm back
I still got some problems with my mod.
Reasons: when I emit sounds it continue to play until you disconnect + lack of ideas.
I tried both emit and the spk etc.
They don't play the sound or they play it until you disconnect, and that is very irritating with my current sounds + when it is a level up it should play a sound but it wont work.
Here is the codes I used for them. + No errors while compiling.
Code:
emit_sound(id, CHAN_AUTO, "mythmod/skilluse.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) <- This one plays until you disconnect.
//Other at level up
if(g_PlayerXP[attacker] >= LEVELS[g_PlayerLevel[attacker]])
{
g_PlayerLevel[attacker] += 1
client_print(attacker,print_chat,"[Mythology Mod] Congratulations! You are now level %i!", g_PlayerLevel[attacker])
SaveXP(attacker)
ShowHUD(attacker)
emit_sound(id, CHAN_AUTO, "mythmod/levelup.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) <- This one doesn't work.
}
Here is my second problem on the mod.
This is a menu that doesn't work.
Code:
public DoShopMenu(id, key)
{
new usermoney = cs_get_user_money(id)
new userhealth = get_user_health(id)
switch(key)
{
case 0:
{
if(usermoney < EXTRA_HP_COST)
{
return PLUGIN_HANDLED
}
set_user_health(id, userhealth + EXTRA_HP_AMOUNT)
cs_set_user_money(id, usermoney - EXTRA_HP_COST)
return PLUGIN_CONTINUE
}
case 1:
{
if(usermoney < EXTRA_XP_COST)
{ return PLUGIN_HANDLED
}
g_PlayerXP[id] += EXTRA_XP_AMOUNT
cs_set_user_money(id, usermoney - EXTRA_XP_COST)
return PLUGIN_CONTINUE
}
case 2:
{
if(usermoney < EXTRA_SPEED_COST)
{
return PLUGIN_HANDLED
}
set_user_maxspeed(id, EXTRA_SPEED.0)
client_cmd(id, "cl_forwardspeed EXTRA_SPEED")
client_cmd(id, "cl_backspeed EXTRA_SPEED")
client_cmd(id, "cl_sidespeed EXTRA_SPEED")
cs_set_user_money(id, usermoney - EXTRA_SPEED_COST)
return PLUGIN_CONTINUE
}
}
return PLUGIN_CONTINUE
}
On this menu I don't really know what to do so please help me.
__________________