Автор: sOflY
В public OnPlayerClickPlayer(playerid, clickedplayerid, source)
Code: Select all
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new str[126],sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid,sendername,sizeof(sendername));
SetPVarInt(clickedplayerid,"PlayerID_Clicked",playerid);
format(str,sizeof(str),"Игрок %d хочет телепортироваться к вам, телепортировать его?",sendername);
ShowPlayerDialog(clickedplayerid,1,DIALOG_STYLE_MSGBOX,"Телепорт",str,"Ок","Нет");
return 1;
}
В public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
Code: Select all
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1 && response)
{
new Float:cX,Float:cY,Float:cZ;
GetPlayerPos(playerid,cX,cY,cZ);
SetPlayerPos(GetPVarInt(playerid,"PlayerID_Clicked"),cX,cY,cZ);
DeletePVar(playerid,"PlayerID_Clicked");
}
return 1;
}