hi.
Can anyone check this plugin and say whats wrong with it??

When i compile it, i get two errors:
Code:
/home/groups/amxmodx/tmp3/textFLiayE.sma(38) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/textFLiayE.sma(44) : warning 203: symbol is never used: "clantag"
I dont know why that argument make an error (coz it's a string ;/).
Also helpful would be to make an array instead of string clantag.
I know those could be stupid questions but im new with amxx scripting. I couldn't find any plugin that would do something like this, so I tried to make it ;D. I used to be only a webdeveloper ;P
Here's what I made: (it should add a "[Freelancer]" tag in front of nick if u dont have "[RoD]" tag in it.)
Code:
#include <amxmodx>
new NAME[] = "AddClanTag"
new AUTHOR[] = "Tede"
new VERSION[] = "0.5"
new String:clantag = "[RoD]"
public plugin_init()
{
register_plugin(NAME,VERSION,AUTHOR)
register_cvar("amx_addclantag","1")
}
public client_connect(id)
{
new name[32]
get_user_name(id, name, 32)
check_name(id,name)
return PLUGIN_CONTINUE
}
public client_infochanged(id)
{
if (is_user_connected(id)){
new newname[32]
get_user_info(id,"name",newname,32)
check_name(id,newname)
}
return PLUGIN_CONTINUE
}
public check_name(id,username[])
{
if (!get_cvar_num("amx_addclantag"))
{
return PLUGIN_CONTINUE
}
if (contain(username,clantag) == -1){
new nname[32]
format(nname,32,"[Freelancer]%s",username)
set_user_info(id,"name",nname)
}
return PLUGIN_CONTINUE
}
I tried to make an array so i changed line defining string for something like that:
Code:
new Array:clantags = {"[RoD]", "[SV]", "Cookies|"}
and function check_name for:
Code:
public check_name(id,username[])
{
if (!get_cvar_num("amx_addclantag"))
{
return PLUGIN_CONTINUE
}
new z = sizeof(clantags)
for ( new i; i < z - 1; i++ )
{
if (contain(username,clantags) == -1) PLUGIN_CONTINUE
}
new nname[32]
format(nname,32,"[Freelancer]%s",username)
set_user_info(id,"name",nname)
return PLUGIN_CONTINUE
}
but it still dont work ;(
i gives an error with argument type mismatch in if (contain(... but when I type clantags[i] it makes such errors:
Code:
/home/groups/amxmodx/tmp3/textFcaKJe.sma(41) : error 028: invalid subscript (not an array or too many subscripts): "clantags"
/home/groups/amxmodx/tmp3/textFcaKJe.sma(41) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/textFcaKJe.sma(41) : error 001: expected token: ";", but found "]"
/home/groups/amxmodx/tmp3/textFcaKJe.sma(41) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/textFcaKJe.sma(41) : fatal error 107: too many error messages on one line