SA-MP Forums Archive
[Ajuda] Comando crashando players perto - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Comando crashando players perto (/showthread.php?tid=436276)



Comando crashando players perto - Baiano - 10.05.2013

Quando digita '/cnn ~' os players prуximo de quem digitou da crash. O que pode ser?

pawn Код:
if(strcmp(cmd, "/cnn", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[64];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                if(!strlen(result))
                {
                    SendClientMessage(playerid, COR_USOCORRETO, "Uso correto: /cnn [texto]");
                    return 1;
                }
                format(string, sizeof(string), "~b~%s: ~w~%s",sendername,result);
                for(new i = 0; i < MAX_PLAYERS; i++)
                if(GetDistanceBetweenPlayers(playerid, i) <= 50)
                {
                    if(IsPlayerConnected(i))
                    {
                        GameTextForPlayer(i, string, 5000, 5);
                    }
                }
                return 1;
            }
        }
        return 1;
    }



Re: Comando crashando players perto - TreePuncher - 10.05.2013

Crie um objeto que de crash para cada player individualmente :>


Re: Comando crashando players perto - Coreia - 10.05.2013

Sу impedir de ele digitar '~' Usandotrfind.