[Ajuda] Checar se o jogador tem "as armas"
#1

galera,eu fiz 1 sistema de armas e to tendo um problema.
Eu dou a ele o numero de armas que ele escolhe,mas quando ele vai entregar,entrega tudo errado.
olhem como estб
pawn Код:
new eagle = 0;
new shotgun = 0;
new mp5 = 0;
new ak47 = 0;
new m4 = 0 ;
new rifle = 0;

if(dialogid == sistemadearmas)
    {
        if(response == sistemadearmas)
        {
            if(listitem == 0)
            {
            ShowPlayerDialog(playerid, sistemadearmass, DIALOG_STYLE_LIST, "Industria de armas", "10 Shotgun's >>  $ 4000\n20 shotgun's >>  $ 8000\n30 shotgun's >>  $ 12000\n40 shotgun's >>  $ 160000\nNenhuma shotgun", "Comprar", "Sair");
                        GivePlayerMoney(playerid, -2000);
                    eagle = (playerid,10);
            SendClientMessage(playerid,-1 , "Ok,escolha agora quantas Shotgun's vocк quer comprar !");
                return 1;
            }
            if(listitem == 1)
            {
            ShowPlayerDialog(playerid, sistemadearmass, DIALOG_STYLE_LIST, "Industria de armas", "10 Shotgun's >>  $ 4000\n20 shotgun's >>  $ 8000\n30 shotgun's >>  $ 12000\n40 shotgun's >>  $ 160000\nNenhuma shotgun", "Comprar", "Sair");
                                SendClientMessage(playerid,-1 , "Ok,escolha agora quantas Shotgun's vocк quer comprar !");
            GivePlayerMoney(playerid, -4000);
                eagle = (playerid,20);         
                return 1;
            }
            if(listitem == 2)
            {
            ShowPlayerDialog(playerid, sistemadearmass, DIALOG_STYLE_LIST, "Industria de armas", "10 Shotgun's >>  $ 4000\n20 shotgun's >>  $ 8000\n30 shotgun's >>  $ 12000\n40 shotgun's >>  $ 160000\nNenhuma shotgun", "Comprar", "Sair");
                                SendClientMessage(playerid,-1 , "Ok,escolha agora quantas Shotgun's vocк quer comprar !");
                                GivePlayerMoney(playerid, -6000);
                                eagle = 30;
                return 1;
            }
            if(listitem == 3)
            {
            ShowPlayerDialog(playerid, sistemadearmass, DIALOG_STYLE_LIST, "Industria de armas", "10 Shotgun's >>  $ 4000\n20 shotgun's >>  $ 8000\n30 shotgun's >>  $ 12000\n40 shotgun's >>  $ 160000\nNenhuma shotgun", "Comprar", "Sair");
                                SendClientMessage(playerid,-1 , "Ok,escolha agora quantas Shotgun's vocк quer comprar !");
                                GivePlayerMoney(playerid, -8000);
                                eagle = 40;
                return 1;
            }
            if(listitem == 4)
            {
            ShowPlayerDialog(playerid, sistemadearmass, DIALOG_STYLE_LIST, "Industria de armas", "10 Shotgun's >>  $ 4000\n20 shotgun's >>  $ 8000\n30 shotgun's >>  $ 12000\n40 shotgun's >>  $ 160000\nNenhuma shotgun", "Comprar", "Sair");
                                SendClientMessage(playerid,-1 , "Ok,vocк nгo quer comprar eagle,escolha quantas shotgun's vocк quer comprar !");
                return 1;
            }
            }
            }


Quando ele entrar em 1 checkpoint executa a public abaixo :

forward tirandoarma(playerid);
public tirandoarma(playerid)
{
        if(eagle < 10)
        {
        SendClientMessage(playerid,0xFF2D2DAA,"Vocк acha que somos cegos nй ? Sua caminhonete nгo tem nenhuma arma !");
        return 1;
        }
        {
        if(eagle = 10){
        SendClientMessage(playerid,0xFF2D2DAA,"As armas foram colocadas no depуsito e vocк ganhou $8,000 na venda. !");
        TogglePlayerControllable(playerid,1);
        GivePlayerMoney(playerid, 8000);
        }
        }
        if(eagle = 20){
        SendClientMessage(playerid,0xFF2D2DAA,"As armas foram colocadas no depуsito e vocк ganhou $12,000 na venda. !");
        TogglePlayerControllable(playerid,1);
        GivePlayerMoney(playerid, 12000);
        }
        }
Ele estб ganhando 20k,pois estб executando as 2 if.Eu quero que caso ele tenha 10 eagle,executar X funзгo,caso tenha 20 executar Y e assim por diante
Reply
#2

pawn Код:
new eagle = 0;
new shotgun = 1;
new mp5 = 2;
new ak47 = 3;
new m4 = 4;
new rifle = 5;
Reply
#3

Quote:
Originally Posted by davi54723
Посмотреть сообщение
pawn Код:
new eagle = 0;
new shotgun = 1;
new mp5 = 2;
new ak47 = 3;
new m4 = 4;
new rifle = 5;
nгo deu certo,ele executo as 2 funзхes

[18:09:28] As armas foram colocadas na caminhonete,leve-as atй o ponto de fornecimento

[18:09:52] Vocк chegou na бrea de fornecimento,aguarde enquanto suas armas estгo sendo colocadas no deposito!

[18:10:03] As armas foram colocadas no depуsito e vocк ganhou $8,000 na venda. !

[18:10:03] As armas foram colocadas no depуsito e vocк ganhou $12,000 na venda. !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)