OnDialogResponse (Dialog_Style_Input) need help! T_T
#6

I think it will solve your problem .


Just one symbol can be put inside the ' '.


Example:


pawn Код:
'A' //It will work
'1'//It will work
'10'//It won't work
'AB'//It won't work

So, just separate the numbers (like 10) in parts :


pawn Код:
else if(inputtext[0] == '1' && inputtext[1] == '0')
        {
            if(GetPlayerMoney(playerid) < 9000) return SendClientMessage(playerid, 0xFFFFFFFF, NEC);
            else
            {
                GivePlayerMoney(playerid, -9000);
                GivePlayerWeapon(playerid, 33, 800);
                SendClientMessage(playerid, 0xFFFFFFFF, "Buying weapon success.");
            }
        }
        else if(inputtext[0] == '1' && inputtext[1] == '1')
        {
            if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFFFFFFFF, NEC);
            else
            {
                GivePlayerMoney(playerid, -10000);
                GivePlayerWeapon(playerid, 34, 800);
                SendClientMessage(playerid, 0xFFFFFFFF, "Buying weapon success.");
            }
        }
        else if(inputtext[0] == '1' && inputtext[1] == '2')
        {
            if(GetPlayerMoney(playerid) < 6500) return SendClientMessage(playerid, 0xFFFFFFFF, NEC);
            else
            {
                GivePlayerMoney(playerid, -6500);
                GivePlayerWeapon(playerid, 30, 1000);
                SendClientMessage(playerid, 0xFFFFFFFF, "Buying weapon success.");
            }
        }
        else if(inputtext[0] == '1' && inputtext[1] == '3')
        {
            if(GetPlayerMoney(playerid) < 7000) return SendClientMessage(playerid, 0xFFFFFFFF, NEC);
            else
            {
                GivePlayerMoney(playerid, -7000);
                GivePlayerWeapon(playerid, 31, 1000);
                SendClientMessage(playerid, 0xFFFFFFFF, "Buying weapon success.");
            }
        }
        else if(inputtext[0] == '1' && inputtext[1] == '4')
        {
            if(GetPlayerMoney(playerid) < 300) return SendClientMessage(playerid, 0xFFFFFFFF, NEC);
            else
            {
                GivePlayerMoney(playerid, -300);
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 100);
                SendClientMessage(playerid, 0xFFFFFFFF, "Buying weapon success.");
            }
        }


I hope that i have helped .
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)