[Ajuda] Checkpoint Carregar/Descarregar
#1

@EDIT

Estб dando problema aqui no /carregar, quando eu chego na бrea de carregamento, dependendo do caminhгo(Nъmero dele(caminhгo 0, 1, 2 ...) ) Aparece a mensagem que esse nгo й o caminhгo de trabalho, mas й o caminhгo de trabalho dele :c . Se alguйm saber como resolver agradeзo muito

CODE
PHP код:
CMD:carregar(playeridparams[])
{
    
Player[playerid][pEmprego] = DOF2_GetInt(GetArquivo(playerid), "Emprego");
    new 
index random(sizeof(DesCaminhoneiro));
    if(
IsPlayerInRangeOfPoint(playerid10.0, -186.0883,-278.1851,1.0015))
    {
        if(
Player[playerid][pEmprego] == 2)
        {
            for(new 
i10i++)
            {
                if(
GetPlayerVehicleID(playerid) == VehJob[i])
                {            
                    
DisablePlayerCheckpoint(playerid);
                    
SetPlayerCheckpoint(playeridDesCaminhoneiro[index][0], DesCaminhoneiro[index][1], DesCaminhoneiro[index][2], 5.0);
                    
GameTextForPlayer(playerid"~r~carregado"30001);
                    
SetTimerEx("CongelarPlayer"0false"i"playerid);
                    
SetTimerEx("DescogelarPlayer"3000false"i"playerid);
                    
TogglePlayerControllable(playerid1);
                    
PlayerPlaySound(playerid11390.00.00.0);
                    
Trabalhando[playerid] = 1;
                    return 
SendClientMessage(playerid, -1"[Citizen] Vб atй o ponto de descarga.");
                }
                if(
GetPlayerVehicleID(playerid) != VehJob[i])
                {
                    
SendClientMessage(playerid, -1"[Citizen] Vocк nгo estб no seu veнculo de trabalho.");
                } 
            }
        }
    }else{
        
SendClientMessage(playerid, -1"[Citizen] Vocк nгo estб na бrea de carregamento.");
    }    
    return 
1;

PHP код:
stock GerarVehJobs()
{
    
VehJob[0] = AddStaticVehicle(578,-150.3475,-322.4740,2.0470,178.9312,1,1); // cam1
    
VehJob[1] = AddStaticVehicle(578,-146.7534,-322.4777,2.0482,178.3338,1,1); // cam2
    
VehJob[2] = AddStaticVehicle(578,-143.2072,-322.4816,2.0502,177.9410,1,1); // cam3
    
VehJob[3] = AddStaticVehicle(578,-139.6475,-322.4775,2.0475,178.6887,1,1); // cam4
    
VehJob[4] = AddStaticVehicle(578,-136.0843,-322.5571,2.0485,179.0342,1,1); // cam5
    
VehJob[5] = AddStaticVehicle(578,-132.4907,-322.4763,2.0507,180.4373,1,1); // cam6
    
VehJob[6] = AddStaticVehicle(578,-128.8674,-322.4846,2.0430,180.6637,1,1); // cam7
    
VehJob[7] = AddStaticVehicle(578,-125.4445,-322.4742,2.0465,180.4220,1,1); // cam8
    
VehJob[8] = AddStaticVehicle(578,-121.7711,-322.4776,2.0539,181.0035,1,1); // cam9
    
VehJob[9] = AddStaticVehicle(578,-118.2575,-322.4727,2.0519,180.2059,1,1); // cam10
    
VehJob[10] = AddStaticVehicle(578,-114.6409,-322.4907,2.0501,179.4344,1,1); // cam11
    
VehJob[11] =AddStaticVehicle(448,2098.2729,-1801.3911,12.9851,88.3725,3,6); // moto1
    
VehJob[12] = AddStaticVehicle(448,2098.2913,-1800.4009,12.9925,88.8084,3,6); // moto2
    
VehJob[13] = AddStaticVehicle(448,2098.3372,-1799.4948,12.9894,90.2735,3,6); // moto3
    
VehJob[14] = AddStaticVehicle(448,2098.3135,-1812.1583,12.9813,87.6663,3,6); // moto4
    
VehJob[15] = AddStaticVehicle(448,2098.3682,-1812.9309,13.0309,88.0807,3,6); // moto5
    
VehJob[16] = AddStaticVehicle(448,2098.3535,-1813.5913,12.9820,87.9644,3,6); // moto6

Reply
#2

Eu fiz um sistema desses ai, E igual esse ai abaixo, Sу que o meu tem descarregar: Los santos Las venturas e Bayside
Eu nгo uso CMD, malz :/

PHP код:
new Carregado[MAX_PLAYERS] = 0;
if(
strcmp(cmd"/Carregar"true) == 0)
{
        new 
vehicleID GetPlayerVehicleID(playerid);
    
        
Carregado[playerid] == 1) return SendClientMessage(playeridVermelho"| ERRO | Seu caminhгo jб estб   carregado!");
    
        if(
PlayerInfoplayerid ][ pProfissao ] == Caminhoneiro)
        {
            if(
PlayerToPoint(10.0,playerid/*Coordenadas do 'Carregamento - X Y Z'*/))     
            {
                if(
GetVehicleModel(GetVehicleTrailer(vehicleID)) == 435//Vк se o Player estб com a carga do caminhoneiro
                
{
                    
Carregado[playerid] = 1;  
                    
SetPlayerRaceCheckpoint(playerid2/*Coordenadas descarregamento - X Y Z*/0003.10);  
                }
            }
            else
            {
                
SendClientMessage(playeridVermelho"| ERRO | Vocк nгo estб na Бrea de carregamento!");    
            }               
        }
        else
        {
            
SendClientMessage(playeridVermelho"| ERRO | Vocк nгo trabalha como Caminhoneiro!");
        }
        return 
1;

Descarregar:

PHP код:
if(strcmp(cmd"/Descarregar"true) == 0)
{
        new 
vehicleID GetPlayerVehicleID(playerid);
    
        
Carregado[playerid] == 0) return SendClientMessage(playeridVermelho"| ERRO | Seu caminhгo jб estб descarregado!");
    
        if(
PlayerInfoplayerid ][ pProfissao ] == Caminhoneiro)
        {
            if(
PlayerToPoint(10.0,playerid/*Coordenadas do 'Descarregamento - X Y Z'*/)) //Descarrega se o player tiver nas cordenadas de descarregar  
            
{
                if(
GetVehicleModel(GetVehicleTrailer(vehicleID)) == 435//Vк se o Player estб com a carga do caminhoneiro
                
{
                    
Carregado[playerid] = 0;  
                    
DisablePlayerRaceCheckpointplayerid );
                }
            }
            else
            {
                
SendClientMessage(playeridVermelho"| ERRO | Vocк nгo estб na Бrea de descarregamento!");    
            }               
        }
        else
        {
            
SendClientMessage(playeridVermelho"| ERRO | Vocк nгo trabalha como Caminhoneiro!");
        }
        return 
1;

Reply
#3

Quote:
Originally Posted by AutoMatic2
Посмотреть сообщение
Eu fiz um sistema desses ai :v, Vou te passar a 'Base' :v
Obrigado
Reply
#4

Tava dando umas arrumada, vlw flw!
Reply
#5

Quote:
Originally Posted by AutoMatic2
Посмотреть сообщение
Eu fiz um sistema desses ai, E igual esse ai abaixo, Sу que o meu tem descarregar: Los santos Las venturas e Bayside
Eu nгo uso CMD, malz :/

PHP код:
new Carregado[MAX_PLAYERS] = 0;
if(
strcmp(cmd"/Carregar"true) == 0)
{
        new 
vehicleID GetPlayerVehicleID(playerid);
    
        
Carregado[playerid] == 1) return SendClientMessage(playeridVermelho"| ERRO | Seu caminhгo jб estб   carregado!");
    
        if(
PlayerInfoplayerid ][ pProfissao ] == Caminhoneiro)
        {
            if(
PlayerToPoint(10.0,playerid/*Coordenadas do 'Carregamento - X Y Z'*/))     
            {
                if(
GetVehicleModel(GetVehicleTrailer(vehicleID)) == 435//Vк se o Player estб com a carga do caminhoneiro
                
{
                    
Carregado[playerid] = 1;  
                    
SetPlayerRaceCheckpoint(playerid2/*Coordenadas descarregamento - X Y Z*/0003.10);  
                }
            }
            else
            {
                
SendClientMessage(playeridVermelho"| ERRO | Vocк nгo estб na Бrea de carregamento!");    
            }               
        }
        else
        {
            
SendClientMessage(playeridVermelho"| ERRO | Vocк nгo trabalha como Caminhoneiro!");
        }
        return 
1;

Descarregar:

PHP код:
if(strcmp(cmd"/Descarregar"true) == 0)
{
        new 
vehicleID GetPlayerVehicleID(playerid);
    
        
Carregado[playerid] == 0) return SendClientMessage(playeridVermelho"| ERRO | Seu caminhгo jб estб descarregado!");
    
        if(
PlayerInfoplayerid ][ pProfissao ] == Caminhoneiro)
        {
            if(
PlayerToPoint(10.0,playerid/*Coordenadas do 'Descarregamento - X Y Z'*/)) //Descarrega se o player tiver nas cordenadas de descarregar  
            
{
                if(
GetVehicleModel(GetVehicleTrailer(vehicleID)) == 435//Vк se o Player estб com a carga do caminhoneiro
                
{
                    
Carregado[playerid] = 0;  
                    
DisablePlayerRaceCheckpointplayerid );
                }
            }
            else
            {
                
SendClientMessage(playeridVermelho"| ERRO | Vocк nгo estб na Бrea de descarregamento!");    
            }               
        }
        else
        {
            
SendClientMessage(playeridVermelho"| ERRO | Vocк nгo trabalha como Caminhoneiro!");
        }
        return 
1;


Tipo , a parte de carregar e descarregar eu sei fazer. Estou falando como faria pra fazer um sistema de cordernadas random, tipo , ter 3 pontos de carregamentos , quando der /carregar , algum dos 3 aparecer no mapa para descarregar, essa й minha duvida.
Reply
#6

PHP код:
static Float:ShipmentList[3][3] = // 3 coordenadas (x, y, z)
{
    {
0.00.00.0},
    {
0.00.00.0},
    {
0.00.00.0}
};
CMD:carregar(playerid)
{
    new 
indx random(sizeof(ShipmentList));
    
SetPlayerCheckpoint(playeridShipmentList[indx][0], ShipmentList[indx][1], ShipmentList[indx][2], 3.0);
    return 
1;

Reply
#7

Quote:
Originally Posted by 1sbedx
Посмотреть сообщение
PHP код:
static Float:ShipmentList[3][3] = // 3 coordenadas (x, y, z)
{
    {
0.00.00.0},
    {
0.00.00.0},
    {
0.00.00.0}
};
CMD:carregar(playerid)
{
    new 
indx random(sizeof(ShipmentList));
    
SetPlayerCheckpoint(playeridShipmentList[indx][0], ShipmentList[indx][1], ShipmentList[indx][2], 3.0);
    return 
1;

Funcionou , obrigado. Agora sу tenho que fazer um lugar pra carregar e quando chegar lб, fazer isso ^^
PHP код:
+REP 
Reply
#8

Estб dando problema aqui no /carregar, quando eu chego na бrea de carregamento, dependendo do caminhгo(Nъmero dele(caminhгo 0, 1, 2 ...) ) Aparece a mensagem que esse nгo й o caminhгo de trabalho, mas й o caminhгo de trabalho dele :c . Se alguйm saber como resolver agradeзo muito

CODE
PHP код:
CMD:carregar(playeridparams[])
{
    
Player[playerid][pEmprego] = DOF2_GetInt(GetArquivo(playerid), "Emprego");
    new 
index random(sizeof(DesCaminhoneiro));
    if(
IsPlayerInRangeOfPoint(playerid10.0, -186.0883,-278.1851,1.0015))
    {
        if(
Player[playerid][pEmprego] == 2)
        {
            for(new 
i10i++)
            {
                if(
GetPlayerVehicleID(playerid) == VehJob[i])
                {            
                    
DisablePlayerCheckpoint(playerid);
                    
SetPlayerCheckpoint(playeridDesCaminhoneiro[index][0], DesCaminhoneiro[index][1], DesCaminhoneiro[index][2], 5.0);
                    
GameTextForPlayer(playerid"~r~carregado"30001);
                    
SetTimerEx("CongelarPlayer"0false"i"playerid);
                    
SetTimerEx("DescogelarPlayer"3000false"i"playerid);
                    
TogglePlayerControllable(playerid1);
                    
PlayerPlaySound(playerid11390.00.00.0);
                    
Trabalhando[playerid] = 1;
                    return 
SendClientMessage(playerid, -1"[Citizen] Vб atй o ponto de descarga.");
                }
                if(
GetPlayerVehicleID(playerid) != VehJob[i])
                {
                    
SendClientMessage(playerid, -1"[Citizen] Vocк nгo estб no seu veнculo de trabalho.");
                } 
            }
        }
    }else{
        
SendClientMessage(playerid, -1"[Citizen] Vocк nгo estб na бrea de carregamento.");
    }    
    return 
1;

PHP код:
stock GerarVehJobs()
{
    
VehJob[0] = AddStaticVehicle(578,-150.3475,-322.4740,2.0470,178.9312,1,1); // cam1
    
VehJob[1] = AddStaticVehicle(578,-146.7534,-322.4777,2.0482,178.3338,1,1); // cam2
    
VehJob[2] = AddStaticVehicle(578,-143.2072,-322.4816,2.0502,177.9410,1,1); // cam3
    
VehJob[3] = AddStaticVehicle(578,-139.6475,-322.4775,2.0475,178.6887,1,1); // cam4
    
VehJob[4] = AddStaticVehicle(578,-136.0843,-322.5571,2.0485,179.0342,1,1); // cam5
    
VehJob[5] = AddStaticVehicle(578,-132.4907,-322.4763,2.0507,180.4373,1,1); // cam6
    
VehJob[6] = AddStaticVehicle(578,-128.8674,-322.4846,2.0430,180.6637,1,1); // cam7
    
VehJob[7] = AddStaticVehicle(578,-125.4445,-322.4742,2.0465,180.4220,1,1); // cam8
    
VehJob[8] = AddStaticVehicle(578,-121.7711,-322.4776,2.0539,181.0035,1,1); // cam9
    
VehJob[9] = AddStaticVehicle(578,-118.2575,-322.4727,2.0519,180.2059,1,1); // cam10
    
VehJob[10] = AddStaticVehicle(578,-114.6409,-322.4907,2.0501,179.4344,1,1); // cam11
    
VehJob[11] =AddStaticVehicle(448,2098.2729,-1801.3911,12.9851,88.3725,3,6); // moto1
    
VehJob[12] = AddStaticVehicle(448,2098.2913,-1800.4009,12.9925,88.8084,3,6); // moto2
    
VehJob[13] = AddStaticVehicle(448,2098.3372,-1799.4948,12.9894,90.2735,3,6); // moto3
    
VehJob[14] = AddStaticVehicle(448,2098.3135,-1812.1583,12.9813,87.6663,3,6); // moto4
    
VehJob[15] = AddStaticVehicle(448,2098.3682,-1812.9309,13.0309,88.0807,3,6); // moto5
    
VehJob[16] = AddStaticVehicle(448,2098.3535,-1813.5913,12.9820,87.9644,3,6); // moto6

Reply
#9

PHP код:
CMD:carregar(playeridparams[]) 

    
Player[playerid][pEmprego] = DOF2_GetInt(GetArquivo(playerid), "Emprego"); 
    new 
index random(sizeof(DesCaminhoneiro)); 

    if(
IsPlayerInRangeOfPoint(playerid10.0, -186.0883,-278.1851,1.0015)) 
    { 
        if(
Player[playerid][pEmprego] == 2
        { 
            for(new 
i10i++) 
            { 
                if(
GetPlayerVehicleID(playerid) == VehJob[i]) 
                {             
                    
DisablePlayerCheckpoint(playerid); 
                    
SetPlayerCheckpoint(playeridDesCaminhoneiro[index][0], DesCaminhoneiro[index][1], DesCaminhoneiro[index][2], 5.0); 
                    
GameTextForPlayer(playerid"~r~carregado"30001); 
                    
SetTimerEx("CongelarPlayer"0false"i"playerid); 
                    
SetTimerEx("DescogelarPlayer"3000false"i"playerid); 
                    
TogglePlayerControllable(playerid1); 
                    
PlayerPlaySound(playerid11390.00.00.0); 
                    
Trabalhando[playerid] = 1
                    
SendClientMessage(playerid, -1"[Citizen] Vб atй o ponto de descarga."); 
                } 
                else
                { 
                    
SendClientMessage(playerid, -1"[Citizen] Vocк nгo estб no seu veнculo de trabalho."); 
                }  
            } 
        } 
    }else{ 
        
SendClientMessage(playerid, -1"[Citizen] Vocк nгo estб na бrea de carregamento."); 
    }     
    return 
1

Reply
#10

Quote:
Originally Posted by 1sbedx
Посмотреть сообщение
PHP код:
CMD:carregar(playeridparams[]) 

    
Player[playerid][pEmprego] = DOF2_GetInt(GetArquivo(playerid), "Emprego"); 
    new 
index random(sizeof(DesCaminhoneiro)); 
    if(
IsPlayerInRangeOfPoint(playerid10.0, -186.0883,-278.1851,1.0015)) 
    { 
        if(
Player[playerid][pEmprego] == 2
        { 
            for(new 
i10i++) 
            { 
                if(
GetPlayerVehicleID(playerid) == VehJob[i]) 
                {             
                    
DisablePlayerCheckpoint(playerid); 
                    
SetPlayerCheckpoint(playeridDesCaminhoneiro[index][0], DesCaminhoneiro[index][1], DesCaminhoneiro[index][2], 5.0); 
                    
GameTextForPlayer(playerid"~r~carregado"30001); 
                    
SetTimerEx("CongelarPlayer"0false"i"playerid); 
                    
SetTimerEx("DescogelarPlayer"3000false"i"playerid); 
                    
TogglePlayerControllable(playerid1); 
                    
PlayerPlaySound(playerid11390.00.00.0); 
                    
Trabalhando[playerid] = 1
                    
SendClientMessage(playerid, -1"[Citizen] Vб atй o ponto de descarga."); 
                } 
                else
                { 
                    
SendClientMessage(playerid, -1"[Citizen] Vocк nгo estб no seu veнculo de trabalho."); 
                }  
            } 
        } 
    }else{ 
        
SendClientMessage(playerid, -1"[Citizen] Vocк nгo estб na бrea de carregamento."); 
    }     
    return 
1

Continua Falando que nгo estб no veнculo de trabalho.

OBS:Ele carrega normal , sу que fica aparecendo essa mensagem.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)