getip irc command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: getip irc command (
/showthread.php?tid=607755)
getip irc command -
justjamie - 23.05.2016
Hello.
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;
}
Re: getip irc command -
justjamie - 23.05.2016
welp i already have it.
this
PHP код:
mysql_function_query(dbhandle,query,true,"GetIp","s",temp_name);
had to be this
PHP код:
mysql_function_query(dbhandle,query,true,"GetIP","s",temp_name);
welp
Re: getip irc command -
Pavintharan - 23.05.2016
return iEchoUse("That name isn't found in our database!"); < ?