SA-MP Forums Archive
Will this script work? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Will this script work? (/showthread.php?tid=94653)



Will this script work? - braduz - 31.08.2009

im new at the pawno stuff
Код:
new RandomMSG[][] =
{
  "Wolf bot: Are you stuck? get help (/help) ^^",
  "Wolf bot: This server is english only",
  "Wolf bot: Visit our website www.wolvez.co.cc",
  "Wolf bot: Wanna know who made what? find out (/credits)",
  "Wolf bot: See a cheater? report them (/report)",
  "Wolf bot: meh"
};
SetTimer("SendMSG", 200000, true);
forward SendMSG();
public SendMSG()
{
  
}
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(red, RandomMSG[randMSG]);
please correct it for me if its wrong


Re: Will this script work? - mirkoiz - 31.08.2009

pawn Код:
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(red, RandomMSG[randMSG]);
will have to be IN the
pawn Код:
public SendMSG()
{
 
}
like this

pawn Код:
public SendMSG()
{
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(red, RandomMSG[randMSG]);
}
edit:

pawn Код:
"Wolf bot: Visit our website http://www.wolvez.co.cc[url=http://]",
will show this URL thingy
pawn Код:



Re: Will this script work? - braduz - 31.08.2009

Quote:
Originally Posted by ►☺◄©ookie►☺◄
pawn Код:
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(red, RandomMSG[randMSG]);
will have to be IN the
pawn Код:
public SendMSG()
{
 
}
EDIT: oh reds allready there, will it work now?

like this

pawn Код:
public SendMSG()
{
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(red, RandomMSG[randMSG]);
}
Код:
new RandomMSG[][] =
{
  "Wolf bot: Are you stuck? get help (/help) ^^",
  "Wolf bot: This server is english only",
  "Wolf bot: Visit our website www.wolvez.co.cc",
  "Wolf bot: Wanna know who made what? find out (/credits)",
  "Wolf bot: See a cheater? report them (/report)",
  "Wolf bot: The official braduz motto "Immah teh tech wolf round theese areas"
};
SetTimer("SendMSG", 200000, true);
forward SendMSG();
public SendMSG()
{
  new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(red, RandomMSG[randMSG]);
}
tyvm How about an color red for the text?


Re: Will this script work? - mirkoiz - 31.08.2009

2. post edited...

You already send the message in color red or did you not definded the Color?


Re: Will this script work? - braduz - 31.08.2009

Quote:
Originally Posted by ►☺◄©ookie►☺◄
2. post edited...

You already send the message in color red or did you not definded the Color?
...define? all ive done is in the code


Re: Will this script work? - mirkoiz - 31.08.2009

Quote:
Originally Posted by braduz
...define? all ive done is in the code
pawn Код:
#define red 0xAA3333AA
new RandomMSG[][] =
{
  "Wolf bot: Are you stuck? get help (/help) ^^",
  "Wolf bot: This server is english only",
  "Wolf bot: Visit our website http://www.wolvez.co.cc[url=http://][/url]",
  "Wolf bot: Wanna know who made what? find out (/credits)",
  "Wolf bot: See a cheater? report them (/report)",
  "Wolf bot: The official braduz motto "Immah teh tech wolf round theese areas"
};
SetTimer("
SendMSG", 200000, true);
forward SendMSG();
public SendMSG()
{
  new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(red, RandomMSG[randMSG]);
}



Re: Will this script work? - braduz - 31.08.2009

Quote:
Originally Posted by ►☺◄©ookie►☺◄
pawn Код:
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(red, RandomMSG[randMSG]);
will have to be IN the
pawn Код:
public SendMSG()
{
 
}
the website url http http http is the forum tryna make it a link LOL nvm about tht

like this

pawn Код:
public SendMSG()
{
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(red, RandomMSG[randMSG]);
}
edit:

pawn Код:
will show this URL thingy



Re: Will this script work? - mirkoiz - 31.08.2009

To make it easyer for you
Load this as an Filterscript (create new .pwn.. complie and add [scriptname] to your filterscripts line)
pawn Код:
#include <a_samp>


new RandomMSG[][] =
{
  "Wolf bot: Are you stuck? get help (/help) ^^",
  "Wolf bot: This server is english only",
  "Wolf bot: Visit our website \"wolvez.co.cc\"",
  "Wolf bot: Wanna know who made what? find out (/credits)",
  "Wolf bot: See a cheater? report them (/report)",
  "Wolf bot: The official braduz motto \"Immah teh tech wolf round theese areas\""
};
#define FILTERSCRIPT
#define red 0xAA3333AA
new timermsg;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Random Messages Script");
    print("--------------------------------------\n");
    timermsg = SetTimer("SendMSG", 200000, true);
    return 1;
}

public OnFilterScriptExit()
{
    KillTimer(timermsg);
    return 1;
}

#endif
forward SendMSG();
public SendMSG()
{
    new randMSG = random(sizeof(RandomMSG));
    SendClientMessageToAll(red, RandomMSG[randMSG]);
    return 1;
}
(i hate the autofix of the forum ....)


Re: Will this script work? - braduz - 31.08.2009

Quote:
Originally Posted by ►☺◄©ookie►☺◄
To make it easyer for you
Load this as an Filterscript (create new .pwn.. complie and add [scriptname] to your filterscripts line)
pawn Код:
#include <a_samp>


new RandomMSG[][] =
{
  "Wolf bot: Are you stuck? get help (/help) ^^",
  "Wolf bot: This server is english only",
  "Wolf bot: Visit our website \"wolvez.co.cc\"",
  "Wolf bot: Wanna know who made what? find out (/credits)",
  "Wolf bot: See a cheater? report them (/report)",
  "Wolf bot: The official braduz motto \"Immah teh tech wolf round theese areas\""
};
#define FILTERSCRIPT
#define red 0xAA3333AA
new timermsg;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Random Messages Script");
    print("--------------------------------------\n");
    timermsg = SetTimer("SendMSG", 200000, true);
    return 1;
}

public OnFilterScriptExit()
{
    KillTimer(timermsg);
    return 1;
}

#endif
forward SendMSG();
public SendMSG()
{
    new randMSG = random(sizeof(RandomMSG));
    SendClientMessageToAll(red, RandomMSG[randMSG]);
    return 1;
}
(i hate the autofix of the forum ....)
ok thank you very much you have been of great help, but one last thing..what will the #include <here be called?>


Re: Will this script work? - kokkie20 - 31.08.2009

not, u need to add it in your server cfg file