AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help on warning (https://forums.alliedmods.net/showthread.php?t=62118)

monk1986 10-19-2007 02:59

Need help on warning
 
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

Arkshine 10-19-2007 03:14

Re: Need help on warning
 
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.

monk1986 10-19-2007 03:20

Re: Need help on warning
 
ok but will this make the plugin stop i dont want it to run if the map name contains awp_

Arkshine 10-19-2007 03:36

Re: Need help on warning
 
Sure, it will. ;)

Test yourself and see.


All times are GMT -4. The time now is 01:17.

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