new gPlayerPizza[MAX_PLAYERS];
CMD:darpizza(playerid,params[])
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COR_CINZA, "* USE: /darpizza [ID]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_CINZA, "Jogador nгo conectado");
if(!IsProx(playerid, id)) return SendClientMessage(playerid, COR_CINZA, "* A pessoa deve estar perto de vocк");
gPlayerPizza[id]++;
GetPlayerName(playerid,nome,MAX_PLAYER_NAME);
GetPlayerName(playerid, Jogador, 23);
GetPlayerName(id, Outro, 23);
format(adminstring, sizeof(adminstring), "* %s levou uma pizza atй o %s", Jogador, Outro);
IsPlayerInRangeForMessage(playerid, COR_PURPLE, adminstring, 10.0);
return 1;
}
CMD:comerpizza(playerid, params[])
{
if(!gPlayerPizza[playerid])
return 1;
gPlayerPizza[playerid]--;
new Outro[MAX_PLAYER_NAME];
GetPlayerName(playerid, Outro, 23);
format(adminstring, sizeof(adminstring), "%s esta comendo uma pizza", Outro);
IsPlayerInRangeForMessage(playerid, COR_PURPLE, adminstring, 10.0);
SetPlayerHealth(playerid, 40.0);
return 1;
}
CMD:chamarevento(playerid, params[])
{
new id;
new str[200];
new nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, 24);
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "Use /chamarevento [ID]");
format(str, sizeof(str), "O Jogador %s Estб te convidado\npara um evento, deseja aceitar?", nome);
ShowPlayerDialog(id, 567, DIALOG_STYLE_MSGBOX, "Evento", str, "Aceitar", "Negar");
SendClientMessage(playerid, -1, "Jogador Convidado, aguarde a resposta");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 567)
{
if(response)
{
//Oque vai acontecer se ele aceitar...
}
else
{
//Oque vai acontecer se ele negar...
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 567)
{
if(!response) return 1;
//Oque vai acontecer se ele aceitar...
}
return 1;
}
Lucas, mais simples ainda
![]() pawn Код:
|
if(dialogid == 567)
{
if(response)
{
SendClientMessage(playerid, -1, "Vocк aceito o convite.");
}
else
{
SendClientMessage(oponente, -1, "Ele recusou.");
}
}
return 1;
}
LOS O SEU TIPO TEM BUG.
Pois assim que digito o camando abre o dialog e talz Mais tipo quando clico em aceito sу pra fazer teste eu coloquei uma SendClientMessage(...) nгo manda a mensagem e nao faiz nada tentei o do lucas tbm nao funfo o dialog ele abre mais quando clico em ir nao manda a msg. pawn Код:
|
Eu acho que isso, jб nгo й no dialog, й sim na funзгo que vocк coloco, pra quando clicar na opзгo.
|