Join/Leave messages not showing :(
#1

pawn Код:
//Leaving types
new aDisconnectNames[][16] = {
    {"Timeout"}, // 0
    {"Leaving"}, // 1
    {"Kicked"} // 2
};
//On Player Connect
public OnPlayerConnect(playerid)
{
    new string[128];
    new pname[24];
    //CODES FOR LOGIN AND LOAD DATA AND STuFF
    SetPlayerColor(playerid, COLOR_DEADCONNECT);
    ResetVariables(playerid);
    GetPlayerName(playerid,pname,sizeof(pname));
    format(string,sizeof(string),"%s(%d) Has joined the server.",pname,playerid);
    SendClientMessageToAll(COLOR_CYAN,string);
    format(string,sizeof(string),"6%s(%d) Has joined the server.",pname,playerid);
    IRC_Say(gGroupID,IRC_CHANNEL,string);
    IRC_Say(gGroupID,IRC_ADMINCHANNEL,string);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new string[128];
    new pname[24];
     ///OTHER CODES FOR SAVING PLAYER DATA
   
    ResetVariables(playerid);
    GetPlayerName(playerid,pname,sizeof(pname));
    format(string,sizeof(string),"%s(%d) Has left the server. (%s)",pname,playerid,aDisconnectNames[reason]);
    SendClientMessageToAll(COLOR_CYAN,string);
    format(string,sizeof(string),"1%s(%d) Has just left the server. (%s)",pname,playerid, aDisconnectNames[reason]);
    IRC_Say(gGroupID,IRC_CHANNEL,string);
    IRC_Say(gGroupID,IRC_ADMINCHANNEL,string);
    return 1;
}
Title says it all, I don't know why that happened, it happened suddenly happened!
it's not sending ingame nor on IRC
no compiling errors at all, help?
Reply
#2

Well, this is from the IRC script of mine. Hopefully this works.

pawn Код:
public OnPlayerConnect(playerid)
{
    new joinMsg[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(joinMsg, sizeof(joinMsg), "02[%d] 03*** %s has joined the server.", playerid, name);
    IRC_GroupSay(groupID, IRC_CHANNEL, joinMsg);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[8];
    switch(reason)
    {
        case 0: reasonMsg = "Timeout";
        case 1: reasonMsg = "Leaving";
        case 2: reasonMsg = "Kicked";
    }
    GetPlayerName(playerid, name, sizeof(name));
    format(leaveMsg, sizeof(leaveMsg), "02[%d] 03*** %s has left the server. (%s)", playerid, name, reasonMsg);
    IRC_GroupSay(groupID, IRC_CHANNEL, leaveMsg);
    return 1;
}
Could be the IRC_Say problem, so... change it to IRC_GroupSay.
Reply
#3

can be a problem that causes crash to ur callback (i am predicting its from ResetVariables)

so check if theres some pproblem with it or post it here if u cant find the problem.

- sorry for my typos im on phone
Reply
#4

Zex Tan, that didn't solve it

Kirollos
here's my reset variables

pawn Код:
//============================================================================//
public ResetVariables(playerid)
{
    IsSpawned[playerid] =0;
    IsMuted[playerid] =0;
    IsFrozen[playerid] =0;
    IsReclassed[playerid] =0;
   
    //Group system
    LeaveGroup(playerid, 2);
   
    //Civilian Variables
    AttemptedToRobRecently[playerid] =0;
    HasRobbedRecently[playerid] =0;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)