SA-MP Forums Archive
Whats wrong - 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)
+--- Thread: Whats wrong (/showthread.php?tid=322124)



Whats wrong - SnG.Scot_MisCuDI - 29.02.2012

Solved


Re: Whats wrong - Tanush123 - 29.02.2012

Well i cannot script IRC, try doing this
pawn Код:
// Echo the formatted message
            if(!IRC_IsAdmin(botid,channel,user))
            {
            format(msg, sizeof(msg), "02*** %s on IRC: %s", user, params);
            IRC_GroupSay(gGroupID, channel, msg);
            format(msg, sizeof(msg), "*** %s on IRC: %s", user, params);
            SendClientMessageToAll(0xffffffff, msg);
            }
            else if (IRC_IsAdmin(botid, channel, user))
            {
            format(msg, sizeof(msg), "*** Admin %s on IRC: %s", user, params);
            SendClientMessageToAll(0xffffffff, msg);
            }



Re: Whats wrong - ryansheilds - 29.02.2012

Remove the "else"? I don't think its required.


Re: Whats wrong - SnG.Scot_MisCuDI - 29.02.2012

If i remove the else it sends 2 messages, one just normal and another saying admin


Quote:
Originally Posted by Tanush123
Посмотреть сообщение
Well i cannot script IRC, try doing this
pawn Код:
// Echo the formatted message
            if(!IRC_IsAdmin(botid,channel,user))
            {
            format(msg, sizeof(msg), "02*** %s on IRC: %s", user, params);
            IRC_GroupSay(gGroupID, channel, msg);
            format(msg, sizeof(msg), "*** %s on IRC: %s", user, params);
            SendClientMessageToAll(0xffffffff, msg);
            }
            else if (IRC_IsAdmin(botid, channel, user))
            {
            format(msg, sizeof(msg), "*** Admin %s on IRC: %s", user, params);
            SendClientMessageToAll(0xffffffff, msg);
            }
It works but it doesnt echo it back into IRC


Re: Whats wrong - Richie© - 29.02.2012

read wrong


Re: Whats wrong - ryansheilds - 29.02.2012

Hmm, how about this:
pawn Код:
IRCCMD:say(botid, channel[], user[], host[], params[])
{
    // Check if the user has at least voice in the channel
    if (IRC_IsVoice(botid, channel, user))
    {
        // Check if the user entered any text
        if (!isnull(params))
        {
            new
                msg[128];
            // Echo the formatted message
            if (IRC_IsAdmin(botid, channel, user))
            {
                format(msg, sizeof(msg), "*** Admin %s on IRC: %s", user, params);
                SendClientMessageToAll(0xffffffff, msg);
            }
            else
            {
                format(msg, sizeof(msg), "02*** %s on IRC: %s", user, params);
                IRC_GroupSay(gGroupID, channel, msg);
                format(msg, sizeof(msg), "*** %s on IRC: %s", user, params);
                SendClientMessageToAll(0xffffffff, msg);
            }
        }
    }
    return 1;
}



Re: Whats wrong - SnG.Scot_MisCuDI - 29.02.2012

Still wont echo it into IRC :/
It shows good in-game though


Re: Whats wrong - ryansheilds - 29.02.2012

Oh, so just add:
pawn Код:
format(msg, sizeof(msg), "*** Admin %s on IRC: %s", user, params);
                IRC_GroupSay(gGroupID, channel, msg);
Below:
pawn Код:
if (IRC_IsAdmin(botid, channel, user))
            {
                format(msg, sizeof(msg), "*** Admin %s on IRC: %s", user, params);
                SendClientMessageToAll(0xffffffff, msg);
?


Re: Whats wrong - SnG.Scot_MisCuDI - 29.02.2012

Oh yeah didnt even think about that. Derp :P Testing and +rep to all of you