/me and /irc :O
#1

it compiles with 2 errors which are causing me to get unkown cmd in-game

Код:
W:\Users\Mom & Dad\Documents\samp03dsvr_R2_win32\gamemodes\lvcnr.pwn(349) : warning 225: unreachable code
W:\Users\Mom & Dad\Documents\samp03dsvr_R2_win32\gamemodes\lvcnr.pwn(352) : warning 219: local variable "str" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
and my code:

pawn Код:
if (strcmp("/me", cmdtext, true, 3))
    {
        if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        SendClientMessageToAll(COLOR_WHITE, str);
        IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
        IRC_GroupSay(gGroupID, ADMIN_IRC_CHANNEL, str);
        return 1;
    }
    if (strcmp("/irc", cmdtext, true, 3) == 0)
    {
        if (!cmdtext[3])return SendClientMessage(playerid, COLOR_RED, "USAGE: /irc (message)");
        new ircmsg[128];
        format(ircmsg, sizeof(ircmsg), "02To IRC: %s(%d) said:%s", ircmsg,GetName(playerid), playerid, cmdtext[4]);
        IRC_GroupSay(gGroupID, IRC_CHANNEL, ircmsg);
        IRC_GroupSay(gGroupID, ADMIN_IRC_CHANNEL, ircmsg);
        SendClientMessage(playerid, COLOR_YELLOW, "Message Sent To Irc");
        return 1;
    }
Reply


Messages In This Thread
/me and /irc :O - by logoster - 01.05.2012, 00:58
Re: /me and /irc :O - by Joe Staff - 01.05.2012, 01:03
Re: /me and /irc :O - by logoster - 01.05.2012, 17:18
Re: /me and /irc :O - by Mimic - 01.05.2012, 17:19
Re: /me and /irc :O - by SnG.Scot_MisCuDI - 02.05.2012, 01:04
Re: /me and /irc :O - by MP2 - 02.05.2012, 02:20
Re: /me and /irc :O - by logoster - 02.05.2012, 17:30

Forum Jump:


Users browsing this thread: 1 Guest(s)