Hello There, Guest! Login or Register


Help is needed
#1
Hi,

I have a weird problem with my IRC script. The join & leave message just don't show. I asked a lot of scripters and in #sa-mp.scripting. But they couldn't help me.

I'm wondering if someone could check this for me.

http://pastebin.com/f2b51e82a

(the script doesn't give any errors / warnings when compiling, the messages just don't show).

Thanks
:w
#2
This is taken from other echo script, but might aswell do the trick:

Code:
public OnPlayerConnect(playerid)
{
    format(lolz, sizeof(lolz), "14*** %s has joined the server.",PlayerName(playerid));
    Echo(lolz);
    return true;
}

public OnPlayerDisconnect(playerid, reason)
{
    format(lolz,256, "14*** %s has left the server. (%s)1", PlayerName(playerid), Dcon[reason]);
    ircSay(RandomBot(), ECHOCHAN, lolz);
    return true;
}
#3
Do other messages show? Like OnPlayerDeath and OnPlayerText?
#4
There is nothing wrong with the OnPlayer(Dis)Connect callbacks in that code. It could be the ircSay function. Try adding debug statements.
#5
@ estroeFireburn: Jup

@ Jay: Could you tell me how to do that?
#6
Untested:

http://pastebin.com/m90f1501

EDIT: Debugging a script is simple, just add printf statements to several lines .. examply;

printf("GetPlayerName = %s", PlayerName); under the GetPlayerName function, to check if its receiving the name.
printf("Ingame join message received"); under your message to tell people ingame that a player joined
printf("irc string formatted"); under the format(....) of you irctext
printf("irc string sent"); under your IrcSay();

Every printf statement will be put into your server_log.txt

If any printf  is missing, you can find the error easily.
#7
Sorry for the estroe - fireburn thingy, I was at ma PSP and I didn't really look who was talking to me :D.

Sorry for posting too late, and thanks woot and everybody else, but it has sorta sorted itsself :s.
Somehow it just got fixed, no idea how.