SA-MP Forums Archive
[Ajuda] Checkpoint .-. Ajudem - 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] Checkpoint .-. Ajudem (/showthread.php?tid=522870)



Checkpoint .-. Ajudem - victorlus - 29.06.2014

Bom galera meu sistema de Auto escola tem um bug quando vocк sai do carro o carro da spawn de boa mais o checkpoint continua eu ja tentei usar -> DisablePlayerCheckpoint(playerid); mais nгo funciona nгo funciona tipo quando o player passa em cima de outro checkpoint sem ser da Auto escola o checkpoint da auto escola ele volta video:

https://www.youtube.com/watch?v=iDQ6-gMKiSk


Re: Checkpoint .-. Ajudem - victorlus - 29.06.2014

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    switch(
GetPVarInt(playerid,"autoescola"))
    {
        case 
1:
        {
            
SetPlayerCheckpoint(playerid915.7407,-1339.2396,13.16268.0);
            
SetPVarInt(playerid,"autoescola",2);
            return 
1;
        }
        case 
2:
        {
            
SetPlayerCheckpoint(playerid,915.4448,-1559.5372,13.17808.0);
            
SetPVarInt(playerid,"autoescola",3);
            return 
1;
        }
        case 
3:
        {
            
SetPlayerCheckpoint(playerid1285.0886,-1574.0343,13.18908.0);
            
SetPVarInt(playerid,"autoescola",4);
            return 
1;
        }
        case 
4:
        {
            
SetPlayerCheckpoint(playerid1295.1682,-1839.3160,13.18968.0);
            
SetPVarInt(playerid,"autoescola",5);
            return 
1;
        }
        case 
5:
        {
            
SetPlayerCheckpoint(playerid1569.1729,-1874.7198,13.18798.0);
            
SetPVarInt(playerid,"autoescola",6);
            return 
1;
}
case 
6:
        {
            
SetPlayerCheckpoint(playerid1573.1563,-1744.4418,13.29458.0);
            
SetPVarInt(playerid,"autoescola",7);
            return 
1;
}
case 
7:
        {
            
SetPlayerCheckpoint(playerid,1533.2953,-1603.8513,13.29108.0);
            
SetPVarInt(playerid,"autoescola",8);
            return 
1;
}
case 
8:
        {
            
SetPlayerCheckpoint(playerid1324.8246,-1569.5563,13.17458.0);
            
SetPVarInt(playerid,"autoescola",9);
            return 
1;
}
case 
9:
        {
            
SetPlayerCheckpoint(playerid1365.3812,-1055.9595,26.44778.0);
            
SetPVarInt(playerid,"autoescola",10);
            return 
1;
}
case 
10:
        {
            
SetPlayerCheckpoint(playerid1351.2931,-929.0810,34.26828.0);
            
SetPVarInt(playerid,"autoescola",11);
            return 
1;
}
case 
11:
        {
            
SetPlayerCheckpoint(playerid990.1336,-952.5511,41.10978.0);
            
SetPVarInt(playerid,"autoescola",12);
            
SendClientMessage(playeridCOLOR_LIGHTBLUE,"Prepare-se: Mais a frente execute a baliza de forma correta!");
            
PlayerInfo[playerid][pAutorizado2] = 1;
            return 
1;
}
case 
12:
        {
            
SetPlayerCheckpoint(playerid,979.6470,-937.2894,40.99868.0);
            return 
1;
}
    }
    if(
TaxiCallTime[playerid] > && TaxiAccepted[playerid] < 999)
    {
        
TaxiAccepted[playerid] = 999;
        
GameTextForPlayer(playerid"~w~Chegou ao destino"50001);
        
TaxiCallTime[playerid] = 0;
        
DisablePlayerCheckpoint(playerid);
    }
    else if(
BusCallTime[playerid] > && BusAccepted[playerid] < 999)
    {
        
BusAccepted[playerid] = 999;
        
GameTextForPlayer(playerid"~w~Chegou ao destino"50001);
        
BusCallTime[playerid] = 0;
        
DisablePlayerCheckpoint(playerid);
    }
    else if(
MedicCallTime[playerid] > && MedicAccepted[playerid] < 999)
    {
        
MedicAccepted[playerid] = 999;
        
GameTextForPlayer(playerid"~w~Chegou ao destino"50001);
        
MedicCallTime[playerid] = 0;
        
DisablePlayerCheckpoint(playerid);
    }
    else if(
MechanicCallTime[playerid] > && MechanicAccepted[playerid] < 999)
    {
        
MechanicAccepted[playerid] = 999;
        
GameTextForPlayer(playerid"~w~Chegou ao destino"50001);
        
MechanicCallTime[playerid] = 0;
        
DisablePlayerCheckpoint(playerid);
    }
    else if(
CopsrondaCallTime[playerid] > && CopsrondaAccepted[playerid] < 999)
    {
        
CopsrondaAccepted[playerid] = 999;
        
GameTextForPlayer(playerid"~w~Chegou ao destino"50001);
        
CopsrondaCallTime[playerid] = 0;
        
DisablePlayerCheckpoint(playerid);
    }
    else if(
CP[playerid] == 5)
    {
        
GameTextForPlayer(playerid"~y~Complete a Missao indo nos Checkpoint"25001);
        
CP[playerid] = 0;
        
DisablePlayerCheckpoint(playerid);
    }
    else if(
TruckMission[playerid] == 1)
    {
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"* Vocк obteve R$1000 por entregar a carga, espere sua recarga por 5 minutos.");
        
DisablePlayerCheckpoint(playerid);
        
TruckMission[playerid] = 0;
        
GivePlayerMoney(playerid1000);
        
var1[playerid] = 1;
        
TempoRecarga SetTimerEx("ZerarRecarga"1800000"i"playerid);
    }
    else if(
TruckMission[playerid] == 2)
    {
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"* Vocк obteve R$1500 por entregar a carga, espere sua recarga por 5 minutos.");
        
DisablePlayerCheckpoint(playerid);
        
TruckMission[playerid] = 0;
        
GivePlayerMoney(playerid1500);
        
var1[playerid] = 1;
        
TempoRecarga SetTimerEx("ZerarRecarga"1800000"i"playerid);
    }
    else if(
TruckMission[playerid] == 3)
    {
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"* Vocк obteve R$2000 por entregar a carga, espere sua recarga por 5 minutos.");
        
DisablePlayerCheckpoint(playerid);
        
TruckMission[playerid] = 0;
        
GivePlayerMoney(playerid2000);
        
var1[playerid] = 1;
        
TempoRecarga SetTimerEx("ZerarRecarga"1800000"i"playerid);
    }
    if(
PlayerToPoint(8.0,playerid,1481.1926,-1764.2736,18.7958))//Prefeitura
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou na ~b~Prefeitura"50003);
       }
       if(
PlayerToPoint(8.0,playerid,1462.395751,-1012.391174,26.843799))//Banco
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou no ~b~Banco"50003);
       }
       if(
PlayerToPoint(8.0,playerid,1546.2761,-1675.5995,13.5620))//DP
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou ao ~b~Departamento de Policia"50003);
       }
       if(
PlayerToPoint(8.0,playerid,1350.4865,-1753.2505,13.3582))//24-7
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou no ~b~Mercado de Commerce"50003);
       }
       if(
PlayerToPoint(8.0,playerid,1790.5725,-1167.3705,23.8281))//Loja de Armas
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou a ~b~Loja de Armas"50003);
       }
       if(
PlayerToPoint(8.0,playerid,1362.2240,-1279.7227,13.3828))//Ammu Nation
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou a ~b~Ammu Nation"50003);
       }
       if(
PlayerToPoint(8.0,playerid,2244.7954,-1663.5021,15.4766))//Binco
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou na ~b~Binco"50003);
       }
       if(
PlayerToPoint(8.0,playerid,2155.4363,-1171.3413,23.8206))//Aluguel de Carros
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou no ~b~Aluguel de Carros"50003);
       }
       if(
PlayerToPoint(8.0,playerid,1411.5593,-1699.5270,13.5395))//Centro de Licencas
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou no ~b~Centro de Licencas"50003);
       }
       if(
PlayerToPoint(8.0,playerid,2003.4354,-1444.1321,13.5621))//Hospital
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou no ~b~Hospital"50003);
       }
       if(
PlayerToPoint(8.0,playerid,1928.826904,-1776.405517,13.546895))//Posto idlewood
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou ao ~b~Posto de Idlewood"50003);
       }
       if(
PlayerToPoint(8.0,playerid,2232.5723,-1332.8412,23.9815))//Igreja
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou na ~b~Igreja"50003);
       }
       if(
PlayerToPoint(8.0,playerid,1460.6941,-1142.9766,24.3906))//Zip
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou na ~b~Zip"50003);
       }
       if(
PlayerToPoint(8.0,playerid,550.7012,-1278.5721,17.2482))//Aluguel de Carros 1
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~p~|Voce chegou no ~b~Aluguel de Carros"50003);
       }
       if(
PlayerToPoint(8.0,playerid,454.1039,-1501.5459,30.8761))//victim
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou na ~b~VICTIM"50003);
       }
       if(
PlayerToPoint(8.0,playerid,661.0214,-573.4525,16.3359))//Posto Dillimore
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou no ~b~Posto de Dillimore"50003);
       }
       if(
PlayerToPoint(8.0,playerid,1003.0009,-941.7861,41.6509))//Posto temple
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou no ~b~Posto de Temple"50003);
       }
       if(
PlayerToPoint(8.0,playerid,1637.6385,-1148.0294,23.90636))//Concessionaria
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou na ~b~Concessionaria"50003);
       }
       if(
PlayerToPoint(8.0,playerid,2420.6565,-1738.9923,13.5469))//mercado ganton
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou no ~b~Mercado de Ganton"50003);
       }
       if(
PlayerToPoint(8.0,playerid,961.7795,-944.9980,40.3419))//D.E.T.R.A.N
    
{
        
DisablePlayerCheckpoint(playerid);
        
GameTextForPlayer(playerid" ~w~Voce chegou ao ~b~D.E.T.R.A.N"50003);
       }
       if(
PlayerToPoint(1.7,playerid,246.4971,74.3957,1003.6406))//Postao Presos DP
    
{
        
OnPlayerCommandText(playerid,"/pp");
        
GameTextForPlayer(playerid" ~w~Portao Celas ~b~Aberto"50003);
       }
       if(
PlayerToPoint(2.0,playerid,367.3167,162.2013,1025.7891))//Postao Interno Prefeitura
    
{
        
OnPlayerCommandText(playerid,"/ppre");
        
GameTextForPlayer(playerid" ~w~Porta Prefeitura ~b~Aberto"50003);
       }
       
//auto escola//
    
else
    {
        switch (
gPlayerCheckpointStatus[playerid])
        {
            case 
CHECKPOINT_HOME:
            {
                
PlayerPlaySound(playerid10580.00.00.0);
                
DisablePlayerCheckpoint(playerid);
                
gPlayerCheckpointStatus[playerid] = CHECKPOINT_Nenhum;
                
GameTextForPlayer(playerid"~w~Chegou em~n~~y~Casa"50001);
            }
        }
    }
    if (
gPlayerTerminal[playerid] != 0)
    {
        if (
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2)
        {
            switch(
gPlayerTerminal[playerid])
            {
                case 
1:
                {
                       
SetPlayerCheckpoint(playerid,1533.1049,-1610.5599,13.47665.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
2:
                {
                    
SetPlayerCheckpoint(playerid,1736.9674,-1601.5439,13.52255.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
3:
                {
                    
SetPlayerCheckpoint(playerid,1818.3682,-1694.8099,13.48315.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
4:
                {
                    
SetPlayerCheckpoint(playerid,1819.0150,-1872.5851,13.50235.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
5:
                {
                    
SetPlayerCheckpoint(playerid,1987.3519,-2169.5242,13.48095.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
6:
                {
                    
SetPlayerCheckpoint(playerid,2274.7886,-2274.3623,13.48375.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
7:
                {
                    
SetPlayerCheckpoint(playerid,1996.1328,-2163.6931,13.48335.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
8:
                {
                    
SetPlayerCheckpoint(playerid,1964.8201,-2077.6494,13.48425.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
9:
                {
                    
SetPlayerCheckpoint(playerid,1825.4634,-1906.8052,13.50445.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
10:
                {
                    
SetPlayerCheckpoint(playerid,1824.8920,-1705.7137,13.48425.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
11:
                {
                    
SetPlayerCheckpoint(playerid,1526.6500,-1612.1188,13.49075.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
12:
                {
                    
SetPlayerCheckpoint(playerid,1373.5723,-1729.5554,13.49525.0);
                    
SetTimerEx("busstoptimer"10000false"i"playerid);
                    
Controle(playerid0);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Aguarde 10 segundos nesse ponto para esperar passageiros.");
                }
                case 
13:
                {
                    new 
conta gPlayerTerminal[playerid]*50;
                    
format(gstring128"Vocк completou a rota do фnibus e ganhou R$%d, use /terminais para iniciar novamente a rota."conta);
                    
SendClientMessage(playeridCOLOR_YELLOWgstring);
                    
SendClientMessage(playeridCOLOR_YELLOW"Use /saircarro para sair do фnibus.");
                    
BusrouteEnd(playerid);
                }
            }
            
gPlayerTerminal[playerid]++;
            
PlayerPlaySound(playerid10560.00.00.0);
            return 
true;
        }
    }
    
DisablePlayerCheckpoint(playerid);
    return 
true;