[Ajuda] Mostrando Dialog Para Todos
#1

Dae galera td de boa ?
Bom meu problema й que criei um sistemazin aqui, sу que ele estб mostrando a Dialog para todos os jogadores, que estгo dentro ou fora de um veнculo.

Gostaria que mostrasse apenas para o motorista do veнculo.

Cуdigo:


pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    SendClientMessage(playerid, verde, "Informaзгo: O servidor possui um sistema de Painel, vocк deve ligar o motor de seu veнculo manualmente. ( /Painel )");
    SetTimer("MostrarPainel", 2500, false);
    return 1;
}

Coloquei o SetTimer, para esperar um tempo, pois se nгo o player da 'Enter' ou 'F', e ja aparece o painel.

Agora o SetTimer:


pawn Код:
forward MostrarPainel(playerid);
public MostrarPainel(playerid)
{
    ShowPlayerDialog(playerid, DIALOG_Painel, DIALOG_STYLE_LIST, "Painel para veнculos", "Motor (Ligar)\nMotor (Desligar)\nFarol (Ligar)\nFarol (Desligar)\nCapo (Abrir)\nCapo (Fechar)\nPorta Malas (Abrir)\nPorta Malas (Fechar)\nAlarme (Ligar)\nAlarme (Desligar)\nFreio de Mao (Ativar)\nFreio de Mao (Desativar)\nTrancar\nDestrancar\nReparar Veiculo ($20000)\n","Selecionar","");
    return 1;
}

Nгo estou conseguindo resolver o erro, please me ajudem.
Reply
#2

pawn Код:
new TimerPainel[MAX_PLAYERS];
//
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    SendClientMessage(playerid, verde, "Informaзгo: O servidor possui um sistema de Painel, vocк deve ligar o motor de seu veнculo manualmente. ( /Painel )");
    TimerPainel[playerid] = SetTimerEx("MostrarPainel", 2500, false, "d", playerid);
    return 1;
}
//
forward MostrarPainel(playerid);
public MostrarPainel(playerid)
{
    KillTimer(TimerPainel[playerid]);
    ShowPlayerDialog(playerid, DIALOG_Painel, DIALOG_STYLE_LIST, "Painel para veнculos", "Motor (Ligar)\nMotor (Desligar)\nFarol (Ligar)\nFarol (Desligar)\nCapo (Abrir)\nCapo (Fechar)\nPorta Malas (Abrir)\nPorta Malas (Fechar)\nAlarme (Ligar)\nAlarme (Desligar)\nFreio de Mao (Ativar)\nFreio de Mao (Desativar)\nTrancar\nDestrancar\nReparar Veiculo ($20000)\n","Selecionar","");
    return 1;
}
Reply
#3

Hum, valeu, eu adicionei isto tambйm, para mostrar apenas para o piloto:

pawn Код:
forward MostrarPainel(playerid);
public MostrarPainel(playerid)
{
    KillTimer(TimerPainel[playerid]);
    new playerstate = GetPlayerState(playerid);
    if(playerstate == PLAYER_STATE_DRIVER)
    {
        ShowPlayerDialog(playerid, DIALOG_Painel, DIALOG_STYLE_LIST, "Painel para veнculos", "Motor (Ligar)\nMotor (Desligar)\nFarol (Ligar)\nFarol (Desligar)\nCapo (Abrir)\nCapo (Fechar)\nPorta Malas (Abrir)\nPorta Malas (Fechar)\nAlarme (Ligar)\nAlarme (Desligar)\nFreio de Mao (Ativar)\nFreio de Mao (Desativar)\nTrancar\nDestrancar\nReparar Veiculo ($20000)\n","Selecionar","");
    }
    return 1;
}
Precisaria disso ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)