21.02.2014, 18:52
Try This my brother
PHP код:
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;
}
}
}
}