Raised This Month: $51 Target: $400
 12% 

[TF2]Send message to URL


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
davelu
Junior Member
Join Date: Jul 2007
Old 07-22-2013 , 04:38   [TF2]Send message to URL
Reply With Quote #1

Need someone to make more function for OnClientPostAdminCheck.


Sorry to take up your time to read this text.I'm Chinese so fogive my poor grammar.

I have be isolated and helpless beacause I do not understand how to do it.

I need to send IP address to specific URL (http://www.youdao.com/smartresult-xm...ack&type=ip&q=)

e.g
http://www.youdao.com/smartresult-xm...e=ip&q=8.8.8.8

return this:
fYodaoCallBack(1, {'product':'ip','ip':'8.8.8.8','location':'美国 加利福尼亚州山景市谷歌公司DNS服务器'} , '');

I need PrintToChatAll '美国 加利福尼亚州山景市谷歌公司DNS服务器'

I wish someone could give me the sp file.Thanks very much.
davelu is offline
mcpan313
Senior Member
Join Date: Mar 2010
Old 07-22-2013 , 06:07   Re: [TF2]Send message to URL
Reply With Quote #2

This webapi charset = gbk, not utf8, results is unreadable.
__________________
sorry, for my poor english.
mcpan313 is offline
Send a message via MSN to mcpan313
davelu
Junior Member
Join Date: Jul 2007
Old 07-22-2013 , 21:38   Re: [TF2]Send message to URL
Reply With Quote #3

Quote:
Originally Posted by mcpan313 View Post
This webapi charset = gbk, not utf8, results is unreadable.

OK, I can use this: http://ip.genhaosan.com/ip.php?ip=8....n&charset=utf8

format(txt,js,json) charset(utf8,gbk)

please help me, thanks.
davelu is offline
mcpan313
Senior Member
Join Date: Mar 2010
Old 07-23-2013 , 04:05   Re: [TF2]Send message to URL
Reply With Quote #4

'

Required Socket Extension

PHP Code:
/**
 * triggered if get ip location.
 *
 * @param location      ip location.
 * @param data          data passed in via Tools_GetIpLocation().
 * @noreturn
 */
functag public GetIpLocationCB(const String:location[], any:data);

/**
 * get ip location use socket.
 *
 * @param ip            ip address.
 * @param callback      result callback.
 * @param data          extra data value to pass to the callback.
 * @noreturn
 */
native Tools_GetIpLocation(const String:ip[], GetIpLocationCB:callbackany:data=0); 
Example:
PHP Code:
#include "tools.getiplocation"

public OnClientPutInServer(client)
{
    if (!
IsFakeClient(client))
    {
        
decl String:ip[17];
        
GetClientIP(clientipsizeof(ip));
        
Tools_GetIpLocation(ipOnGetIpLocationGetClientUserId(client));
    }
}

public 
OnGetIpLocation(const String:location[], any:userid)
{
    new 
client GetClientOfUserId(userid);
    if (
client)
    {
        
PrintToChatAll("%N 来自 %s"clientlocation);
        
LogMessage("%N 来自 %s"clientlocation);
    }

Attached Files
File Type: sp Get Plugin or Get Source (tools.getiplocation.sp - 151 views - 2.6 KB)
File Type: inc tools.getiplocation.inc (754 Bytes, 124 views)
File Type: sp Get Plugin or Get Source (example.getiplocation.sp - 129 views - 752 Bytes)
__________________
sorry, for my poor english.
mcpan313 is offline
Send a message via MSN to mcpan313
davelu
Junior Member
Join Date: Jul 2007
Old 07-24-2013 , 02:41   Re: [TF2]Send message to URL
Reply With Quote #5

Quote:
Originally Posted by mcpan313 View Post
'

Required Socket Extension

PHP Code:
/**
 * triggered if get ip location.
 *
 * @param location      ip location.
 * @param data          data passed in via Tools_GetIpLocation().
 * @noreturn
 */
functag public GetIpLocationCB(const String:location[], any:data);
 
/**
 * get ip location use socket.
 *
 * @param ip            ip address.
 * @param callback      result callback.
 * @param data          extra data value to pass to the callback.
 * @noreturn
 */
native Tools_GetIpLocation(const String:ip[], GetIpLocationCB:callbackany:data=0); 
Example:
PHP Code:
#include "tools.getiplocation"
 
public OnClientPutInServer(client)
{
    if (!
IsFakeClient(client))
    {
        
decl String:ip[17];
        
GetClientIP(clientipsizeof(ip));
        
Tools_GetIpLocation(ipOnGetIpLocationGetClientUserId(client));
    }
}
 
public 
OnGetIpLocation(const String:location[], any:userid)
{
    new 
client GetClientOfUserId(userid);
    if (
client)
    {
        
PrintToChatAll("%N 来自 %s"clientlocation);
        
LogMessage("%N 来自 %s"clientlocation);
    }


Fine, you are great, Thanks!

Can you give me your QQ Num? Mine is 5309617.
davelu is offline
mcpan313
Senior Member
Join Date: Mar 2010
Old 07-24-2013 , 10:24   Re: [TF2]Send message to URL
Reply With Quote #6

Quote:
Originally Posted by davelu View Post
Can you give me your QQ Num?
774436
__________________
sorry, for my poor english.
mcpan313 is offline
Send a message via MSN to mcpan313
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 09:48.


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