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


Messages In This Thread
Map Script dosn't work.. - by Negrosoo - 25.06.2009, 10:22
Re: Map Script dosn't work.. - by Chaprnks - 25.06.2009, 12:40
Re: Map Script dosn't work.. - by Negrosoo - 25.06.2009, 18:18
Re: Map Script dosn't work.. - by iLinx - 25.06.2009, 19:05

Forum Jump:


Users browsing this thread: 2 Guest(s)