AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [help with my plugin] (https://forums.alliedmods.net/showthread.php?t=105922)

Xevious 10-09-2009 20:48

[help with my plugin]
 
It compiled successfully but 1 error occur.
[Frozener(38) Warning 209 function cmd_fro should return a value


PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Frozener"
#define VERSION "1.0"
#define AUTHOR "Xevious"


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("amx_fro""cmd_fro"ADMIN_SLAY"<target>")
}

public 
cmd_fro(idlevelcid)
{
    if (!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED

    
    
new Arg1[24]
    
read_argv(1Arg123)
    
    new 
player cmd_target(idArg11)
    
    if (!
player)
    {
        
console_print(id"Sorry, player %s could not be found or targetted!"Arg1)
        return 
PLUGIN_HANDLED
    

    else 
    {
        
set_pev(playerpev_flagspev(playerpev_flags) | FL_FROZEN
    }



Bugsy 10-09-2009 20:50

Re: [help with my plugin]
 
add a return PLUGIN_HANDLED; directly above the last }

Code:
// ...     else     {         set_pev(player, pev_flags, pev(player, pev_flags) | FL_FROZEN)     }     return PLUGIN_HANDLED }

Xevious 10-09-2009 22:16

Re: [help with my plugin]
 
added return PLUGIN_HANDLED
It compiled, but one error occur again

warning 217: loose indentation at line (39)

Bugsy 10-09-2009 22:19

Re: [help with my plugin]
 
Quote:

Originally Posted by Xevious (Post 957228)
added return PLUGIN_HANDLED
It compiled, but one error occur again

warning 217: loose indentation at line (39)

So do what the warning is telling you and fix the indenting. Nobody should need help doing this.

Here's an example for you, blah2() is a loose indent:
Code:
new var1; new var2; if ( var1 == 5 ) {       blah();         blah2();       blah3(); }

Xevious 10-09-2009 22:25

Re: [help with my plugin]
 
thank bugsy and Asd' , now i know what is loose identition

FULLY COMPILED :) ERROR SOLVED


All times are GMT -4. The time now is 22:36.

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