SA-MP Forums Archive
[Ajuda] Problema com comando. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Problema com comando. (/showthread.php?tid=338770)



[Ajuda] Problema com comando. - Joker_OutLock - 01.05.2012

Bom, eu criei um comando /carmenu sу que quando eu digito nada aparece.. O.O, nem da erro de undefined, o comando simplesmente nada aparece cуdigo:

OnPlayerCommandText:

pawn Код:
if(strcmp("/carmenu",cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, 4521354, DIALOG_STYLE_LIST, "{00C2EC}CarMenu [v0.1]", "Motor\nFarol\nAlarme\nPortas\nCapф\nPorta Malas\nCrйditos", "Selecionar", "Cancelar");
        return 1;
    }

OnDialogResponse:

pawn Код:
if(dialogid == 4521354)
    {
        if(response)
        {
            if(listitem == 1)//Motor
            {
                new mot, lu, alar, por, cap, porma, ob;
                new carro = GetPlayerVehicleID(playerid);
                if(carro != INVALID_VEHICLE_ID)
                {
                    if(motor[playerid] == 0)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
                        motor[playerid] = 1;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Motor {2F991A}ligado!");
                        return 1;
                    }
                    else if(motor[playerid] == 1)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
                        motor[playerid] = 0;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Motor {2F991A}desligado!");
                        return 1;
                    }
                }
                return 1;
            }
            if(listitem == 2)//Farol
            {
                new mot, lu, alar, por, cap, porma, ob;
                new carro = GetPlayerVehicleID(playerid);
                if(carro != INVALID_VEHICLE_ID)
                {
                    if(luz[playerid] == 0)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
                        luz[playerid] = 1;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}ligado!");
                        return 1;
                    }
                    else if(luz[playerid] == 1)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
                        luz[playerid] = 0;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}desligado!");
                        return 1;
                    }
                }
                return 1;
            }
            if(listitem == 3)//Alarme
            {
                new mot, lu, alar, por, cap, porma, ob;
                new carro = GetPlayerVehicleID(playerid);
                if(carro != INVALID_VEHICLE_ID)
                {
                    if(alarme[playerid] == 0)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, mot, lu, VEHICLE_PARAMS_ON, por, cap, porma, ob);
                        alarme[playerid] = 1;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Alarme {2F991A}ligado!");
                        return 1;
                    }
                    else if(alarme[playerid] == 1)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, mot, lu, VEHICLE_PARAMS_ON, por, cap, porma, ob);
                        alarme[playerid] = 0;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Alarme {2F991A}desligado!");
                        return 1;
                    }
                }
                return 1;
            }
            if(listitem == 4)//Portas
            {
                new mot, lu, alar, por, cap, porma, ob;
                new carro = GetPlayerVehicleID(playerid);
                if(carro != INVALID_VEHICLE_ID)
                {
                    if(portas[playerid] == 0)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, mot, lu, alar, VEHICLE_PARAMS_ON, cap, porma, ob);
                        portas[playerid] = 1;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Portas {2F991A}abertas!");
                        return 1;
                    }
                    else if(portas[playerid] == 1)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, mot, lu, alar, VEHICLE_PARAMS_OFF, cap, porma, ob);
                        portas[playerid] = 0;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Portas {2F991A}fechadas!");
                        return 1;
                    }
                }
                return 1;
            }
            if(listitem == 5)//Capф
            {
                new mot, lu, alar, por, cap, porma, ob;
                new carro = GetPlayerVehicleID(playerid);
                if(carro != INVALID_VEHICLE_ID)
                {
                    if(capo[playerid] == 0)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, mot, lu, alar, por, VEHICLE_PARAMS_ON, porma, ob);
                        capo[playerid] = 1;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Capo {2F991A}aberto!");
                        return 1;
                    }
                    else if(capo[playerid] == 1)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, mot, lu, alar, por, VEHICLE_PARAMS_OFF, porma, ob);
                        capo[playerid] = 0;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Capo {2F991A}fechado!");
                        return 1;
                    }
                }
                return 1;
            }
            if(listitem == 6)//Porta-malas
            {
                new mot, lu, alar, por, cap, porma, ob;
                new carro = GetPlayerVehicleID(playerid);
                if(carro != INVALID_VEHICLE_ID)
                {
                    if(portamalas[playerid] == 0)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_ON, ob);
                        portamalas[playerid] = 1;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Portamalas {2F991A}aberto!");
                        return 1;
                    }
                    if(portamalas[playerid] == 1)
                    {
                        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                        SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_OFF, ob);
                        portamalas[playerid] = 0;
                        SendClientMessage(playerid, 0xFFFFFFAA, "Portamalas {2F991A}fechado!");
                        return 1;
                    }
                }
                return 1;
            }
            if(listitem == 7)
            {
                ShowPlayerDialog(playerid,2111,DIALOG_STYLE_MSGBOX ,"{00C2EC}Crйditos CarMenu","{FFFFFF}CarMenu [{FB0000}v0.1{FFFFFF}] by Joker_OutLock\nMsn: victormartins3@hotmail.com.","","Fechar");
                return 1;
            }
        } else { return SendClientMessage(playerid, -1, "Menu fechado!!");}
    }
rep+ pra quem ajudar =\


Re: [Ajuda] Problema com comando. - .FuneraL. - 01.05.2012

pawn Код:
} else { return SendClientMessage(playerid, -1, "Menu fechado!!");
           }
       }
   }
 }
return 0;
}
Desculpe a mб Identaзгo , tente fazer assim ^^


Re: [Ajuda] Problema com comando. - Joker_OutLock - 01.05.2012

Nгo funcionou..