What can i optimize?
sda
|
Re: What can i optimize?
cmdSayRestart(id)
There are more efficient ways of checking your restart say commands. I would use a Trie. If the string Tmp is not a number then what does str_to_num(Tmp) return (I would assume zero)? If it returns zero then you don't need to do the is_str_num() and you shouldn't need to do if(equal(Tmp, "")) either. Just do Code:
server_cmd("sv_restart %d",clamp(Value, 1, 60))You should probably move the getting user name stuff to right before you use it since you don't use it anywhere else. In RoundStart(), if client #1 is not connected then nobody will be stripped of weapons. Use get_players(). In BlockChangeTeam(id), the third return is technically unreachable. Solution: remove the "else return PLUGIN_CONTINUE;". Anywhere you use cs_get_user_team() use a switch. Do your admin check in CFGVALE( id ) first because you don't use the variable created before it unless the user is an admin. Those are some suggestions. Not guaranteed to be the best nor is it all of the possible optimizations. |
Re: What can i optimize?
Thanks ^^
|
Re: What can i optimize?
A little better:
PHP Code:
PHP Code:
|
| All times are GMT -4. The time now is 07:11. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.