Warnings and script don't work
#2

I just fixed the indentation (..I think?), it was really messed up (tons of missing brackets and incorrect placement of return statements) and you're better off using something like ZCMD or sscanf, not strcmp.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(IsPlayerConnected(playerid))
    {
        new Float: radi, Float: str;
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;

        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);

                if (!strcmp(cmdtext, "/me", true, 3))
                {
                    if(!cmdtext[3]) return SendClientMessage(playerid, vermelho, "Usa: /me [Aзгo]");
                    new str[128];
                    GetPlayerName(playerid, str, sizeof(str));
                    format(str, sizeof(str), "* %s %s", str, cmdtext[4]);

                    if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                    {
                        SendClientMessage(i, roxo, "str");
                    }
                }

                return 0; // no clue why you're doing this here but you're better off using "break;"
            }
        }
    }

    return 0;
}
Reply


Messages In This Thread
Warnings and script don't work - by MacacoDoArtico - 13.08.2014, 00:35
Re: Warnings and script don't work - by Dignity - 13.08.2014, 00:42
Re: Warnings and script don't work - by MacacoDoArtico - 13.08.2014, 00:54
Re: Warnings and script don't work - by Stinged - 13.08.2014, 01:16
Re: Warnings and script don't work - by Dignity - 13.08.2014, 01:28
Re: Warnings and script don't work - by MacacoDoArtico - 13.08.2014, 01:41
Re: Warnings and script don't work - by MacacoDoArtico - 13.08.2014, 02:04
Re: Warnings and script don't work - by MacacoDoArtico - 13.08.2014, 02:58
Re: Warnings and script don't work - by Dignity - 13.08.2014, 03:02
Re: Warnings and script don't work - by MacacoDoArtico - 13.08.2014, 03:48

Forum Jump:


Users browsing this thread: 1 Guest(s)