28.11.2016, 12:42
Voce esta setando a posiзгo dele antes de mostrar a Dialog
Use assim:
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");
}
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;
}