Re: HomeFree
Nice but you need to do
PHP Code:
PHP Code:
PHP Code:
You errorneously begin the loop at RoundStart with id zero but the players ids start with one. Also it is better if you store get_maxplayers() earlier or even globally. Also, you redundantly set the players' money to zero twice. You only need to do that once. Another little thing is that is_user_alive( id ) already includes the check for is_user_connected( id ) which you therefore don't need anymore (as you are checking this in one single if clause). |
Re: HomeFree
Your previous hook of the round start was entirely correct. You have to do the player spawn hook seperately to catch late connecting players. Then you obviously have to leave out the loop so the other players do not receive the message again.
A nice tutorial on how to hook round start and player spawn correctly can be found here: http://forums.alliedmods.net/showthread.php?t=42159 There is still a second money reset when the players' team is 2, this is not necessary.:up: |
Re: HomeFree
There are several errors within this plugin.
If you wish to know how to fix them, reply back. Unapproved. |
Re: HomeFree
Your use of client_PreThink is not justified, use proper events/forwards instead.
|
Re: HomeFree
Sweet 2 year bump, COMPLETE re-code, edited first post, uploaded new sma(15kb up from 5kb). Contacted an approver to move this to new submissions.
a bit late, I know :) |
Re: HomeFree
re-submit it on author's request.
|
Re: HomeFree
* cache msg indexes into global variables
* cache maxplayers value into global variables * don't change/supercede GameDescription if cvar is disabled * use cvars pointers even for extra cvars (use get_cvar_pointer in plugin_init) * don't use fm_ converted natives, use propers natives that are more efficient * don't hook ResetHUD event for spawn, hook Ham_Spawn instead * PreThink usage is not worth for lot of features such as Money set, maxspeed change, also, would be better to use engine prethink global forward for code extracted from parachute plugin Consider this if you want your plugin to be reviewed. |
Re: HomeFree
Quote:
* I don't use get_maxplayers() (ColorChat does, though) * It doesn't change it if it's disabled, it has the gEnabled pcvar check * I don't use any cvars other than the ones registered in plugin_init, as POINTERS * No real alternative unless I use fun module. Changed a few to set_pev(id, pev_health) but changing ALL of them to float didn't work so I removed some. can't find any other alternative to strip weapons or give item, either. * Done :mrgreen: * Engine would use more resources, SlowFall works fine as it is and there is no forward to hook pressing buttons. or money :( If you could tell me some alternatives to the fun natives, or the forwards, I'd be more than happy to use them! (updated new src) |
Re: HomeFree
- The messages are still not cached.
- About get_maxplayers(), It doesn't change the fact it has to be cached. - About GameDesc(), you still supercede all the time... - To retrieve pointer from external cvars, use get_cvar_pointer, something you should cache also. - fm_* functions are for most of them conversions of fun functions. So include fun, and remove fm_ and you have your functions. fm_ functions are less efficient then the ones from the fun modules. Remember : the less natives you call the more efficient your plugin will be. - About get_players. You do something wrong. mPlayers will contain a list of player's index, and since it's stored in an array, index starts to 0. So your loop should look : for(i = 0; i < mCount; i++ ), then you can remove your "fix". Also, cache the player's index, i.e: id = mPlayers[i] - Setting all the time the money to 0 is really a poor way. If you want to disable the ability to buy, use info_map_parameters entity. Probably others things to say, start to fix what it has been said. |
Re: HomeFree
Quote:
PHP Code:
-Cached maxplayers in the function ColorChat uses -FMRES_IGNORED now -Done for sv_maxspeed & mp_freezetime( gSvMSpeed and gFrzTime ) -Removed all fm_ funcs, added fun module funcs instead -Did that and it gave me a player out of range error, obviously because cs_get_user_team won't work with ID 0, id = mPlayers[i] is there now -Thought about that when I removed PreThink, now I simply blocked buy function. Added 2 commands, +sprint/-sprint and +slowfall/-slowfall SlowFall is a bit more realistic now, you fall faster. figured it's the only way to get rid of using PreThink(looking at you, connor) updated src:mrgreen: |
| All times are GMT -4. The time now is 05:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.