View Single Post
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 10-17-2013 , 08:52   Re: Custom Start Guns ( Updated 12/06/2013 )
Reply With Quote #25

Quote:
Originally Posted by hornet View Post
The plugin does exist however this method is more efficient.

My suggestion would be to have an option to set up spawn weapons by config file where you can choose what map, team, exactly what weapon/s and the amount of backpack ammo.
That way it would be completely customizable, suitable for multiple primary and secondary weapons, and you could also allow an admin to reload the config during game if they wanted to change it.

Set g_bDiedLastRound true when you create it, and change client_connect() to client_disconnect(). Remove client_putinserver() and remove g_bConnectedPlayers since it has no purpose.
read_file() is older, use fopen(), fgets() etc.
The trie could be done with out.
Be consistant where possible - it makes no sense to use both m_iTeam and cs_get_user_team() in the case where either of the one would suffice.
Don't use find_ent_by_owner() since give_item() returns the index of the newly created entity.
Use your alive check before you format the weapon names ( before cvar check aswell ), and a connected check before prespawn ( since spawn is called once on connect but the player is not set as connected yet ).
And lastly don't format the weapon names for each player since it only needs to be done once ( or once per round at round start to take cvar changes into account ).

Optional - Tidy up your code a bit, it's hard to read 10 lines one below the other when they are a whole mix of functions, new vars etc.
Updated Version 1.0.5

i think ive done all you suggested except for the read_file & config setup as im still learning the newer read file codes... once i get better at them i shall do another update...

i hope this is ok for now?
__________________

Last edited by Blizzard_87; 10-17-2013 at 08:53.
Blizzard_87 is offline