Raised This Month: $ Target: $400
 0% 

Need help on warning


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
monk1986
Member
Join Date: Oct 2007
Old 10-19-2007 , 02:59   Need help on warning
Reply With Quote #1

This part is the code that has the warning.

Code:
 
public checkMap()
{ 
 get_mapname(map,32)
 if(equali(map,"awp_",4))
 {
  return PLUGIN_HANDLED
 }
}
Warning 209: function "checkMap" should return a value
monk1986 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-19-2007 , 03:14   Re: Need help on warning
Reply With Quote #2

You don't need to return something here.

So, just do like:

Code:
public checkMap() {     get_mapname( map, 32 )         if( equali( map, "awp_", 4 ) )         return; }


If you want to return something :

Code:
public checkMap() {     get_mapname( map, 32 )         if( equali( map, "awp_", 4 ) )         return PLUGIN_CONTINUE;             return PLUGIN_CONTINUE; }

Your error is because you have to return something at the end of your function.
__________________

Last edited by Arkshine; 10-19-2007 at 03:16.
Arkshine is offline
monk1986
Member
Join Date: Oct 2007
Old 10-19-2007 , 03:20   Re: Need help on warning
Reply With Quote #3

ok but will this make the plugin stop i dont want it to run if the map name contains awp_
monk1986 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-19-2007 , 03:36   Re: Need help on warning
Reply With Quote #4

Sure, it will. ;)

Test yourself and see.
__________________
Arkshine 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 01:17.


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