Putgun in House
#2

Try This my brother

PHP код:
else if(!strcmp(cmdtext"/putgun"true))
    {
        new 
hworld GetPlayerVirtualWorld(playerid);
        new 
house PlayerInfo[playerid][HouseID];
       
        for(new 
1sizeof(HouseInfo); h++)
        {
            if(
hworld == HouseInfo[h][hInsideWorld])
            {
                if(
house == HouseInfo[h][hInsideWorld])
                {
                    new
                    
string[128], gunname[100], slotplayergunplayerammo;
                    
playergun GetPlayerWeapon(playerid);
                    
playerammo GetPlayerAmmo(playerid);
                    if(
playergun 1) return SCM(playeridCOLOR_LIGHTRED,"[Error]: You do not have a weapon.");
                    if(
playerammo 1) return SCM(playeridCOLOR_LIGHTRED,"[Error]: You do not have any ammo.");
                   
                    if(
sscanf(params,"d"slot)) return SCM(playeridCOLOR_GREY,"[Usage]: /house putgun [slot].");
                    if(
slot == 1)
                    {
                        if(
HouseInfo[h][hWeapon1] != 0) return SCM(playeridCOLOR_LIGHTRED"There is already a weapon in this slot.");
                        
HouseInfo[h][hWeapon1] = playergun;
                        
HouseInfo[h][hAmmo1] += playerammo;
                        
RemovePlayerWeapon(playeridplayergun);
                        
GetWeaponName(playergungunnamesizeof(gunname));
                        
format(stringsizeof(string), "You have put your %s in slot 1."gunname);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
PlayerActionMessage(playerid,20.0"places a weapon in the house vault.");
                    }
                    else if(
slot == 2)
                    {
                        if(
HouseInfo[h][hWeapon2] != 0) return SCM(playeridCOLOR_LIGHTRED"There is already a weapon in this slot.");
                        
HouseInfo[h][hWeapon2] = playergun;
                        
HouseInfo[h][hAmmo2] += playerammo;
                        
RemovePlayerWeapon(playeridplayergun);
                        
GetWeaponName(playergungunnamesizeof(gunname));
                        
format(stringsizeof(string), "You have put your %s in slot 2."gunname);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
PlayerActionMessage(playerid,20.0"places a weapon in the house vault.");
                    }
                    else if(
slot == 3)
                    {
                        if(
HouseInfo[h][hWeapon3] != 0) return SCM(playeridCOLOR_LIGHTRED"There is already a weapon in this slot.");
                        
HouseInfo[h][hWeapon3] = playergun;
                        
HouseInfo[h][hAmmo3] += playerammo;
                        
RemovePlayerWeapon(playeridplayergun);
                        
GetWeaponName(playergungunnamesizeof(gunname));
                        
format(stringsizeof(string), "You have put your %s in slot 3."gunname);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
PlayerActionMessage(playerid,20.0"places a weapon in the house vault.");
                    }
                    else if(
slot == 4)
                    {
                        if(
HouseInfo[h][hWeapon4] != 0) return SCM(playeridCOLOR_LIGHTRED"There is already a weapon in this slot.");
                        
HouseInfo[h][hWeapon4] = playergun;
                        
HouseInfo[h][hAmmo4] += playerammo;
                        
RemovePlayerWeapon(playeridplayergun);
                        
GetWeaponName(playergungunnamesizeof(gunname));
                        
format(stringsizeof(string), "You have put your %s in slot 4."gunname);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
PlayerActionMessage(playerid,20.0"places a weapon in the house vault.");
                    }
                    return 
1;
                }
            }
        }
    } 
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)