 |
|
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
|

11-07-2010
, 20:23
Re: Gladiator Mod v1.0
|
#11
|
- Use cmd_access(), else use console_print(id, ...) instead of if(id){ client_print(id, print_console, ...) }
- Not critical but: case 10,9,8,7,6,5,4,3,2,1
case 1..10 for readaibility
- cache values that are retrieved from a native more than once in the same function (might be eliminated by next suggestion)
PHP Code:
if(g_GP[id] >= get_pcvar_num(cvar_hpcost))
{
// code
}
else if(g_GP[id] < get_pcvar_num(cvar_hpcost))
{
// code
}
situations like this are redundant as these two cases are mutually exclusive. Change the else if() to just else. I saw at least 6 places that use this. I would probably use the < as the conditional instead of >= (difference is probably negligible)
__________________
|
|
|
|