Map Script dosn't work..
#1

Sorry for my english.. I'm italian......


I edited a script for communicate to my server where are my users in the map...
But when an user connect to my samp, the server crash, in logs ther'are no errors...

This is the code


Код:
#include <a_samp>

#define DLX_POS2XML_REFRESH  1000


enum Onlinetime
	{
	  seconds,
	  minutes,
	  hours
	};

new onlinetime[200][Onlinetime];
forward updatePositions();

public OnFilterScriptInit() {
	print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
	print("       MAPPA ONLINE ");
	print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");


	SetTimer("updatePositions", DLX_POS2XML_REFRESH, 1);

	return 1;
}

public OnFilterScriptExit() {
  print(" ~~~   mappa online   ~~~");
	return 1;
}
public OnPlayerConnect(playerid)
{
onlinetime[playerid][seconds] = 0;
onlinetime[playerid][minutes] = 0;
onlinetime[playerid][hours] = 0;
return 1;
}
public updatePositions() {
	for(new pCheck = 0; pCheck <= 200; pCheck++)
	{

	if(IsPlayerConnected(pCheck))
 	{
	onlinetime[pCheck][seconds]++;
	if(onlinetime[pCheck][seconds] == 60)
	{
 	onlinetime[pCheck][seconds] = 0;
 	onlinetime[pCheck][minutes]++;
	}
	
	if(onlinetime[pCheck][minutes] == 60)
	{
	onlinetime[pCheck][seconds] = 0;
	onlinetime[pCheck][minutes] = 0;
	onlinetime[pCheck][hours]++;
	}
	}
	}
	
	

	new string[256];
	new File:file;
  for(new i=0; i<MAX_PLAYERS; i++) {
	  if (IsPlayerConnected(i)) {
	    new pname[225];
		  GetPlayerName(i, pname, sizeof(pname));
		  format(string,sizeof(string),"http://www.guglio.net/gta.php?nome=%s", pname);
	   	file = fopen(string,io_read);
	  	fclose(file);
		}
	}
	  return 1;
}
Reply
#2

Quote:
Originally Posted by Negrosoo
Код:
format(string,sizeof(string),"http://www.guglio.net/gta.php?nome=%s", pname);
From what I know, you can't use fopen for external links.
Reply
#3

Ther'are no other ways for open external urls?
Reply
#4

you could try using the xsockets plugin ?
that lets you access external url's, servers etc
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)