aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/faction_xp.gnut
blob: 6555c875b63bcd22f19391e3e4135b30fda7657f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
global function AddFactionXP

void function AddFactionXP( entity player, int amount )
{
	string faction = GetFactionChoice( player )
	int oldLevel = FactionGetLevel( player, faction )
	// increment xp
	player.SetPersistentVar( "factionXP[" + faction + "]", min( FactionGetXP( player, faction ) + amount, FactionGetMaxXP( faction ) ) )
	
	// note: no notif for faction level up
	if ( FactionGetLevel( player, faction ) != oldLevel )
		AddPlayerScore( player, "FactionLevelUp" )
}