Why do you have -1 here, that is essentially making the multiplier do nothing when the cvar is set to 2.
new xp = ( (Poke_PlayerLevel( victim, -1 ) ) * (get_cvar_num("pm_xpmultiplier")
- 1) )
I fixed some other things too. Untested.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <pokemod>
#define MAX_PLAYERS 32
new bool:g_happytime, cvar_hh_start, cvar_hh_end, cvar_multiplier, g_exp[ MAX_PLAYERS + 1 ];
public plugin_init()
{
cvar_hh_start = register_cvar("Happy Hour Start","21")
cvar_hh_end = register_cvar("Happy Hour End","22")
cvar_multiplier = register_cvar("pm_xpmultiplier", "2")
RegisterHam(Ham_Killed, "player", "fw_playerkilled_post", 1)
set_task( 180.0, "ev_Start", .flags="b" )
}
public ev_Start( )
{
new data[ 9 ];
get_time( "%H" , data , charsmax( data ) );
if ( get_pcvar_num(cvar_hh_end) > str_to_num( data ) >= get_pcvar_num( cvar_hh_start ) )
{
g_happytime = true;
client_print( 0 , print_chat, "Happy Hour is Active! Double XP per Kill")
}
}
public fw_playerkilled_post(victim, attacker)
{
if( ( victim == attacker ) || !is_user_connected( attacker ) )
return HAM_IGNORED;
if ( g_happytime )
{
new xp = ( ( Poke_PlayerLevel( victim, -1 ) ) * get_pcvar_num( cvar_multiplier ) )
Poke_Give_XP( attacker , -1 , xp );
}
else
{
g_exp[ attacker ]++ // example happyhour off
}
return HAM_IGNORED;
}
__________________