[AJUDA] " /trancar " do VIP Bugado
#1

Olб Pessoal !
Estou com um bug , que , inevitavelmente , nгo consigo tirar ...
Creio que o Bug esteja em [cLockCar] .
Cуdigo :
pawn Код:
if(strcmp(tmp, "trancar", true) == 0)
        {
            if(PlayerInfo[playerid][pCarKey] == 0 && PlayerInfo[playerid][pCarKey2] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Carro VIP.");
                return true;
            }
            if(PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid)
            {
                SendClientMessage(playerid, COLOR_GREY, "Esse nгo й seu Carro VIP.");
                return true;
            }
            new keycar;
            if(vehid == PlayerInfo[playerid][pCarKey]) { keycar = PlayerInfo[playerid][pVeiculo]; }
            else if(vehid == PlayerInfo[playerid][pCarKey2]) { keycar = PlayerInfo[playerid][pVeiculo2]; }
            if(IsPlayerConnected(playerid))
            {
                if(CarInfo[keycar][cLock] == 1)
                {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,0);
                }
                format(string, sizeof(string), "~w~Veiculo VIP~n~~g~Aberto");
                PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                GameTextForPlayer(playerid, string, 10000, 3);
                CarInfo[keycar][cLock] = 0;
                return true;
                }
                else
                {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,1);
                }
                format(string, sizeof(string), "~w~Veiculo VIP~n~~r~Trancado");
                PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                GameTextForPlayer(playerid, string, 10000, 3);
                CarInfo[keycar][cLock] = 1;
                return true;
                }

            }
            return true;
Lembrando , que o Bug й , se a pessoa usar /veiculo trancar , Ela nгo poderб entrar no PRУPRIO CARRO , se Sair
Reply
#2

Adicione isto ao inнcio do cуdigo que estб dentro das chaves do loop que tranca o veнculo para todos os jogadores :


pawn Код:
if(i == playerid) continue;

Assim o veнculo nгo ficarб trancado para quem enviou o comando.



Espero ter ajudado .
Reply
#3

Irei Testar , Muito Obrigado Rjjj !
Reply
#4

Rjjj , Deu erro .
Desculpe minha ignorancia , segue os erros :
pawn Код:
C:\Documents and Settings\Andre\Meus documentos\Brasil Hyper Games\Brasil Hyper Games\Brasil Hyper Games\Brasil Hyper Games\gamemodes\BHG.pwn(33275) : error 017: undefined symbol "i"
C:\Documents and Settings\Andre\Meus documentos\Brasil Hyper Games\Brasil Hyper Games\Brasil Hyper Games\Brasil Hyper Games\gamemodes\BHG.pwn(33275) : error 024: "break" or "continue" is out of context
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Qual seria a Define Para o " i " ?
Reply
#5

Ta ae:
pawn Код:
if(strcmp(tmp, "trancar", true) == 0)
        {
            if(PlayerInfo[playerid][pCarKey] == 0 && PlayerInfo[playerid][pCarKey2] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Carro VIP.");
                return true;
            }
            if(PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid)
            {
                SendClientMessage(playerid, COLOR_GREY, "Esse nгo й seu Carro VIP.");
                return true;
            }
            new keycar;
            if(vehid == PlayerInfo[playerid][pCarKey]) { keycar = PlayerInfo[playerid][pVeiculo]; }
            else if(vehid == PlayerInfo[playerid][pCarKey2]) { keycar = PlayerInfo[playerid][pVeiculo2]; }
            if(IsPlayerConnected(playerid))
            {
                if(CarInfo[keycar][cLock] == 1)
                {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i) && i != playerid) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,0);
                }
                format(string, sizeof(string), "~w~Veiculo VIP~n~~g~Aberto");
                PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                GameTextForPlayer(playerid, string, 10000, 3);
                CarInfo[keycar][cLock] = 0;
                return true;
                }
                else
                {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i) && i != playerid) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,1);
                }
                format(string, sizeof(string), "~w~Veiculo VIP~n~~r~Trancado");
                PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                GameTextForPlayer(playerid, string, 10000, 3);
                CarInfo[keycar][cLock] = 1;
                return true;
                }

            }
            return true;
        }
    }
Reply
#6

Quote:
Originally Posted by andrecvv
Посмотреть сообщение
Rjjj , Deu erro .
Desculpe minha ignorancia , segue os erros :
pawn Код:
C:\Documents and Settings\Andre\Meus documentos\Brasil Hyper Games\Brasil Hyper Games\Brasil Hyper Games\Brasil Hyper Games\gamemodes\BHG.pwn(33275) : error 017: undefined symbol "i"
C:\Documents and Settings\Andre\Meus documentos\Brasil Hyper Games\Brasil Hyper Games\Brasil Hyper Games\Brasil Hyper Games\gamemodes\BHG.pwn(33275) : error 024: "break" or "continue" is out of context
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Qual seria a Define Para o " i " ?
Isso que o rjj passou era pra vocк colocar dentro do loop! Vc colocou fora do loop e deu esse erro! Este acima tbm esta correto, Tente ↑↑↑
Reply
#7

Sou Muito Novato em Pawno , Meu Deus ...
Poderia me Informar Aonde vai Estar esse Loop ? Sу para Ter Ideia , Nгo sei Nem a Definiзгo Disso No Pawn .

Jб o 2 Comando , Nгo Hб Como Compilar . No Caso , o Pawn da Erro e Precisa Ser Fechado ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)