[RESOLVIDO]Radio Aйreo (Chat entre avioes e helicуpteros) -
Mattos - 16.08.2011
Pessoal,
Ja venho ae tentando fazer esse comando, mas nao consigo de jeito nenhum...
um chat entre todos os ids de aviгo e helicуpteros...
cheguei a tentar fazer a partir do tуpico
https://sampforum.blast.hk/showthread.php?tid=116676
mas tudo que consegui foram erros. Cheguei a extrair a parte do chat desse FS para piloto
http://pastebin.com/D5gQ3SFy atй consegui porem todos player conseguiam ler. Atй agora estou tentando mais sem resultados.
entao voltei a estaca zero e sу o que tenho й:
Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == 36) // Radio Aйreo
{
return 0;
}
}
Sendo que 36 й $
Bom se alguem pudesse me ajudar eu agradeceria muito. Valeu galera.
Re: [PEDIDO]Radio Aйreo (Chat entre avioes e helicуpteros) -
Macintosh - 16.08.2011
pawn Код:
#define MAXPLAYERS 40 // mude para a qntd de slots do teu sv :3
forward ChatInAr(Cor, const string[]);
pawn Код:
public OnPlayerText(playerid, text[])
{
if(GetVehicleModel(playerid) == 562) // aqui vocк vai substituir pelos modelos dos heli e aviхes ou faz uma stock pra ficar melhor :)
{
ChatInAr(Cor, const string[]);
}
return 0;
}
pawn Код:
public ChatInAr(Cor, const string[],level)
{
for(new i = 0; i < MAXPLAYERS; i++)
{
if(IsPlayerConnected(i) && GetVehicleModel(playerid) == 562) // aqui vocк vai substituir pelos modelos dos heli e aviхes ou faz uma stock pra ficar melhor :)
{
SendClientMessage(i, Cor, string);
}
}
return 1;
}
Re: [PEDIDO]Radio Aйreo (Chat entre avioes e helicуpteros) -
ViniBorn - 16.08.2011
Vocк tem que verificar quais os jogadores estгo em um aviгo. E aн enviar a mensagem pra eles. Ex:
pawn Код:
for(new i=0 ; i < GetMaxPlayers() ;i++)
if(IsPlayerConnected(i) && PlayerNoAviao(i))
SendClientMessage(i,-1,text);
Re: [PEDIDO]Radio Aйreo (Chat entre avioes e helicуpteros) -
Mattos - 16.08.2011
Quote:
Originally Posted by Shickcard
pawn Код:
#define MAXPLAYERS 40 // mude para a qntd de slots do teu sv :3 forward ChatInAr(Cor, const string[]);
pawn Код:
public OnPlayerText(playerid, text[]) { if(GetVehicleModel(playerid) == 562) // aqui vocк vai substituir pelos modelos dos heli e aviхes ou faz uma stock pra ficar melhor :) { ChatInAr(Cor, const string[]); } return 0; }
pawn Код:
public ChatInAr(Cor, const string[],level) { for(new i = 0; i < MAXPLAYERS; i++) { if(IsPlayerConnected(i) && GetVehicleModel(playerid) == 562) // aqui vocк vai substituir pelos modelos dos heli e aviхes ou faz uma stock pra ficar melhor :) { SendClientMessage(i, Cor, string); } } return 1; }
|
Ali no OnPlayerText nao deveria ser?
Re: [PEDIDO]Radio Aйreo (Chat entre avioes e helicуpteros) -
Macintosh - 16.08.2011
pra que text[0] == 36? lol vocк tem q getar o modelo do veiculo . GetVehicleModel.
Re: [PEDIDO]Radio Aйreo (Chat entre avioes e helicуpteros) -
Mattos - 16.08.2011
Uй, mais preciso definir qual caractere que vai iniciar a mensagem... no caso 36 = $
Re: [PEDIDO]Radio Aйreo (Chat entre avioes e helicуpteros) -
Mattos - 16.08.2011
ah desculpa... acho que entendi o que vc fez... ja fez um chat direto... o que eu queria й tipo... o cara dentro do aviao ou heli escreve "$ permissao para decolagem" ae sai no chat: "Radio Aйreo: Player (id): permissao para decolagem" sendo que a mensagem do Rбdio sу sai pra quem ta tambem dentro de aviao ou heli
Re: [PEDIDO]Radio Aйreo (Chat entre avioes e helicуpteros) -
Macintosh - 16.08.2011
lol nunca mexi com isso somente com RPG/RP entгo desfavoreзo nessa parte.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '$')
{
if(GetVehicleModel(playerid) == 562)
{
ChatInAr(Cor, const string[]);
}
else
{
SendClientMessage(playerid, 0xE31919FF, "Nгo estбs na hydra!");
}
}
return 0;
}
Re: [PEDIDO]Radio Aйreo (Chat entre avioes e helicуpteros) -
Mattos - 16.08.2011
MAs vc saberia ao menos fazer com que saнsse junto da mensagem do cara que ta no aviao ou heli "Rбdio Aйreo + Nome do Player"?
Re: [PEDIDO]Radio Aйreo (Chat entre avioes e helicуpteros) -
Macintosh - 16.08.2011
pawn Код:
public ChatInAr(Cor, const string[],level)
{
for(new i = 0; i < MAXPLAYERS; i++)
{
if(IsPlayerConnected(i) && GetVehicleModel(playerid) == 562) // aqui vocк vai substituir pelos modelos dos heli e aviхes ou faz uma stock pra ficar melhor :)
{
format(string, sizeof(string), "Rбdio Aйreo: (%s) - %s", pNome(playerid), string);
SendClientMessage(i, Cor, string);
}
}
return 1;
}
pawn Код:
stock pNome(playerid)
{
new nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, sizeof(nome));
return nome;
}