Putgun in House
#3

Quote:
Originally Posted by MCZOFT
Посмотреть сообщение
Try This my brother

pawn Код:
else if(!strcmp(cmdtext, "/putgun", true))
    {
        new hworld = GetPlayerVirtualWorld(playerid);
        new house = PlayerInfo[playerid][HouseID];
       
        for(new h = 1; h < sizeof(HouseInfo); h++)
        {
            if(hworld == HouseInfo[h][hInsideWorld])
            {
                if(house == HouseInfo[h][hInsideWorld])
                {
                    new
                    string[128], gunname[100], slot, playergun, playerammo;
                    playergun = GetPlayerWeapon(playerid);
                    playerammo = GetPlayerAmmo(playerid);

                    if(playergun < 1) return SCM(playerid, COLOR_LIGHTRED,"[Error]: You do not have a weapon.");
                    if(playerammo < 1) return SCM(playerid, COLOR_LIGHTRED,"[Error]: You do not have any ammo.");
                   
                    if(sscanf(params,"d", slot)) return SCM(playerid, COLOR_GREY,"[Usage]: /house putgun [slot].");
                    if(slot == 1)
                    {
                        if(HouseInfo[h][hWeapon1] != 0) return SCM(playerid, COLOR_LIGHTRED, "There is already a weapon in this slot.");
                        HouseInfo[h][hWeapon1] = playergun;
                        HouseInfo[h][hAmmo1] += playerammo;
                        RemovePlayerWeapon(playerid, playergun);
                        GetWeaponName(playergun, gunname, sizeof(gunname));
                        format(string, sizeof(string), "You have put your %s in slot 1.", gunname);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        PlayerActionMessage(playerid,20.0, "places a weapon in the house vault.");
                    }
                    else if(slot == 2)
                    {
                        if(HouseInfo[h][hWeapon2] != 0) return SCM(playerid, COLOR_LIGHTRED, "There is already a weapon in this slot.");
                        HouseInfo[h][hWeapon2] = playergun;
                        HouseInfo[h][hAmmo2] += playerammo;
                        RemovePlayerWeapon(playerid, playergun);
                        GetWeaponName(playergun, gunname, sizeof(gunname));
                        format(string, sizeof(string), "You have put your %s in slot 2.", gunname);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        PlayerActionMessage(playerid,20.0, "places a weapon in the house vault.");
                    }
                    else if(slot == 3)
                    {
                        if(HouseInfo[h][hWeapon3] != 0) return SCM(playerid, COLOR_LIGHTRED, "There is already a weapon in this slot.");
                        HouseInfo[h][hWeapon3] = playergun;
                        HouseInfo[h][hAmmo3] += playerammo;
                        RemovePlayerWeapon(playerid, playergun);
                        GetWeaponName(playergun, gunname, sizeof(gunname));
                        format(string, sizeof(string), "You have put your %s in slot 3.", gunname);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        PlayerActionMessage(playerid,20.0, "places a weapon in the house vault.");
                    }
                    else if(slot == 4)
                    {
                        if(HouseInfo[h][hWeapon4] != 0) return SCM(playerid, COLOR_LIGHTRED, "There is already a weapon in this slot.");
                        HouseInfo[h][hWeapon4] = playergun;
                        HouseInfo[h][hAmmo4] += playerammo;
                        RemovePlayerWeapon(playerid, playergun);
                        GetWeaponName(playergun, gunname, sizeof(gunname));
                        format(string, sizeof(string), "You have put your %s in slot 4.", gunname);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        PlayerActionMessage(playerid,20.0, "places a weapon in the house vault.");
                    }
                    return 1;
                }
            }
        }
    }
Well /putgun won't work because the actual command is /house putgun [slot]. But yeah, still not working.
I suspect the problem lays in this line:
pawn Код:
if(sscanf(params,"d", slot)) return SCM(playerid, COLOR_GREY,"[Usage]: /house putgun [slot].");
Reply


Messages In This Thread
Putgun in House - by Chrillzen - 21.02.2014, 18:45
Re : Putgun in House - by MCZOFT - 21.02.2014, 18:52
Re: Re : Putgun in House - by Chrillzen - 21.02.2014, 19:00
Re : Putgun in House - by MCZOFT - 21.02.2014, 19:02
Re: Putgun in House - by Chrillzen - 21.02.2014, 19:11
Re: Putgun in House - by Dignity - 21.02.2014, 19:15
Re: Putgun in House - by 03 - 21.02.2014, 19:24
Re: Putgun in House - by Chrillzen - 21.02.2014, 19:32
Re: Putgun in House - by 03 - 21.02.2014, 19:33

Forum Jump:


Users browsing this thread: 1 Guest(s)