ajuda aqui dialog -
didimk157 - 28.11.2016
PHP код:
CMD:hq(playerid)
{
ShowPlayerDialog(playerid, 9998, DIALOG_STYLE_TABLIST_HEADERS,"{1D4FC4}» {ffffff}Hierarquia da Comunidade", "{1D4FC4}» {ffffff}Cargos da Comunidade\n{1D4FC4}- {ffffff}Administradores\n{1D4FC4}- {ffffff}Lideres\n{1D4FC4}- {ffffff}Donos\n{1D4FC4}- {ffffff}Frentes\n{1D4FC4}- {ffffff}Gerentes\n{1D4FC4}- {ffffff}Vapor\n{1D4FC4}- {ffffff}Fogueteiros", "Selecionar","Cancelar");
return 1;
}
PHP код:
if(dialogid == 9998)
{
if(response)
{
new gStr[128], info[2048];
if(listitem == 0)// Administrador
{
for(new i; i < MAX_PLAYERS; ++i)
{
if(Player[i][Admin] > 0 && Player[i][Faccoes] == Player[playerid][Faccoes])
{
format(gStr, sizeof(gStr), "{1D4FC4}» {ffffff}%s\n", Nome(i));
strcat(info, gStr);
}
}
strcat(info, " ");
ShowPlayerDialog(playerid, D_NULL, DIALOG_STYLE_LIST,"{1D4FC4}» {ffffff}Administradores da Comunidade", info,"Ok","");
return 1;
}
if(listitem == 1)// lider
{
for(new i; i < MAX_PLAYERS; ++i)
{
if(Player[i][Lider] == 1 && Player[i][Faccoes] == Player[playerid][Faccoes])
{
format(gStr, sizeof(gStr), "{1D4FC4}» {ffffff}%s\n", Nome(i));
strcat(info, gStr);
}
}
strcat(info, " ");
ShowPlayerDialog(playerid, D_NULL, DIALOG_STYLE_LIST,"{1D4FC4}» {ffffff}Lideres da comunidade", info,"Ok","");
return 1;
}
if(listitem == 2)// dono
{
for(new i; i < MAX_PLAYERS; ++i)
{
if(Player[i][Dono] == 1 && Player[i][Faccoes] == Player[playerid][Faccoes])
{
format(gStr, sizeof(gStr), "{1D4FC4}» {ffffff}%s\n", Nome(i));
strcat(info, gStr);
}
}
strcat(info, " ");
ShowPlayerDialog(playerid, D_NULL, DIALOG_STYLE_LIST,"{1D4FC4}» {ffffff}Donos da comunidade", info,"Ok","");
return 1;
}
if(listitem == 3)// Frentes
{
for(new i; i < MAX_PLAYERS; ++i)
{
if(Player[i][Cargo]== 4 && Player[i][Faccoes] == Player[playerid][Faccoes])
{
format(gStr, sizeof(gStr), "{1D4FC4}» {ffffff}%s\n", Nome(i));
strcat(info, gStr);
}
}
strcat(info, " ");
ShowPlayerDialog(playerid, D_NULL, DIALOG_STYLE_LIST,"{1D4FC4}» {ffffff}Frentes da Comunidade", info,"Ok","");
return 1;
}
if(listitem == 4)// Gerentes
{
for(new i; i < MAX_PLAYERS; ++i)
{
if(Player[i][Cargo]== 3 && Player[i][Faccoes] == Player[playerid][Faccoes])
{
format(gStr, sizeof(gStr), "{1D4FC4}» {ffffff}%s\n", Nome(i));
strcat(info, gStr);
}
}
strcat(info, " ");
ShowPlayerDialog(playerid, D_NULL, DIALOG_STYLE_LIST,"{1D4FC4}» {ffffff}Gerentes da Comunidade",info,"Ok","");
return 1;
}
if(listitem == 5)// Vaporzгo
{
for(new i; i < MAX_PLAYERS; ++i)
{
if(Player[i][Cargo]== 2 && Player[i][Faccoes] == Player[playerid][Faccoes])
{
format(gStr, sizeof(gStr), "{1D4FC4}» {ffffff}%s\n", Nome(i));
strcat(info, gStr);
}
}
strcat(info, " ");
ShowPlayerDialog(playerid, D_NULL, DIALOG_STYLE_LIST,"{1D4FC4}» {ffffff}Vapores da Comunidade", info,"Ok","");
return 1;
}
if(listitem == 6)// Fogueteiros
{
for(new i; i < MAX_PLAYERS; ++i)
{
if(Player[i][Cargo]==1 && Player[i][Faccoes] == Player[playerid][Faccoes])
{
format(gStr, sizeof(gStr), "{1D4FC4}» {ffffff}%s\n", Nome(i));
strcat(info, gStr);
}
}
strcat(info, " ");
ShowPlayerDialog(playerid, D_NULL, DIALOG_STYLE_LIST,"{1D4FC4}» {ffffff}Fogueteiros da Comunidade", info,"Ok","");
return 1;
}
}
return 1;
}
erros aqui ajudem pfv
http://imgur.com/a/p0LfJ
Re: ajuda aqui rapidao -
nasser - 28.11.2016
Desculpa n tinha entendido
Re: ajuda aqui rapidao -
didimk157 - 28.11.2016
Ele continua puxando sem permissao tipo eu quero q o player seja puxado so quando ele aceitar
Re: ajuda aqui rapidao -
MBJ - 28.11.2016
Voce esta setando a posiзгo dele antes de mostrar a Dialog
PHP код:
if(Player[playerid][pFaccoes] == Player[i][pFaccoes])
{
new String[256];
SetPlayerPos(i, X+1, Y+1, Z); //ja seta antes da dialog
format(String, sizeof(String), "O {FF0000}%s:{FFFFD2}Usou /trazertodos Aceite para ir ate ele ! ", getPName(playerid));
SendClientMessage(i, COR_INFO, String);
ShowPlayerDialog(i, DIALOG_MOVE_FAC, DIALOG_STYLE_MSGBOX, "Trazendo", "Vocк aceita ser puxado", "Sim", "Nгo");
}
Use assim:
PHP код:
dcmd_trazertodos(playerid, params[])
{
#pragma unused params
if(Player[playerid][pAdmin] >= 5 || Player[playerid][pFrente] >= 1)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(Player[playerid][pFaccoes] == Player[i][pFaccoes])
{
new String[256];
format(String, sizeof(String), "O {FF0000}%s:{FFFFD2}Usou /trazertodos Aceite para ir ate ele ! ", getPName(playerid));
SendClientMessage(i, COR_INFO, String);
ShowPlayerDialog(i, DIALOG_MOVE_FAC, DIALOG_STYLE_MSGBOX, "Trazendo", "Vocк aceita ser puxado", "Sim", "Nгo");
}
}
}
}
else
{
SendClientMessage(playerid, COR_ERRO, "Vocк Nгo Tem Permissгo!");
}
return 1;
}
PHP код:
if(dialogid == DIALOG_MOVE_FAC)
{
if(response)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(ownerID[playerid], x, y, z);
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(ownerID[playerid]));
SetPlayerInterior(playerid, GetPlayerInterior(ownerID[playerid]));
SetPlayerPos(playerid, x, y, z+2);
}
return 0;
}
Re: ajuda aqui rapidao -
didimk157 - 28.11.2016
vlw MBJ foi mais agr tipo assim tem como eu eu colocar assim o nome do player q aceitou e aparecer a msg o player aceitou seu pedido de trazer ??
Re: ajuda aqui rapidao -
MBJ - 28.11.2016
PHP код:
if(dialogid == DIALOG_MOVE_FAC)
{
if(response)
{
new name[MAX_PLAYER_NAME], Float:x, Float:y, Float:z;
GetPlayerName(playerid, name, sizeof(name));//pega o nome do player que foi puxado
format(String, sizeof(String), "O player %s aceitou seu convite para traze-lo atй vocк", name);//formata a mensagem para aparecer o nome do player
SendClientMessage(playerid, -1, string);//envia a mensagem formatada para quem foi puxado
GetPlayerName(ownerID[playerid], name, sizeof(name));//pega o nome do player que puxou
format(String, sizeof(String), "Vocк foi puxado por %s", name);//formata a mensagem para aparecer o nome do player que puxou
SendClientMessage(playerid, -1, string);//envia a mensagem formatada para quem puxou
GetPlayerPos(ownerID[playerid], x, y, z);
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(ownerID[playerid]));
SetPlayerInterior(playerid, GetPlayerInterior(ownerID[playerid]));
SetPlayerPos(playerid, x, y, z+2);
}
return 0;
}
Re: ajuda aqui rapidao -
didimk157 - 28.11.2016
foi vlw msm
Re: ajuda aqui rapidao -
didimk157 - 29.11.2016
novo codigo ajuda se poder flw