How to create a onplayerconnect filterscript -
Rockers - 13.03.2013
Hi i want to know how to make it eg.
i did it in this manner
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" ANNOUNCE Filterscript by Rockers");
print("--------------------------------------\n");
return 1;
}
public OnPlayerConnect(playerid)
{
SendPlayerMessage("Welcome to our server plz type /register or /login.");
return 1;
}
#endif
error comes
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(16) : error 017: undefined symbol "SendPlayerMessage"
plz help me plz
Re: How to create a onplayerconnect filterscript -
Bikken - 13.03.2013
Replace SendPlayerMessage with SendClientMessage
Edit - forgot, so the new code comes like this under SendClientMessage
pawn Код:
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, COLOR_GREEN, "Welcome to our server plz type /register or /login.");
return 1;
}
Also, after #define a_samp, do #define COLOR_GREEN a space after.
SendPlayerMessage is now SendClientMessage, so the code above sends a text to every player on connection, the text provided in a green colour. Hope this helps. Also, look on
Color embedding, if you want to add multiple colours.
Re: How to create a onplayerconnect filterscript -
Rockers - 13.03.2013
Quote:
Originally Posted by Bikken
Replace SendPlayerMessage with SendClientMessage
Edit - forgot, so the new code comes like this under SendClientMessage
pawn Код:
public OnPlayerConnect(playerid) { SendClientMessage(playerid, COLOR_GREEN, "Welcome to our server plz type /register or /login."); return 1; }
Also, after #define a_samp, do #define COLOR_GREEN a space after.
SendPlayerMessage is now SendClientMessage, so the code above sends a text to every player on connection, the text provided in a green colour. Hope this helps. Also, look on Color embedding, if you want to add multiple colours.
|
error comes D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(16) : error 017: undefined symbol "COLOR_GREEN"
Re: How to create a onplayerconnect filterscript -
Bikken - 13.03.2013
Under #define a_samp and all your defines, the code should go like
pawn Код:
define <a_samp>
// And then, the color defines come down
#define COLOR_GREEN
Re: How to create a onplayerconnect filterscript -
Rockers - 13.03.2013
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(1) : error 074: #define pattern must start with an alphabetic character
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(11) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(13) : error 017: undefined symbol "print"
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(14) : error 017: undefined symbol "print"
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(15) : error 017: undefined symbol "print"
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(1
: warning 235: public function lacks forward declaration (symbol "OnPlayerConnect")
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(20) : error 017: undefined symbol "SendClientMessage"
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(20) : warning 215: expression has no effect
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(20) : error 001: expected token: ";", but found ")"
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(20) : error 029: invalid expression, assumed zero
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(20) : fatal error 107: too many error messages on one line
errors coming
ibeg u plz can u post the full pawn code plz i beg u?
Re: How to create a onplayerconnect filterscript -
Bikken - 13.03.2013
pawn Код:
#include <a_samp>
#define COLOR_GREEN 0x33AA33AA
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" ANNOUNCE Filterscript by Rockers");
print("--------------------------------------\n");
return 1;
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, COLOR_GREEN, "Welcome to our server plz type /register or /login.");
return 1;
}
Try this.
Re: How to create a onplayerconnect filterscript -
Rockers - 13.03.2013
sorry if i am annoying u but again error occured
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(1
: error 029: invalid expression, assumed zero
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(1
: error 029: invalid expression, assumed zero
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(1
: error 017: undefined symbol "FF00"
D:\Sa-MP SERVER\The Ultimate Freeroam\The Ultimate Freeroam\pawno\announce.pwn(1
: fatal error 107: too many error messages on one line
Re: How to create a onplayerconnect filterscript -
Bikken - 13.03.2013
Updated above code, did normal green hex code ID, my bad
Anyways, just settled it to a acceptable green color ID. Try now
Re: How to create a onplayerconnect filterscript -
gDarius - 13.03.2013
pawn Код:
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,-1,"Welcome to my server"); // Replace -1 with your colour, -1 = White.
return 1;
}
Re: How to create a onplayerconnect filterscript -
Weedie - 13.03.2013
Still have the issue?