AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Arument type mismatch (https://forums.alliedmods.net/showthread.php?t=173986)

kramesa 12-13-2011 17:38

Arument type mismatch
 
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
    }



Jelle 12-13-2011 17:41

Re: Arument type mismatch
 
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.

drekes 12-13-2011 17:42

Re: Arument type mismatch
 
Because equali() expects a string value & you're using an integer.

Emp` 12-13-2011 17:43

Re: Arument type mismatch
 
From the code you provided it looks like you have very little scripting knowledge.

Either post in Suggestions/Requests or start reading Tutorials first.

kramesa 12-13-2011 18:02

Re: Arument type mismatch
 
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!

fysiks 12-13-2011 21:34

Re: Arument type mismatch
 
Quote:

Originally Posted by Emp` (Post 1612701)
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 (Post 1612710)
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.

StickP0le 12-14-2011 01:01

Re: Arument type mismatch
 
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

fysiks 12-14-2011 01:15

Re: Arument type mismatch
 
Quote:

Originally Posted by StickP0le (Post 1612872)
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

StickP0le 12-14-2011 01:24

Re: Arument type mismatch
 
can you show me an example?

fysiks 12-14-2011 01:28

Re: Arument type mismatch
 
Quote:

Originally Posted by StickP0le (Post 1612878)
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).


All times are GMT -4. The time now is 11:46.

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