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



Checkpoint Com problema. - ThiagoGamemodes - 31.07.2018

Bom, quando eu entro em um certo checkpoint ele aparece uma dialog para escolher o local, eu escolho tudo certinho, porйm quando eu chego no checkpoint no qual eu escolhi ele abre novamento os dialog, veja a seguir como estб,
Код:
public OnPlayerEnterCheckpoint(playerid)
{
	if(CheckCarregarTransportador)
	{
		ShowPlayerDialog(playerid, MenuTransportador, DIALOG_STYLE_LIST, "Tipos de Serviзo", "{AFAFAF}Tranporte de Sucata\n{AFAFAF}Transporte de Mуveis\n{AFAFAF}Transporte de Mercadorias para Empresas\n{AFAFAF}Transporte de Materiais para Construзгo", "Ok", "Cancelar");
		DisablePlayerCheckpoint(playerid);
	}
	else if(TranspCheckpointSucata)
	{
		DestroyObject(objecttranspsucata);
		DisablePlayerCheckpoint(playerid);
	}
	else {
		DisablePlayerCheckpoint(playerid);
	}
    return  true;
}


ainda estou desvendando cada funзгo por isso nгo sei se estб codado corretamente, obrigado a todos pela ajuda desde jб.


Re: Checkpoint Com problema. - bruxo00 - 31.07.2018

Esse cуdigo dб para optimizar, assim:

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
CheckCarregarTransportador) {
        
ShowPlayerDialog(playeridMenuTransportadorDIALOG_STYLE_LIST"Tipos de Serviзo""{AFAFAF}Tranporte de Sucata\n{AFAFAF}Transporte de Mуveis\n{AFAFAF}Transporte de Mercadorias para Empresas\n{AFAFAF}Transporte de Materiais para Construзгo""Ok""Cancelar");
    }
    else if(
TranspCheckpointSucata) {
        
DestroyObject(objecttranspsucata);
    }
    
    
DisablePlayerCheckpoint(playerid);
    
    return 
1;

Provavelmente no OnDialogResponse estб a faltar isto:

PHP код:
CheckCarregarTransportador false;
TranspCheckpointSucata true



Re: Checkpoint Com problema. - ThiagoGamemodes - 31.07.2018

bruxo00 й tipo assim, quando eu estou entrando nos outros checkpoint estб lendo TODOS os checkpoint ao mesmo tempo como se nгo estivesse conseguindo ver em qual checkpoint o player estб...


Re: Checkpoint Com problema. - ThiagoGamemodes - 31.07.2018

Acabei de testar e й o seguinte, ele estб reconhecento todos checkpoint como se fosse o primeiro nгo estб verificando o checkpoint certo....


Re: Checkpoint Com problema. - bruxo00 - 31.07.2018

Й porque as variбveis estгo setadas errado. Experimente como que eu disse.


Re: Checkpoint Com problema. - ThiagoGamemodes - 31.07.2018

Quote:
Originally Posted by bruxo00
Посмотреть сообщение
Й porque as variбveis estгo setadas errado. Experimente como que eu disse.
eu testei e ainda sim nгo foi brother, ele estб detectando o primeiro checkpoint toda vida na ordem que estб codado:

public OnPlayerEnterCheckpoint(playerid)
{
if(CheckHQTransportador) {
ChatMsg(playerid, BLUE, "Vocк chegou ao local da sua profissгo, digite /trabalhar para comeзar a trabalhar."); Apenas essa linha ele estб pegando o resto ele nгo estб vendo quando eu entro no outro check
}

else if(CheckCarregarTransportador) {
ShowPlayerDialog(playerid, MenuTransportador, DIALOG_STYLE_LIST, "Tipos de Serviзo", "{AFAFAF}Tranporte de Sucata\n{AFAFAF}Transporte de Mуveis\n{AFAFAF}Transporte de Mercadorias para Empresas\n{AFAFAF}Transporte de Materiais para Construзгo", "Ok", "Cancelar");
}

else if(TranspCheckpointSucata) {
DestroyObject(objecttranspsucata);
}

DisablePlayerCheckpoint(playerid);
return true;
}


Re: Checkpoint Com problema. - SmokeKiLL - 31.07.2018

Tenta assim:
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
CheckHQTransportador == 1) {
    
ChatMsg(playeridBLUE"Vocк chegou ao local da sua profissгo, digite /trabalhar para comeзar a trabalhar."); Apenas essa linha ele estб pegando o resto ele nгo estб vendo quando eu entro no outro check
    
}
    else if(
CheckCarregarTransportador == 1) {
    
ShowPlayerDialog(playeridMenuTransportadorDIALOG_STYLE_LIST"Tipos de Serviзo""{AFAFAF}Tranporte de Sucata\n{AFAFAF}Transporte de Mуveis\n{AFAFAF}Transporte de Mercadorias para Empresas\n{AFAFAF}Transporte de Materiais para Construзгo""Ok""Cancelar");
    }
    else if(
TranspCheckpointSucata == 1) {
    
DestroyObject(objecttranspsucata);
    }
    
DisablePlayerCheckpoint(playerid);
    return 
true;

@Edit Se funcionar... sete a variбvel para 0 quando ele chegar no Checkpoint


Re: Checkpoint Com problema. - ThiagoGamemodes - 31.07.2018

Quote:
Originally Posted by SmokeKiLL
Посмотреть сообщение
Tenta assim:
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
CheckHQTransportador == 1) {
    
ChatMsg(playeridBLUE"Vocк chegou ao local da sua profissгo, digite /trabalhar para comeзar a trabalhar."); Apenas essa linha ele estб pegando o resto ele nгo estб vendo quando eu entro no outro check
    
}
    else if(
CheckCarregarTransportador == 1) {
    
ShowPlayerDialog(playeridMenuTransportadorDIALOG_STYLE_LIST"Tipos de Serviзo""{AFAFAF}Tranporte de Sucata\n{AFAFAF}Transporte de Mуveis\n{AFAFAF}Transporte de Mercadorias para Empresas\n{AFAFAF}Transporte de Materiais para Construзгo""Ok""Cancelar");
    }
    else if(
TranspCheckpointSucata == 1) {
    
DestroyObject(objecttranspsucata);
    }
    
DisablePlayerCheckpoint(playerid);
    return 
true;

@Edit Se funcionar... sete a variбvel para 0 quando ele chegar no Checkpoint
Obrigado, funcionou perfeitamente, sу queria que tivesse uma maneira mais fбcil para apenas identificar em qual check o player estб, pois ficar setando 0 e 1 no final das contas vai dar bastante coisa... mas mesmo assim, obrigado por tudo aos 2 pela ajuda