Raised This Month: $ Target: $400
 0% 

A error with compile


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-06-2009 , 11:12   A error with compile
Reply With Quote #1

Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Argument type mismatch (argument 4) on line 17

1 Error.
Could not locate output file C:\Users\Jacob\Desktop\multijump.amx (compile failed).

PHP Code:
#include <amxmodx>
#include <fakemeta>
 
#define FLAG_ADMIN ADMIN_LEVEL_A
 
new g_iJumpCount[33], bool:g_bJumped[33];
new 
g_pMaxJumpsg_pAdminOnly;
 
public 
plugin_init()
{
        
register_plugin("hns_MultiJump""0.1""TitANious (port to FM by hleV)");
        
g_pMaxJumps register_cvar("mj_maxjumps""1"); // 1 normal jump + amount in CVAR
        
g_pAdminOnly register_cvar("mj_adminonly""0");
        
register_forward(FM_PlayerPreThink"fwPreThink");
        
register_forward(FM_PlayerPostThink"fwPostThink");
        
set_task(0.1"plugin_init()"00"ab"1) <--------------- This is line 17
}
 
public 
client_disconnect(iCl)
{
        
g_iJumpCount[iCl] = 0;
        
g_bJumped[iCl] = false;
}
 
public 
fwPreThink(iCl)
{
        if (!
is_user_alive(iCl) || (get_pcvar_num(g_pAdminOnly) && !(get_user_flags(iCl) & FLAG_ADMIN)))
                return;
 
        static 
iButtoniOldButtoniFlags;
        
iButton pev(iClpev_button);
        
iOldButton pev(iClpev_oldbuttons);
        
iFlags pev(iClpev_flags);
 
        if ((
iButton IN_JUMP) && !(iFlags FL_ONGROUND) && !(iOldButton IN_JUMP))
                if (
g_iJumpCount[iCl] < get_pcvar_num(g_pMaxJumps))
                {
                        
g_iJumpCount[iCl]++;
                        
g_bJumped[iCl] = true;
                        return;
                }
 
        if ((
iButton IN_JUMP) && (iFlags FL_ONGROUND))
                
g_iJumpCount[iCl] = 0;
}
 
public 
fwPostThink(iCl)
{
        if (!
is_user_alive(iCl) || (get_pcvar_num(g_pAdminOnly) && !(get_user_flags(iCl) & FLAG_ADMIN)))
                return;
 
        if (
g_bJumped[iCl])
        {
                static 
Float:fVel[3];
                
pev(iClpev_velocityfVel);
                
fVel[2] = random_float(265.0285.0); // IMO it should be lesser
                
set_pev(iClpev_velocityfVel);
                
g_bJumped[iCl] = false;
        }

__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-06-2009 , 11:21   Re: A error with compile
Reply With Quote #2

First of all, it should be plugin_init, not plugin_init().
Second, why are you recalling plugin_init within plugin_init?
Third, read this: http://amxmodx.org/funcwiki.php?sear...task&go=search
__________________
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
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-06-2009 , 11:23   Re: A error with compile
Reply With Quote #3

Why are you trying to call plugin_init from plugin_init. Explain what you are trying to do, I'm sure there is a more proper way accomplish your task.

You should not have plugin_init() and you are telling the task to both loop and repeat 1 time. I'm assuming you just want it to occur once, so nothing is needed.

PHP Code:
set_task0.1"plugin_init" 
__________________

Last edited by Bugsy; 04-06-2009 at 11:25.
Bugsy is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-06-2009 , 11:27   Re: A error with compile
Reply With Quote #4

I know, i want to do that you only can multijump once a round
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-06-2009 , 11:31   Re: A error with compile
Reply With Quote #5

Well then you already have that defined as the cvar default.

The below does that check for you.

PHP Code:
if (g_iJumpCount[iCl] < get_pcvar_num(g_pMaxJumps)) 
Do some searching to find out how to detect a new round and then use that to reset your g_iJumpCount[] variable.
__________________
Bugsy is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-06-2009 , 11:33   Re: A error with compile
Reply With Quote #6

Where should it be in the script?
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-06-2009 , 11:35   Re: A error with compile
Reply With Quote #7

nowhere... remove that task... it doesn't make any sense... that means you will register the plugin, the cvars and the forwards each 0.1 seconds... I don't know WHAT will happen but it won't be good

bottom line: remove that line, it's useless :}
__________________
Hunter-Digital is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-06-2009 , 11:35   Re: A error with compile
Reply With Quote #8

Look at this thread:

http://forums.alliedmods.net/showthread.php?t=42159

You need to do g_iJumpCount[id] = 0 at new round or round start
__________________
Bugsy is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-06-2009 , 11:59   Re: A error with compile
Reply With Quote #9

Well it should only be one time each round
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-06-2009 , 12:28   Re: A error with compile
Reply With Quote #10

PHP Code:
        g_iJumpCountid ) = 0; <----- Line 21
        g_bJumped
id ) = false; <----- Line 22 
Code:
Error: Invalid function call, not a valid address on line 21
Error: Undefined symbol "id" on line 21
Warning: Expression has no effect on line 21
Error: Invalid function call, not a valid address on line 22
Error: Undefined symbol "id" on line 22
Warning: Expression has no effect on line 22
Error: Invalid function or declaration on line 46
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
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 02:23.


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