#include <a_samp> forward Teszt(playerid); public OnFilterScriptInit() { print("Load Script"); return 1; } public OnFilterScriptExit() { print("Exit Script"); return 1; } public OnPlayerConnect(playerid) { SetTimerEx("Teszt",1000,0,"d",playerid); return 1; } public OnPlayerCommandText(playerid,cmdtext[]) { if(!strcmp(cmdtext,"/timer")) { print("Teszt CMD"); SetTimerEx("Teszt",1000,0,"d",playerid); return 1; } return 0; } public Teszt(playerid) { print("Teszt Runned"); return 1; }
[2013.03.19. 11:08:20] Filterscripts [2013.03.19. 11:08:20] --------------- [2013.03.19. 11:08:20] Loaded 0 filterscripts. Console input: loadfs tbug [2013.03.19. 11:08:27] Load Script [2013.03.19. 11:08:27] Filterscript 'tbug.amx' loaded. [2013.03.19. 11:08:54] Incoming connection: 127.0.0.1:3244 [2013.03.19. 11:08:55] [join] krichie has joined the server (0:127.0.0.1) // Teszt Runned ?! [2013.03.19. 11:09:02] Teszt CMD [2013.03.19. 11:09:03] Teszt Runned [2013.03.19. 11:09:15] Teszt CMD [2013.03.19. 11:09:16] Teszt Runned Console input: reloadfs tbug [2013.03.19. 11:09:20] Exit Script [2013.03.19. 11:09:20] Filterscript 'tbug.amx' unloaded. [2013.03.19. 11:09:20] Load Script [2013.03.19. 11:09:20] Filterscript 'tbug.amx' loaded. [2013.03.19. 11:09:24] Teszt CMD // Teszt Runned ?! [2013.03.19. 11:09:29] Teszt CMD [2013.03.19. 11:09:30] Teszt Runned
Console input: loadfs tbug [2013.03.19. 11:23:43] Load Script [2013.03.19. 11:23:43] Filterscript 'tbug.amx' loaded. [2013.03.19. 11:24:07] Incoming connection: 127.0.0.1:3406 [2013.03.19. 11:24:07] [join] krichie has joined the server (0:127.0.0.1) // Teszt Runned ?! [2013.03.19. 11:24:13] [part] krichie has left the server (0:1) [2013.03.19. 11:24:36] Incoming connection: 127.0.0.1:3409 [2013.03.19. 11:24:36] [join] krichie has joined the server (0:127.0.0.1) [2013.03.19. 11:24:37] Teszt Runned [2013.03.19. 11:24:39] [part] krichie has left the server (0:1)
// Results:
[12:49:04] [join] Dwane has joined the server (0:127.0.0.1)
[12:49:06] Teszt Runned
[12:49:12] Teszt CMD
[12:49:13] Teszt Runned
[12:49:16] [part] Dwane has left the server (0:1)
#define FILTERSCRIPT
#include <a_samp>
forward Teszt(playerid);
public OnFilterScriptInit()
{
print("Load Script");
return 1;
}
public OnFilterScriptExit()
{
print("Exit Script");
return 1;
}
public OnPlayerConnect(playerid)
{
SetTimerEx("Teszt",1000,0,"d",playerid); // 1st message
return 1;
}
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp(cmdtext, "/timer", true))
{
print("Teszt CMD"); //2nd message
SetTimerEx("Teszt",1000,0,"d",playerid); // 3rd message
return 1;
}
return 0;
}
public Teszt(playerid)
{
print("Teszt Runned"); // 1st message and 3rd message
return 1;
}
It worked fine for me.
pawn Код:
pawn Код:
|
OnPlayerDisconnect is only called for the first fioterscript that is loaded.
|