SA-MP Forums Archive
[Ajuda]/cinto da bug - 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]/cinto da bug (/showthread.php?tid=225840)



[Ajuda]/cinto da bug - [Dk]TuReTOo - 14.02.2011

Boas, tipo eu uso o comando /cinto e diz (ex: "Ricardo_Jorge meteu o cinto de seguranзa") mas quando volto a usar /cinto de seguranзa para tirar o cinto diz (ex: "Ricardo_Jorge meteu o cinto de seguranзa") mas eu queria que dise-se (ex: "Ricardo_Jorge tirou o cinto de seguranзa")


agradeзo



pawn Код:
if(strcmp(cmd, "/cinto", 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) && IsPlayerInAnyVehicle(playerid) == 0)
            { //line 124
                SendClientMessage(playerid, COLOR_RED, "Vocк nгo estб em um veiculo");
                return 1;
            }
            else if(IsPlayerInAnyVehicle(playerid) == 1 && cinto[playerid] == 0)
            {
                cinto[playerid] = 0;
                SendClientMessage(playerid, COLOR_GREEN, "Vocк meteu o cinto de seguranзa.");
                format(string, sizeof(string), "* %s meteu o cinto de seguranзa.", sendername);
                TogglePlayerControllable(playerid, 1);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                printf("%s", string);
                                        }
            else if(IsPlayerInAnyVehicle(playerid) == 1 && cinto[playerid] == 1)
            {
                cinto[playerid] = 0;
                SendClientMessage(playerid, COLOR_RED, "Vocк tirou seu cinto");
                format(string, sizeof(string), "* %s tirou o cinto de seguranзa.", sendername);
                TogglePlayerControllable(playerid, 1);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                printf("%s", string);
            }
        }
        return 0;
    }



Re: [Ajuda]/cinto da bug - deregudegu - 14.02.2011

Eu arrumei, vк se funciona.

pawn Код:
if(strcmp(cmd, "/cinto", true) == 0)//inicio do cmd
    {
        if(IsPlayerConnected(playerid))//se o plyar estiver online
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));//pega o nome
            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) && IsPlayerInAnyVehicle(playerid) == 0)//se o player usar o cmd e naum estiver em um veiculo
            { //line 124
                SendClientMessage(playerid, COLOR_RED, "Vocк nгo estб em um veiculo");
                return 1;
            }
            else if(IsPlayerInAnyVehicle(playerid) == 1 && cinto[playerid] == 0)//se ele usar o cmd e naum estiver usando o cinto
            {
                cinto[playerid] = 1;//declara o cinto como 1, assim deixando o player com cinto
                SendClientMessage(playerid, COLOR_GREEN, "Vocк meteu o cinto de seguranзa.");
                format(string, sizeof(string), "* %s meteu o cinto de seguranзa.", sendername);
                TogglePlayerControllable(playerid, 1);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                printf("%s", string);
                                        }
            else if(IsPlayerInAnyVehicle(playerid) == 1 && cinto[playerid] == 1)//se usa o cmd e com o cinto, tira o cinto
            {
                cinto[playerid] = 0;//declara o cinto 0, assim deixando sem cinto
                SendClientMessage(playerid, COLOR_RED, "Vocк tirou seu cinto");
                format(string, sizeof(string), "* %s tirou o cinto de seguranзa.", sendername);
                TogglePlayerControllable(playerid, 1);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                printf("%s", string);
            }
        }
        return 0;
    }



Re: [Ajuda]/cinto da bug - Ricop522 - 14.02.2011

Simples lol
pawn Код:
if(strcmp(cmd, "/cinto", 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) && IsPlayerInAnyVehicle(playerid) == 0)
            { //line 124
                SendClientMessage(playerid, COLOR_RED, "Vocк nгo estб em um veiculo");
                return 1;
            }
            else if(IsPlayerInAnyVehicle(playerid) == 1 && cinto[playerid] == 0)
            {
                cinto[playerid] = 1; //VocК esqueceu de definir o 0 para 1
                SendClientMessage(playerid, COLOR_GREEN, "Vocк meteu o cinto de seguranзa.");
                format(string, sizeof(string), "* %s meteu o cinto de seguranзa.", sendername);
                TogglePlayerControllable(playerid, 1);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                printf("%s", string);
                                        }
            else if(IsPlayerInAnyVehicle(playerid) == 1 && cinto[playerid] == 1)
            {
                cinto[playerid] = 0;
                SendClientMessage(playerid, COLOR_RED, "Vocк tirou seu cinto");
                format(string, sizeof(string), "* %s tirou o cinto de seguranзa.", sendername);
                TogglePlayerControllable(playerid, 1);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                printf("%s", string);
            }
        }
        return 0;
    }



Re: [Ajuda]/cinto da bug - [Dk]TuReTOo - 14.02.2011

obrigado