[Ajuda] Me ajuda no raciocнnio?
#4

Deve haver alguns erros...
Tente seguir a lуgica, boa sorte.

PHP код:
static
    
gPlayerRequest[MAX_PLAYERS] = {INVALID_PLAYER_ID, ...};
CMD:convidarcompras(playeridparams[]) {
    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(strsizeof(str), "%s estб convidando vocк a roubar o banco central com ele."NomeP(playerid));
    
ShowPlayerDialog(requestid3831DIALOG_STYLE_MSGBOX"Convite para assalto"str"Aceitar""Recusar");
    return 
1;
}
hook OnDialogResponse(playeriddialogidresponselistiteminputtext[]){
    if (
dialogid == 3831) {
        static
            
str[46];
        if (
response) {
            
gPlayerRequest[gPlayerRequest[playerid]] = playerid;
            
format(strsizeof(str), "%s aceitou seu convite."NomeP(playerid));
            
SendClientMessage(gPlayerRequest[playerid], -1str);
            return;
        }
        
format(strsizeof(str), "%s recusou seu convite."NomeP(playerid));
        
SendClientMessage(gPlayerRequest[playerid], -1str);
        
gPlayerRequest[playerid] = INVALID_PLAYER_ID;
    }
}
hook OnPlayerDisconnect(playeridreason) {
    if (
gPlayerRequest[playerid] != INVALID_PLAYER_ID) {
        
gPlayerRequest[gPlayerRequest[playerid]] = INVALID_PLAYER_ID;
        static
            
str[54];
        
format(stesizeof(str), "Seu parceiro %s se desconectou."NomeP(playerid));
        
SendClientMessage(gPlayerRequest[playerid], -1str);
        
gPlayerRequest[playerid] = INVALID_PLAYER_ID;
    }

Reply


Messages In This Thread
Me ajuda no raciocнnio? - by Klaskn - 30.11.2018, 04:21
Re: Me ajuda no raciocнnio? - by pWesley - 30.11.2018, 05:43
Re: Me ajuda no raciocнnio? - by Klaskn - 30.11.2018, 07:07
Re: Me ajuda no raciocнnio? - by 1sbedx - 30.11.2018, 11:53

Forum Jump:


Users browsing this thread: 1 Guest(s)