Raised This Month: $ Target: $400
 0% 

Arument type mismatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-13-2011 , 17:38   Arument type mismatch
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "Dont Say Command = Kick"
#define AUTHOR    "kramesa"
#define VERSION    "1.0"

#define TIME 30

new Command

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say""Say_Args")
    
Command register_cvar("amx_cmdkick""/example")
}

public 
client_putinserver(id)
{
    
Start_Time(id)
}

public 
Say_Args(id)
{
    if(
equali(get_cvar_num("amx_cmdkick"))
    {
        
remove_task(id
    }
}

public 
Start_Time(id)
{
    
set_task(float(TIME), "KickUser"id)
}

public 
KickUser(id)
{
    
server_cmd("kick #%d ^"%s^""get_user_userid(id), "Your dont say %s in %s seconds."CommandTIME

Becase I have the error 'Argument type mismatch' on line 26?

PHP Code:
public Say_Args(id)
{
    if(
equali(get_cvar_num("amx_cmdkick"))
    {
        
remove_task(id
    }

__________________

Last edited by kramesa; 12-13-2011 at 17:43.
kramesa is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 12-13-2011 , 17:41   Re: Arument type mismatch
Reply With Quote #2

equali needs two arguments, not just one. What should amx_cmdkicktime be equal to? You have no supplied that information, thus is throws you an error.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 12-13-2011 , 17:42   Re: Arument type mismatch
Reply With Quote #3

Because equali() expects a string value & you're using an integer.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 12-13-2011 , 17:43   Re: Arument type mismatch
Reply With Quote #4

From the code you provided it looks like you have very little scripting knowledge.

Either post in Suggestions/Requests or start reading Tutorials first.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-13-2011 , 18:02   Re: Arument type mismatch
Reply With Quote #5

Oks!

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "Dont Say Command = Kick"
#define AUTHOR    "kramesa"
#define VERSION    "1.0"

#define TIME 30

new Command
new Arg[64]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say""Say_Args")
    
Command register_cvar("amx_cmdkicktime""/example")
}

public 
client_putinserver(id)
{
    
Start_Time(id)
}

public 
Say_Args(id)
{
    
read_args(Arg63)
    
remove_quotes(Arg)
    
    if(
equal(ArgCommand4)
    {
        
remove_task(id
    }
}

public 
Start_Time(id)
{
    
set_task(float(TIME), "KickUser"id)
}

public 
KickUser(id)
{
    
server_cmd("kick #%d ^"%s^""get_user_userid(id), "Your dont say %s in %s seconds."CommandTIME

Already have error!
__________________
kramesa is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-13-2011 , 21:34   Re: Arument type mismatch
Reply With Quote #6

Quote:
Originally Posted by Emp` View Post
From the code you provided it looks like you have very little scripting knowledge.
Could have told you that weeks ago.

Quote:
Originally Posted by kramesa View Post
Oks!

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "Dont Say Command = Kick"
#define AUTHOR    "kramesa"
#define VERSION    "1.0"

#define TIME 30

new Command
new Arg[64]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say""Say_Args")
    
Command register_cvar("amx_cmdkicktime""/example")
}

public 
client_putinserver(id)
{
    
Start_Time(id)
}

public 
Say_Args(id)
{
    
read_args(Arg63)
    
remove_quotes(Arg)
    
    if(
equal(ArgCommand4)
    {
        
remove_task(id
    }
}

public 
Start_Time(id)
{
    
set_task(float(TIME), "KickUser"id)
}

public 
KickUser(id)
{
    
server_cmd("kick #%d ^"%s^""get_user_userid(id), "Your dont say %s in %s seconds."CommandTIME

Already have error!
The variable Command is an integer! That should be obvious. To be precise, the Command variable is a cvar pointer. Please learn the basics.
__________________
fysiks is offline
StickP0le
Senior Member
Join Date: Jan 2010
Location: cuantocabron.com
Old 12-14-2011 , 01:01   Re: Arument type mismatch
Reply With Quote #7

one question since iīm here whatīs the difference between equal/equali and contain/containi? already looked at his functions in amxmodx.org but i didnīt understand

Last edited by StickP0le; 12-14-2011 at 01:06.
StickP0le is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-14-2011 , 01:15   Re: Arument type mismatch
Reply With Quote #8

Quote:
Originally Posted by StickP0le View Post
one question since iīm here whatīs the difference between equal/equali and contain/containi? already looked at his functions in amxmodx.org but i didnīt understand
i means case insenitive.

Quote:
Originally Posted by funcwiki
equali - Checks if two strings are equal, case insensitively.
Bookmark this: FuncWiki
__________________

Last edited by fysiks; 12-14-2011 at 01:18.
fysiks is offline
StickP0le
Senior Member
Join Date: Jan 2010
Location: cuantocabron.com
Old 12-14-2011 , 01:24   Re: Arument type mismatch
Reply With Quote #9

can you show me an example?
StickP0le is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-14-2011 , 01:28   Re: Arument type mismatch
Reply With Quote #10

Quote:
Originally Posted by StickP0le View Post
can you show me an example?
This is not the appropriate thread for questions not about the first post of a thread. Start your own if you've exhausted all other resources (other plugins, other threads, etc). (Guess I should have said this earlier).
__________________

Last edited by fysiks; 12-14-2011 at 01:30.
fysiks 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 11:46.


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