24.05.2016, 15:43
I have a similar code but mine works, this is a bit of it, if it helps
Basically stores the weapon within the houses, makes a weapon slot within the house saving system.
Код:
else if(strcmp(weaponchoice, "tec9", true, strlen(weaponchoice)) == 0) { if( PlayerInfo[playerid][pGuns][4] == 32 && PlayerInfo[playerid][pAGuns][4] == 0 ) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a tec9 in your gun locker."); weapon = PlayerInfo[playerid][pGuns][4]; ammo = PlayerInfo[playerid][pGunAmmo][4]; format(string,sizeof(string), "* %s deposited their tec9 in their house safe.", GetPlayerNameEx(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER); } } if(weapon == 0) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that weapon."); if(HouseInfo[PlayerInfo[playerid][pPhousekey]][hWeapons][slot-1] == 0) { HouseInfo[PlayerInfo[playerid][pPhousekey]][hWeapons][slot-1] = weapon; HouseInfo[PlayerInfo[playerid][pPhousekey]][hWepAmmo][slot-1] = ammo; RemovePlayerWeapon(playerid, weapon); SaveHouses(); return 1; }