25.06.2009, 10:22
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
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; }