Raised This Month: $ Target: $400
 0% 

Simple Question!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-06-2010 , 15:01   Simple Question!
Reply With Quote #1

#1: When registering Ham_Killed, I want it to display a chat message, but still show who was killed. For example:

PHP Code:
if( cs_get_user_team(iVictim) == CS_TEAM_T && cs_get_user_team(iAttacker) == CS_TEAM_CT )
{
     
client_printidprint_chat"Bool1 = true!" )
     return 
PLUGIN_HANDLED;

Since I have return PLUGIN_HANDLED, it wont display at the top right that the CT killed the T. It will only display the message.

What should I return so it will display the message, but the plugin wont execute passed that if statement.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Emp0wer
Member
Join Date: Jul 2010
Location: Ukraine mother
Old 08-06-2010 , 15:07   Re: Simple Question!
Reply With Quote #2

return;
or
return PLUGIN_CONTINUE;
Emp0wer is offline
Send a message via ICQ to Emp0wer Send a message via Skype™ to Emp0wer
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-06-2010 , 15:09   Re: Simple Question!
Reply With Quote #3

In a Ham forward, don't use the PLUGIN_* return values, use the HAM_* ones. Same with Fakemeta.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 08-06-2010 , 16:43   Re: Simple Question!
Reply With Quote #4

HAM_IGNORED would be the most suitable return value in your case.

You seem to have issues with return values, so here they are:
Code:
// Hamsandwich // 0 is also interpreted as HAM_IGNORED #define HAM_IGNORED     1   /**< Calls target function, returns normal value */ #define HAM_HANDLED     2   /**< Tells the module you did something, still calls target function and returns normal value */ #define HAM_OVERRIDE    3   /**< Still calls the target function, but returns whatever is set with SetHamReturn*() */ #define HAM_SUPERCEDE   4   /**< Block the target call, and use your return value (if applicable) (Set with SetHamReturn*()) */ // Fakemeta #define FMRES_IGNORED   1   // Calls target function, returns normal value #define FMRES_HANDLED   2   // Tells metamod you did something, still calls target function and returns normal value #define FMRES_OVERRIDE  3   // Supposed to still call the target function but return your value instead                             // however this does not work properly with metamod; use supercede instead. #define FMRES_SUPERCEDE 4   // Block the target call, and use your return value (if applicable) // Engine+Others #define PLUGIN_CONTINUE     0   /* Results returned by public functions */ #define PLUGIN_HANDLED      1   /* stop other plugins */ #define PLUGIN_HANDLED_MAIN 2   /* to use in client_command(), continue all plugins but stop the command */

EDIT: Technically, returning PLUGIN_CONTINUE in your case would have the same effect as HAM_IGNORED, since 0 is also interpreted as HAM_IGNORED and PLUGIN_CONTINUE is defined as 0. You should still use these return values with their corresponding module forward.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 08-06-2010 at 16:49.
wrecked_ is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode