23.05.2016, 14:30
Hello.
I have this command, but when i enter My_Name inside the command, nothing happends.
What did i do wrong?
I have this command, but when i enter My_Name inside the command, nothing happends.
What did i do wrong?
PHP код:
forward GetIP(temp_name[]);
public GetIP(temp_name[])
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==0)
{
return iEchoUse("That name isn't found in our database!");
}
else
{
new string[420],temp_ip[35];
cache_get_field_content(0, "regip", temp_ip);
format(string,sizeof(string),"%s's ip is %s",temp_name,temp_ip);
iEcho(string);
}
return true;
}
PHP код:
IRCCMD:getip(botid, channel[], user[], host[], params[])
{
if(!IsEchoChannel(channel)) return iNotice( user, IRC_WRONG_CHANNEL);
new query[128],temp_name[35];
if(sscanf(params, "s", temp_name)) return iEchoUse("!getip [ Exact_Name ]");
format(query,sizeof(query),"SELECT * FROM user WHERE username ='%s'",temp_name);
mysql_function_query(dbhandle,query,true,"GetIp","s",temp_name);
return 1;
}