05.04.2019, 17:57
(
Last edited by 1sbedx; 05/04/2019 at 11:09 PM.
)
Й isso?
PHP Code:
#include "a_samp"
#include "streamer"
new
AreaID,
PlayerAreaID[MAX_PLAYERS] = {-1, ...};
main() {
AreaID = CreateDynamicSphere(0.0, 0.0, 3.0, 2.0);
}
public OnPlayerEnterDynamicArea(playerid, areaid) {
if (areaid == AreaID) {
PlayerAreaID[playerid] = areaid;
}
return 1;
}
public OnPlayerLeaveDynamicArea(playerid, areaid) {
if (areaid == AreaID) {
PlayerAreaID[playerid] = -1;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]) {
if (!strcmp(cmdtext, "/teste", true)) {
new
content[] = "\
Item 1\n\
Item 2\n\
Item 3\n\
Item 4\n\
";
ShowPlayerDialog(playerid, 4430,
DIALOG_STYLE_LIST,
((PlayerAreaID[playerid] == -1) ? ("Aviso") : ("Lista de itens")),
((PlayerAreaID[playerid] == -1) ? ("Vocк nгo estб na бrea apropriada.") : (content)),
((PlayerAreaID[playerid] == -1) ? ("Estб bem") : ("Escolher")), "Fechar");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
if (!response)
return 1;
if (dialogid == 4430) {
if (PlayerAreaID[playerid] == -1)
return 1;
printf("Vocк selecionou o item: %i.", (listitem + 1));
}
return 1;
}