[Ajuda] Mostrando Dialog Para Todos - 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] Mostrando Dialog Para Todos (
/showthread.php?tid=406612)
Mostrando Dialog Para Todos -
Gleisson_. - 11.01.2013
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.
Re: Mostrando Dialog Para Todos -
Maklister - 11.01.2013
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;
}
Re: Mostrando Dialog Para Todos -
Gleisson_. - 11.01.2013
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 ?