Raised This Month: $32 Target: $400
 8% 

need help with my plugin...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 06-24-2009 , 15:50   need help with my plugin...
Reply With Quote #1

im getting these errors, I dont know how to fix them.. im not exactly 'intelligent' about these things.. im one day old to (trying) to script

Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// cloak.sma
// C:\Program Files\AMX Mod X\files\base\scripting\cloak.sma(22) : warning 217:
loose indentation
// C:\Program Files\AMX Mod X\files\base\scripting\cloak.sma(27) : warning 217:
loose indentation
// C:\Program Files\AMX Mod X\files\base\scripting\cloak.sma(27) : error 001: ex
pected token: ";", but found "{"
// C:\Program Files\AMX Mod X\files\base\scripting\cloak.sma(32) : warning 217:
loose indentation
// C:\Program Files\AMX Mod X\files\base\scripting\cloak.sma(37) : warning 217:
loose indentation
// C:\Program Files\AMX Mod X\files\base\scripting\cloak.sma(37) : error 001: ex
pected token: ";", but found "{"
// C:\Program Files\AMX Mod X\files\base\scripting\cloak.sma(42) : warning 217:
loose indentation
// C:\Program Files\AMX Mod X\files\base\scripting\cloak.sma(49) : error 001: ex
pected token: ";", but found "{"
// C:\Program Files\AMX Mod X\files\base\scripting\cloak.sma(53) : warning 217:
loose indentation
// C:\Program Files\AMX Mod X\files\base\scripting\cloak.sma(57) : warning 209:
function "give_invis" should return a value
// C:\Program Files\AMX Mod X\files\base\scripting\cloak.sma(80) : error 010: in
valid function or declaration
//
// 4 Errors.
// Could not locate output file compiled\cloak.amx (compile failed).
//
// Compilation Time: 0.64 sec
// ----------------------------------------

Press enter to exit ...
PHP Code:
#include <amxmodx>
#include <fun>
#include <amxmisc>
#define PLUGIN "Cloak"
#define VERSION "1.0"
#define AUTHOR "Master A.K.A. HLM"

#define INVIS_LEVEL ADMIN_KICK        

public plugin_init() {
         
register_plugin(PLUGINVERSIONAUTHOR)
         
register_clcmd("amx_cloak","give_invis",INVIS_LEVEL,"<name|#userid|steamid> <alpha> <on/off> ")
}

public 
give_invis(id,level,cid) {
    if(!
cmd_access(id,level,cid,3))
        return 
PLUGIN_HANDLED
            
    
new name[33]
    
get_user_name(id,name,32)
        
    new 
command1[33], command2[33], command3[33]
    
read_argv(1,command1,32)
    
read_argv(2,command2,32)
    
read_argv(3,command3,32)
        
            new 
usr1 cmd_target(id,command1,2) {
            
client_print(usr1,print_chat"[AMXX] %s is now cloaked. "name)
            
set_user_rendering(usr1,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,0)
        
    
    if(
is_user_alive(usr1))
    
set_user_rendering(usr1,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,0
    
//this line of code will refresh the cloak on user when user is alive again
}
        
        new 
usr2 cmd_target(id,command2,2) {
            
client_print(usr2,print_chat"[AMXX] %s is no longer cloaked. "name)
            
set_user_rendering(usr2,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,255)
        

    if(
is_user_alive(usr2))
    
set_user_rendering(usr2,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,255
    
//I doubt I actually need this, but its better to be safe rather than *CRASH*
    
}


        
        new 
usr3 cmd_target(id,command3,2) { 
            
client_print(usr3,print_chat"[AMXX] %s is now semi-cloaked. "name)
            
set_user_rendering(usr3,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,128)
        
    if(
is_user_alive(usr3))
    
set_user_rendering(usr3,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,128
    
//this line of code will refresh the cloak on user when user is alive again
}
}
         
/*    new szarg1[33], szalpha[8], szarg3[8], bool:mode
    read_argv(1,szarg1,32)
    read_argv(2,szalpha,7)
    read_argv(3,szarg3,7)
    new ialpha = str_to_num(szalpha)
    if(equal(szarg3,"on"))
        mode = true
        
        new pid = cmd_target(id,szarg1,2)
        if(pid > 0) {
            hasinvis[pid] = mode
            if(mode) {
                        client_print(pid,print_chat,"-[EVIL]- %s is now cloaked ",name)
                        set_user_rendering(pid,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,ialpha)
            }
            else {
                       client_print(pid,print_chat,"-[EVIL]- %s is no longer  ",name)
                       set_user_rendering(pid,kRenderFxNone,0,0,0,kRenderNormal,ialpha)
            }
        }
    }*/
    
    
return PLUGIN_HANDLED
}

__________________
+|- KARMA Respectively

HLM is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 06-24-2009 , 17:53   Re: need help with my plugin...
Reply With Quote #2

cant someone tell me anything? I dont know how to fix this!!!
__________________
+|- KARMA Respectively

HLM is offline
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-24-2009 , 18:06   Re: need help with my plugin...
Reply With Quote #3

wat the hell is all this??
Code:
/*    new szarg1[33], szalpha[8], szarg3[8], bool:mode
read_argv(1,szarg1,32)
read_argv(2,szalpha,7)
read_argv(3,szarg3,7)
new ialpha = str_to_num(szalpha)
if(equal(szarg3,"on"))
    mode = true

new pid = cmd_target(id,szarg1,2)
if(pid > 0) {
    hasinvis[pid] = mode
    if(mode) {
        client_print(pid,print_chat,"-[EVIL]- %s is now cloaked ",name)
        set_user_rendering(pid,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,ialpha)
    }
    else {
        client_print(pid,print_chat,"-[EVIL]- %s is no longer  ",name)
        set_user_rendering(pid,kRenderFxNone,0,0,0,kRenderNormal,ialpha)
    }
}
}*/
__________________
-Acid- is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 06-24-2009 , 18:35   Re: need help with my plugin...
Reply With Quote #4

that is the old code that would work, but you would need to set the alpha value, I keep that as a reference to what I can try to do... eveything else is the part that doesnt work..
__________________
+|- KARMA Respectively

HLM is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-24-2009 , 18:49   Re: need help with my plugin...
Reply With Quote #5

What do you use to code with? I think you might need a better program like Notepad++, it might help you with your programming.
__________________
fysiks is offline
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-24-2009 , 18:49   Re: need help with my plugin...
Reply With Quote #6

u have "}" everywhere lol!!!
__________________
-Acid- is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 06-24-2009 , 18:52   Re: need help with my plugin...
Reply With Quote #7

I use pawn studio..

I am new to coding, I was block coding everything, because I want to all to be together
__________________
+|- KARMA Respectively

HLM is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-24-2009 , 18:53   Re: need help with my plugin...
Reply With Quote #8

Start to indent properly your code and you will see better.
__________________
Arkshine is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-24-2009 , 18:55   Re: need help with my plugin...
Reply With Quote #9

It compiles but I am completely baffled as to what in the world you are doing.

PHP Code:
#include <amxmodx>
#include <fun>
#include <amxmisc>
#define PLUGIN "Cloak"
#define VERSION "1.0"
#define AUTHOR "Master A.K.A. HLM"

#define INVIS_LEVEL ADMIN_KICK

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("amx_cloak","give_invis",INVIS_LEVEL,"<name|#userid|steamid> <alpha> <on/off> ")
}

public 
give_invis(id,level,cid)
{
    if(!
cmd_access(id,level,cid,3))
        return 
PLUGIN_HANDLED

    
new name[33]
    
get_user_name(id,name,32)

    new 
command1[33], command2[33], command3[33]
    
read_argv(1,command1,32)
    
read_argv(2,command2,32)
    
read_argv(3,command3,32)

    new 
usr cmd_target(id,command1,2)
    
client_print(usr,print_chat"[AMXX] %s is now cloaked. "name)
    
set_user_rendering(usr,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,0)

    if(
is_user_alive(usr))
    {
        
set_user_rendering(usr,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,0)
    }
    
//this line of code will refresh the cloak on user when user is alive again

    
usr cmd_target(id,command2,2)
    
client_print(usr,print_chat"[AMXX] %s is no longer cloaked. "name)
    
set_user_rendering(usr,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,255)


    if(
is_user_alive(usr))
    {
        
set_user_rendering(usr,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,255)
    }
    
//I doubt I actually need this, but its better to be safe rather than *CRASH*

    
usr cmd_target(id,command3,2)
    
client_print(usr,print_chat"[AMXX] %s is now semi-cloaked. "name)
    
set_user_rendering(usr,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,128)

    if(
is_user_alive(usr))
    {
        
set_user_rendering(usr,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,128)
    }
    
//this line of code will refresh the cloak on user when user is alive again
    
    
return PLUGIN_HANDLED
}

/*
    new szarg1[33], szalpha[8], szarg3[8], bool:mode
    read_argv(1,szarg1,32)
    read_argv(2,szalpha,7)
    read_argv(3,szarg3,7)
    new ialpha = str_to_num(szalpha)
    if(equal(szarg3,"on"))
        mode = true

        new pid = cmd_target(id,szarg1,2)
        if(pid > 0) {
            hasinvis[pid] = mode
            if(mode) {
                        client_print(pid,print_chat,"-[EVIL]- %s is now cloaked ",name)
                        set_user_rendering(pid,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,ialpha)
            }
            else {
                      client_print(pid,print_chat,"-[EVIL]- %s is no longer  ",name)
                      set_user_rendering(pid,kRenderFxNone,0,0,0,kRenderNormal,ialpha)
            }
        }
    }

    return PLUGIN_HANDLED
}
}
*/ 
This is your supposed arguments: ,"<name|#userid|steamid> <alpha> <on/off>"
yet you use all three as if they are all player names/userids/steamids.

You technically are only requiring two of the three arguments too.
__________________
fysiks is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 06-24-2009 , 18:55   Re: need help with my plugin...
Reply With Quote #10

seeing is my current problem, my problem right now is finding out why it doesnt work.. this plugin is simply making a user 'cloaked' by setting the rendering to either on half or off... but I dont know how to do that..
__________________
+|- KARMA Respectively

HLM is offline
Reply


Thread Tools
Display Modes

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 05:13.


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