What is differance ?
public fw_playerprethink(id)
{ if(!is_user_alive(id)) return blabla code } or public fw_playerprethink(id) { if(!is_user_alive(id)) return FMRES_IGNORED blabla code return FMRES_IGNORED } what is differance btw 'return' and 'return FMRES_IGNORED' samething ? |
Re: What is differance ?
FMRES_* - in fakemeta forwards. (no only fm, can work in ham fw)
PLUGIN_* - in engine forwards or publics. return - is equal to return PLUGIN_CONTINUE or return 0 Quote:
PS: search before |
Re: What is differance ?
but if I change first code to
public fw_playerprethink(id) { if(!is_user_alive(id)) return PLUGIN_CONTINUE blabla code } like this , but this code is wrong. I dont think "return" is exactly same "return PLUGIN_CONTINUE" It shoud be public fw_playerprethink(id) { if(!is_user_alive(id)) return blabla code return PLUGIN_CONTINUE <-- } right ? So I asked this things. once I use return FMRES_IGNORED or return P LUGIN_CONTINUE at top of code, there shoud be return FMRES_IGNORED or return PLUGIN_CONTINUE at bottom of code. I want to know diiferance or benefit. |
Re: What is differance ?
in a fakemeta forward hook, you'd better always use the FMRES_ type as the return value.
return is not equal to return 0, return is just return nothing code below will get a warning, although it get 0 as result Code:
public test(id) //a commandso if you only return FMRES_IGNORED in a fm forward, you can use return; other than that, you should always use FMRES_* so for your case, the difference depend on the blabla code, if there is no other return type than FMRES_IGNORED, then your two case is the same thing. otherwise your first code is wrong, because in a function you can't use return; and return something; at the same time. |
Re: What is differance ?
Quote:
|
Re: What is differance ?
Quote:
|
| All times are GMT -4. The time now is 17:01. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.