datagram.inc: File or Function Not Found
#1

I saw that datagram.inc is present with sa-mp server package. I tried to use it, and it didn't work, I searched on SA-MP Wiki, but there isn't any datagram function.

How can I use it?? It can be useful to (ad example) communicate with other servers.

This is the INCLUDE File:

pawn Код:
/* Datagram sending/receiving
 *
 * © Copyright 2005, ITB CompuPhase
 * This file is provided as is (no warranties).
 */

#if defined _datagram_included
  #endinput
#endif
#define _datagram_included
#pragma library DGram

native sendstring(const message[], const destination[]="");
native sendpacket(const packet[], size, const destination[]="");

native listenport(port);

forward @receivestring(const message[], const source[]);
forward @receivepacket(const packet[], size, const source[]);
Another thing: I noticed that Compuphase's original TIME.INC was modified, the original file is:

pawn Код:
/* Date/time functions
 *
 * © Copyright 2001-2005, ITB CompuPhase
 * This file is provided as is (no warranties).
 */

#if defined _time_included
  #endinput
#endif
#define _time_included
#pragma library Time

native gettime(&hour=0, &minute=0, &second=0);
native settime(hour=cellmin, minute=cellmin, second=cellmin);
native getdate(&year=0, &month=0, &day=0);
native setdate(year=cellmin, month=cellmin, day=cellmin);
native settimestamp(seconds1970);

native settimer(milliseconds, bool: singleshot=false);
native tickcount(&granularity=0);
native delay(milliseconds);

forward @timer();
But SA-MP's one has only 3 functions: gettime, getdate and tickcount. Why didn't they implement the other functions in sa-mp too? The time stamp can be useful.
Reply
#2

I see no reason why you would need to set time, date or timestamp. The current unix timestamp can be retrieved if you use gettime without parameters (i.e. unixtime = gettime(); ).
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
I see no reason why you would need to set time, date or timestamp. The current unix timestamp can be retrieved if you use gettime without parameters (i.e. unixtime = gettime(); ).
Thanks, I didn't know, but do you know why datagram doesn't work?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)