Give friends free levels

Read log files for errors! If this fails, come here for help

Moderator: Forum Moderator

Post Reply
User avatar
kevlartester
Militia
Posts: 75
Joined: Tue Nov 14, 2006 10:26 am
Location: Germany
Contact:

Post by kevlartester » Thu Jun 14, 2007 4:15 am

hey
well, if all players on your server are your friends xD you can edit this line

Code: Select all

wc3_start_level		0		// What level should all players start at when joining? (default is 0)
in your war3FT.cfg which you will find here: addons\amxmodx\configs\war3ft

if you want only special friends to use this feature you will need to edit the source-code so you can give them a admin flag which will enable this option for them
in case i am a noob in coding this job should do someone else xD
but may i can find out where you have to start editing ;)

EDIT:
found it!
open scripting\war3ft\war3ft.inl and search for:

Code: Select all

// Function called right after the user's race information is set
WC3_SetRaceUp( id )
{
	// Do we need to give this user XP?
	new iStartLevel = get_pcvar_num( CVAR_wc3_start_level );
	if ( p_data[id][P_XP] == 0 && iStartLevel > 0 && iStartLevel <= 10 )
	{
		p_data[id][P_XP] = XP_GetByLevel( iStartLevel );

		client_print( id, print_chat, "%s Your race has started off at level %d!", g_MODclient, iStartLevel );
	}
i would change it to:

Code: Select all

// Function called right after the user's race information is set
WC3_SetRaceUp( id )
{
	// Do we need to give this user XP?
	new iStartLevel = get_pcvar_num( CVAR_wc3_start_level );
	if ( p_data[id][P_XP] == 0 && iStartLevel > 0 && iStartLevel <= 10 && get_user_flags(id)&ADMIN_LEVEL_B )
	{
		p_data[id][P_XP] = XP_GetByLevel( iStartLevel );

		client_print( id, print_chat, "%s Your race has started off at level %d!", g_MODclient, iStartLevel );
	}
and recompile it.

well as i said, i'm new to coding, so may some pro-coder :D will have a look on it

btw: ADMIN_LEVEL_B would be admin flag "n"
for giving this flag to your friends open addons\amxmodx\configs\users.ini

greez kev
Last edited by kevlartester on Mon Jun 18, 2007 3:07 am, edited 1 time in total.
Image

User avatar
kevlartester
Militia
Posts: 75
Joined: Tue Nov 14, 2006 10:26 am
Location: Germany
Contact:

Post by kevlartester » Thu Jun 14, 2007 5:41 am

pls tell me if it works after trying it
Image

Kambfhase
Peon
Posts: 19
Joined: Wed May 09, 2007 9:25 am

Post by Kambfhase » Thu Jun 14, 2007 8:39 am

wouldn't it be easier for him just to use the admin menu and give his friends xp as they need it?

User avatar
kevlartester
Militia
Posts: 75
Joined: Tue Nov 14, 2006 10:26 am
Location: Germany
Contact:

Post by kevlartester » Thu Jun 14, 2007 12:56 pm

of course, he could do that
but that way some admin would have to be online till all his friends has been on the server...could take much time... so, if i coded right his friends don't have to wait for an admin and he can add more friends very easy
would be also interesting for clans and other communities where the member should start with a special level...
Image

User avatar
kevlartester
Militia
Posts: 75
Joined: Tue Nov 14, 2006 10:26 am
Location: Germany
Contact:

Post by kevlartester » Mon Jun 18, 2007 3:22 am

just if someone is interested.... i was able to finally try it and it works!
so if you need this option feel free to edit the source-code like showed above
Image

Post Reply