27.05.2011, 21:42
Need help with IRC. i want to create /irc [TEXT] how to create it



!!!!!!!!!!!!!1





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;
}
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;
}
Here
pawn Код:
|
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.
If you find this easy, you could show the OP how to solve his problem instead of putting him and everyone else down.
|
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;
}