Quote:
I don't think that is necessary. It would be obvious if a file is missing. A message will show in the console if a sound is missing, and the server will automatically crash if the sprite is missing. In addition, file_exists checks in the cstrike folder, and people may use sounds from the valve folder.
|
There are ways to check valve folder too, IIRC by doing ../valve(in 1.8.3 a param was added for this), and the point was to avoid the crash and simply notice the owner that something in his configuration is wrong. Well, not really critical, just an ideea.
1.static in
msgTextMsg,
msgSendAudio is not needed.
2.
PHP Code:
return equal(szMessage, g_szFireInTheHole) ? PLUGIN_HANDLED : PLUGIN_CONTINUE
? PLUGIN_HANDLED : PLUGIN_CONTINUE is not needed, simply return what equal give.
3.In
fwdSetModel:
default: return. Given the condition this can't ever by reached, can be removed.
4.
Quote:
Are you sure about this? What if the player dies in the exact moment when he is about to throw the grenade? What's the problem of getting the team of a dead player?
|
CSX fires
grenade_throw forward from
SetModel post, so after grenade is actually throw(SetModel being called at the end of the function which creates a grenade). Probably connected check is more proper than alive.
5.In
grenade_throw:
- Check if contain() != -1.
PHP Code:
get_players(iPlayers, iPnum)
skip bots, they don't need such information.
- if(!is_blank(szSound)) is pointless, forward is called only for grenades so code reach a case for sure and string can't be empty.
6.In
fwdPrecacheSound check if you should replace the sound before blocking the original one.
7.
PHP Code:
return szString[0] == EOS ? true : false
? true : false is not needed. Same for
is_random
8.When reading the file, if it was empty, so plugin should not do anything pause it.
__________________