30.11.2018, 11:53
Deve haver alguns erros...
Tente seguir a lуgica, boa sorte.
Tente seguir a lуgica, boa sorte.
PHP код:
static
gPlayerRequest[MAX_PLAYERS] = {INVALID_PLAYER_ID, ...};
CMD:convidarcompras(playerid, params[]) {
static
requestid;
if (sscanf(params, "u", requestid))
return;
if (gPlayerRequest[playerid] != INVALID_PLAYER_ID || gPlayerRequest[requestid] != INVALID_PLAYER_ID)
return;
gPlayerRequest[requestid] = playerid;
static
str[80];
format(str, sizeof(str), "%s estб convidando vocк a roubar o banco central com ele.", NomeP(playerid));
ShowPlayerDialog(requestid, 3831, DIALOG_STYLE_MSGBOX, "Convite para assalto", str, "Aceitar", "Recusar");
return 1;
}
hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
if (dialogid == 3831) {
static
str[46];
if (response) {
gPlayerRequest[gPlayerRequest[playerid]] = playerid;
format(str, sizeof(str), "%s aceitou seu convite.", NomeP(playerid));
SendClientMessage(gPlayerRequest[playerid], -1, str);
return;
}
format(str, sizeof(str), "%s recusou seu convite.", NomeP(playerid));
SendClientMessage(gPlayerRequest[playerid], -1, str);
gPlayerRequest[playerid] = INVALID_PLAYER_ID;
}
}
hook OnPlayerDisconnect(playerid, reason) {
if (gPlayerRequest[playerid] != INVALID_PLAYER_ID) {
gPlayerRequest[gPlayerRequest[playerid]] = INVALID_PLAYER_ID;
static
str[54];
format(ste, sizeof(str), "Seu parceiro %s se desconectou.", NomeP(playerid));
SendClientMessage(gPlayerRequest[playerid], -1, str);
gPlayerRequest[playerid] = INVALID_PLAYER_ID;
}
}