Raised This Month: $9 Target: $400
 2% 

Get info from page


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spiider
AlliedModders Donor
Join Date: Jan 2010
Old 08-29-2010 , 15:22   Get info from page
Reply With Quote #1

Hello,

it possible make a script to check every 2 minutos the status of player in website. Using a http get.
spiider is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 08-29-2010 , 15:29   Re: Get info from page
Reply With Quote #2

What do you mean?
RedRobster is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-29-2010 , 15:31   Re: Get info from page
Reply With Quote #3

Take a look here

http://forums.alliedmods.net/showpos...03&postcount=4
__________________
Bugsy is offline
spiider
AlliedModders Donor
Join Date: Jan 2010
Old 08-29-2010 , 15:34   Re: Get info from page
Reply With Quote #4

Quote:
Originally Posted by Bugsy View Post

i want make something similar but i want check every 2 minutes for all players in game by steamid
spiider is offline
spiider
AlliedModders Donor
Join Date: Jan 2010
Old 08-29-2010 , 15:44   Re: Get info from page
Reply With Quote #5

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <sockets>

new const g_szHost[] = "website.com";
new const 
g_szFile[] = "/check.php?steamid=";
new const 
g_szDataStart[] = "^r^n^r^n";


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
set_task(5.0,"cmd_GetData"
}


public 
cmd_GetDataid )
{
    new 
authid[32]
    
get_user_authid(id,steamid,31)
    new 
iSocket iError;

    
iSocket socket_openg_szHost 80 SOCKET_TCP iError );

    if( ( 
iSocket <= ) || iError )
        return 
PLUGIN_HANDLED;
        
    static 
szPacket[256];

    
g_TimedOutid ] = 0;
    
    
formatexszPacket 255 "GET %s%s HTTP/1.1^r^nHost: %s^r^nConnection: close^r^n^r^n" g_szFile,steamid g_szHost );

    
socket_sendiSocket szPacket strlenszPacket ) );
    
    
g_fSocketWaitid ] = get_gametime();

    new 
param];
    
param] = id;
    
param] = iSocket;
    
    if( !
task_exists5511 id ) )
        
set_task0.1 "CheckRecv" 5511 id param "b" );

    return 
PLUGIN_HANDLED;
}


public 
CloseSocketid iSocket )
{
    
remove_task5511 id );
    
socket_closeiSocket );


basic will be like this rigth ?
spiider is offline
DaxProxy
Senior Member
Join Date: Sep 2007
Old 08-30-2010 , 03:57   Re: Get info from page
Reply With Quote #6

You can't do ajax calls in CS if you meant that...
HTTP Get has nothing to do with Counter-Strike...
You can use sockets though which were in example.
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739
DaxProxy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-30-2010 , 23:41   Re: Get info from page
Reply With Quote #7

You will have to retrieve the entire file of steamids w\ a GET request and then check steam ids. How often is the remote file updated with new steamids?

This may work:
1. Retrieve file from server
2. Iterate through file, storing each steamid to trie
3. Check if player steamids exist in trie
__________________
Bugsy is offline
Reply


Thread Tools
Display Modes

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 22:50.


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