[Pedido] Habilitacao
#1

se o player passa se 3 vezes do limite de velocidade ele teria que repetir a licenзa ! mais a menos de 3 ele poderia continuar
Minha fs
Код:
stock GetVehicleVelocityEx(playerid) {

    new Float:Velocity[3], Float:fl;
    GetVehicleVelocity(GetPlayerVehicleID(playerid),Velocity[0],Velocity[1],Velocity[2]);
    fl = floatsqroot(floatpower(Velocity[0], 2) + floatpower(Velocity[1], 2) + floatpower(Velocity[2], 2)) * 160;
    return floatround(fl);
}

public OnPlayerUpdate(playerid) {

    if(InAutoEscola[playerid] == 1 && GetVehicleVelocityEx(playerid) > 50) {

        SetPVarInt(playerid, "Reprovado", 1);
    }
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid) {

    switch( point[playerid] ) {

        case 1: {

            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[1][0], AutoPoints[1][1], AutoPoints[1][2],AutoPoints[2][0], AutoPoints[2][1], AutoPoints[2][2], 10);
            point[playerid] = 2;
            return 1;
        }
        case 2: {

            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[2][0], AutoPoints[2][1], AutoPoints[2][2],AutoPoints[3][0], AutoPoints[3][1], AutoPoints[3][2], 10);
            point[playerid] = 3;
            return 1;
        }
        case 3: {

            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[3][0], AutoPoints[3][1], AutoPoints[3][2],AutoPoints[4][0], AutoPoints[4][1], AutoPoints[4][2], 10);
            point[playerid] = 4;
            return 1;
        }
        case 4: {

            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[4][0], AutoPoints[4][1], AutoPoints[4][2],AutoPoints[5][0], AutoPoints[5][1], AutoPoints[5][2], 10);
            point[playerid] = 5;
            return 1;
        }
        case 5: {

            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[5][0], AutoPoints[5][1], AutoPoints[5][2],AutoPoints[6][0], AutoPoints[6][1], AutoPoints[6][2], 10);
            point[playerid] = 6;
            return 1;
        }
        case 6: {

            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[6][0], AutoPoints[6][1], AutoPoints[6][2],AutoPoints[7][0], AutoPoints[7][1], AutoPoints[7][2], 10);
            point[playerid] = 7;
            return 1;
        }
        case 7: {

            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, AutoPoints[7][0], AutoPoints[7][1], AutoPoints[7][2],AutoPoints[7][0], AutoPoints[7][1], AutoPoints[7][2], 10);
            point[playerid] = 8;
            return 1;
        }
        case 8: {

            if(IsPlayerInVehicle(playerid, carroauto[playerid])) {

                new Float:lataria;
                GetVehicleHealth(carroauto[playerid], lataria);

                if( lataria < 87) {

                    DisablePlayerRaceCheckpoint(playerid);
                    new currentveh;
                    currentveh = GetPlayerVehicleID(playerid);
                    DestroyVehicle(currentveh);
                    SendClientMessage(playerid,-1,"(AUTO ESCOLA) Reprovado!! Voce danificou muito a lataria do veiculo.");
                    DeletePVar(playerid, "Reprovado");
                    return 1;
                }

                if ( GetPVarInt(playerid, "Reprovado") == 1 ) {

                    DisablePlayerRaceCheckpoint(playerid);
                    new currentveh;
                    currentveh = GetPlayerVehicleID(playerid);
                    DestroyVehicle(currentveh);
                    SendClientMessage(playerid,-1,"(AUTO ESCOLA) Reprovado!! Exedeu o limite de velocidade! (50 KM/h).");
                    DeletePVar(playerid, "Reprovado");
                    return 1;
                }
                DisablePlayerRaceCheckpoint(playerid);
                GameTextForPlayer(playerid, "AUTO ESCOLA COMPLETA", 3000, 1);
                pDados[playerid][Carteira] = 1;
                InAutoEscola[playerid] = 0;
                new currentveh;
                currentveh = GetPlayerVehicleID(playerid);
                DestroyVehicle(currentveh);
                return 1;
            }
            else
            {

                DisablePlayerRaceCheckpoint(playerid);
                new currentveh;
                currentveh = GetPlayerVehicleID(playerid);
                DestroyVehicle(currentveh);
                SendClientMessage(playerid,-1,"(AUTO ESCOLA) Reprovado!! Voce nao estao em um veiculo da Auto Escola.");
                DeletePVar(playerid, "Reprovado");
                return 1;
            }
        }
    }
    return 1;
}
Reply
#2

Tu sу sabe pedir as coisas, estude e faзa vocк mesmo.
Reply
#3

O cara estб somente pedindo ajuda nгo vejo problema nenhum seu ignorante !
Reply
#4

Se fosse ajuda teria a tag "ajuda" no caso ele sу sabe pedir as coisas prontas, se ele se esforзar ele consegue.
Eu acho que a pessoa tem um limite de pedir as coisas, o dele jб estб estourado.
Reply
#5

Jб tentei fazer mais nгo pega eu vo fazer oque entгo ?
Reply
#6

Se nгo quiseram fazer min falem qual variavel, funзгo devo fazer '-'
Reply
#7

Estudar atй conseguir.
Reply
#8

Quote:
Originally Posted by Pablo_Mantega
Посмотреть сообщение
Se nгo quiseram fazer min falem qual variavel, funзгo devo fazer '-'
Operadores. Teуrico & Prбtico!

Boa sorte.
Reply
#9

Alguem Porfavor!
Reply
#10

Mais ou menos assim

pawn Код:
new ContarHAB[MAX_PLAYERS];

forward playerHab(playerid);


public playerHab(playerid) {
    new String[128];
    if(GetVehicleVelocityEx(playerid) > 100) {
        ContarHAB[playerid] ++;
        format(String, 128, "[ AVISO ]: Vocк estб ultrapassando o limite de velocidade - %i", GetVehicleVelocityEx(playerid));
        SendClientMessage(playerid, -1, String);
    }
    if(ContarHAB[playerid] >= 3) {
        SendClientMessage(playerid, -1, "Vocк nгo conseguiu terminar o teste! Abraзos");
        ContarHAB[playerid] = 0;
    }
    return true;
}

SetTimerEx("playerHab", 1000, false, "i", playerid); // Coloca quando ele iniciar o teste
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)