Tesztelve. Mûködik!
[pawn]
#include a_samp
#define DIALOGID 1111
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(\"/nyit1000\", cmdtext, true))
{
if(!IsPlayerInRangeOfPoint(playerid, 7.0, 1951.4381,1343.0376,15.3746))return SendClientMessage(playerid,0xFFFFFFFF,\"Nem vagy a közelben!\");
if(strfind(PlayerName(playerid), \"[banda]\", true) != -1) ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_INPUT, \"Felsõ Szöveg
\", \"Mivan veled Mikós? Ellopták a dinnyefõdet?\", \"Igen\", \"Nem\");
else SendClientMessage(playerid,0xFFFFFFFF,\"Nem vagy tag!\");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOGID && response)
{
if(strfind(inputtext, \"igen\", true) != -1)
{
SendClientMessage(playerid,0xFFFFFFFF,\"Yeah!\");
//kapunyitás
}
else
{
SendClientMessage(playerid,0xFFFFFFFF,\"Nem Yeah!\");
}
}
return 1;
}
stock PlayerName(playerid)
{
new name2[255];
GetPlayerName(playerid, name2, 255);
return name2;
}
[/pawn]