Author Topic: SetTimer from Filterscript  (Read 3465 times)

0 Members and 1 Guest are viewing this topic.

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
SetTimer from Filterscript
« on: January 13, 2012, 01:47:35 am »
I decided to do a filterscript. [My first filterscript]

I started , i compiled and when i opened the server, he stop run and give me crash.

I made more modifications in filterscript but... the crash appear too.

I putted "//" before SetTimer in public OnFilterScriptExit()  and i compiled. Work ! The Server Run !

but... with out timer in public OnFilterScriptExit() , the filterscript = 0 .

what are the problem ? 

« Last Edit: January 13, 2012, 12:24:59 pm by sseebbyy »

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



yazeen

  • Guest
Re: SetTimer from Filterscript
« Reply #1 on: January 13, 2012, 04:52:04 am »
Show the script/ pm me :)

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: SetTimer from Filterscript
« Reply #2 on: January 13, 2012, 12:24:26 pm »
Code: [Select]
#include <a_vcmp>

#define COLOR_ORANGE 0xFF9011AA
#define COLOR_BLUE 0x33CCFFAA
#define COLOR_RED 0xED0700AA
#define COLOR_WHITE 0xFFFFFFAA
#define NOTACCES 0xFF0000AA

#define FILTERSCRIPT

new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];

forward PlayerHeal();

public OnFilterScriptInit()
{
SetTimer("PlayerHeal", 500, true); // if you put "//" before timer, the server run . if not, server stop.
return 1;
}

public OnFilterScriptExit()
{
   return 1;
}

public PlayerHeal()
{
for(new i=0;i<MAX_PLAYERS;i++) {
    if(IsPlayerConnected(i)) {
    new Float:healths,string[256];
    SetPlayerHealth(i,100);
        format(string,sizeof(string),"ThePunisher: [%d] %s Used Health-Hack ! [Player HP: %d]",i,gPlayers[i],healths);
        SendClientMessageToAll(NOTACCES,string);
}
}
}

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



yazeen

  • Guest
Re: SetTimer from Filterscript
« Reply #3 on: January 13, 2012, 01:43:56 pm »
Code: [Select]
#include <a_vcmp>

#define COLOR_ORANGE 0xFF9011AA
#define COLOR_BLUE 0x33CCFFAA
#define COLOR_RED 0xED0700AA
#define COLOR_WHITE 0xFFFFFFAA
#define NOTACCES 0xFF0000AA

#define FILTERSCRIPT

new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];

forward PlayerHeal();

public OnFilterScriptInit()
{
SetTimer("PlayerHeal", 500, true); // if you put "//" before timer, the server run . if not, server stop.
return 1;
}

public OnFilterScriptExit()
{
   return 1;
}

public PlayerHeal()
{
for(new i=0;i<MAX_PLAYERS;i++) {
    if(IsPlayerConnected(i)) {
    new Float:healths = GetPlayerHealth(i);
             new string[256];
    SetPlayerHealth(i,100);
        format(string,sizeof(string),"ThePunisher: [%d] %s Used Health-Hack ! [Player HP: %d]",i,gPlayers[i],healths);
        SendClientMessageToAll(NOTACCES,string);
}
}
}

I guess that works not tested :)

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: SetTimer from Filterscript
« Reply #4 on: January 13, 2012, 03:33:22 pm »
Code: [Select]
#include <a_vcmp>

#define COLOR_ORANGE 0xFF9011AA
#define COLOR_BLUE 0x33CCFFAA
#define COLOR_RED 0xED0700AA
#define COLOR_WHITE 0xFFFFFFAA
#define NOTACCES 0xFF0000AA

#define FILTERSCRIPT

new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];

forward PlayerHeal();

public OnFilterScriptInit()
{
SetTimer("PlayerHeal", 500, true); // if you put "//" before timer, the server run . if not, server stop.
return 1;
}

public OnFilterScriptExit()
{
   return 1;
}

public PlayerHeal()
{
for(new i=0;i<MAX_PLAYERS;i++) {
    if(IsPlayerConnected(i)) {
    new Float:healths = GetPlayerHealth(i);
             new string[256];
    SetPlayerHealth(i,100);
        format(string,sizeof(string),"ThePunisher: [%d] %s Used Health-Hack ! [Player HP: %d]",i,gPlayers[i],healths);
        SendClientMessageToAll(NOTACCES,string);
}
}
}

I guess that works not tested :)


not work  ;)

i think can't put timer on OnFilterScriptInit

and a little problem at you'r fs: new Float:healths = GetPlayerHealth(i);

need add and healths: new Float:healths = GetPlayerHealth(i,healths);

i know , you said "not tested" .

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: SetTimer from Filterscript
« Reply #5 on: January 14, 2012, 05:46:03 am »
 Try This:

Code: [Select]
#include <a_vcmp>

#define COLOR_ORANGE 0xFF9011AA
#define COLOR_BLUE 0x33CCFFAA
#define COLOR_RED 0xED0700AA
#define COLOR_WHITE 0xFFFFFFAA
#define NOTACCES 0xFF0000AA

#define FILTERSCRIPT

new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];

forward PlayerHeal();

public OnPlayerConnect(playerid)
{
SetTimer("PlayerHeal", 500, true); // if you put "//" before timer, the server run . if not, server stop.
return 1;
}
public OnFilterScriptInit()
{
return 0;
}

public OnFilterScriptExit()
{
   return 1;
}

public PlayerHeal()
{
for(new i=0;i<MAX_PLAYERS;i++) {
    if(IsPlayerConnected(i)) {
    new Float:healths = GetPlayerHealth(i);
             new string[256];
    SetPlayerHealth(i,100);
        format(string,sizeof(string),"ThePunisher: [%d] %s Used Health-Hack ! [Player HP: %d]",i,gPlayers[i],healths);
        SendClientMessageToAll(NOTACCES,string);
}
}
}
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: SetTimer from Filterscript
« Reply #6 on: January 14, 2012, 01:52:07 pm »
Hmmm, nice idea ;) thanx.


===TOPIC CLOSE===

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.