SA-MP Forums Archive
IRC - 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: IRC (/showthread.php?tid=257825)



IRC - SpiderWalk - 27.05.2011

Need help with IRC. i want to create /irc [TEXT] how to create it!!!!!!!!!!!!!1


Re: IRC - Captain Price - 27.05.2011

easy... are you call yourself scripter?


Re: IRC - Venice - 27.05.2011

Quote:
Originally Posted by Captain Price
Посмотреть сообщение
easy... are you call yourself scripter?
lol Yeh


Re: IRC - linuxthefish - 27.05.2011

Quote:
Originally Posted by Captain Price
Посмотреть сообщение
easy... are you call yourself scripter?
If you find this easy, you could show the OP how to solve his problem instead of putting him and everyone else down.


Re: IRC - Ghost_BB - 27.05.2011

pawn Код:
dcmd_ircpm(playerid,params[])
{
new string[128];
if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /ircpm [Message]");
        return 1;
    }
format(string, sizeof(string), "10[IRC PM] %s: %s",GetPlayerName(playerid),params);
IRC_GroupSay(gGroupID, IRC_CHANNEL,string);
return 1;
}



Re: IRC - Venice - 27.05.2011

Here
pawn Код:
if(strcmp(cmd, "/irc", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new string[126];
            GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
            new result[128];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /irc [text]");
                return 1;
            }
            format(string, sizeof(string), "[IRC]: %s (%d): %s", sendername,playerid, (result));
            IRC_GroupSay(IRC_Group,EchoChan, string);//change this to your irc group name
            SendClientMessage(playerid, 0xE09B1BAA, string);
            SendClientMessage(playerid, 0xE01B1BAA, "Your Message Has Been Sended To IRC");
        }
        return 1;
    }



Re: IRC - SpiderWalk - 28.05.2011

Quote:
Originally Posted by venice
Посмотреть сообщение
Here
pawn Код:
if(strcmp(cmd, "/irc", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new string[126];
            GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
            new result[128];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /irc [text]");
                return 1;
            }
            format(string, sizeof(string), "[IRC]: %s (%d): %s", sendername,playerid, (result));
            IRC_GroupSay(IRC_Group,EchoChan, string);//change this to your irc group name
            SendClientMessage(playerid, 0xE09B1BAA, string);
            SendClientMessage(playerid, 0xE01B1BAA, "Your Message Has Been Sended To IRC");
        }
        return 1;
    }
Thank you for codes but i have this errors and i dont know how to fix it!?
Код:
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(514) : error 017: undefined symbol "idx"
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(516) : error 017: undefined symbol "idx"
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(516) : warning 215: expression has no effect
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(518) : error 017: undefined symbol "idx"
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(520) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(522) : error 017: undefined symbol "idx"
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(524) : error 017: undefined symbol "idx"
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(525) : error 017: undefined symbol "idx"
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(525) : warning 215: expression has no effect
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(527) : error 017: undefined symbol "idx"
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(533) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\General_Alpha.pwn(534) : error 017: undefined symbol "IRC_Group"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


10 Errors.



Re: IRC - Captain Price - 28.05.2011

Quote:
Originally Posted by linuxthefish
Посмотреть сообщение
If you find this easy, you could show the OP how to solve his problem instead of putting him and everyone else down.
First: There is The way of "HTTP"! to write into a chat.
Second there are includes (that i don't have becouse i don't use) with special Callbacks and functions of IRC!


Re: IRC - SpiderWalk - 28.05.2011

I mean how to fix that errors!!!!


Re: IRC - Biesmen - 28.05.2011

Don't use Venice's method, that one sucks very hard.
Use ZCMD/DCMD and SSCANF2. Example code:
ZCMD:
pawn Код:
CMD:irc(playerid, params[])
{
    new message[128], pName[24];
    GetPlayerName(playerid, pName, 24);
    sscanf(params, "s[128]", message)) return SendClientMessage(playerid, -1, "Usage: /irc [Message]");
    format(message, sizeof(message), "[IRC] %s: %s", pName, message);
    IRC_GroupSay(GroupID, target, message); // Change this to your own configuration (GroupID and target)
    SendClientMessage(playerid, -1, "Your message has been sent.");
    return 1;
}