Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:storegun(playerid, params[])
- {
- if(Homes[playerid] > 0)
- {
- if(GetPVarInt(playerid, "IsInArena") >= 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in a arena!");
- if(GetPVarInt( playerid, "EventToken") != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this while you're in an event.");
- new string[128], weaponchoice[32], slot;
- if(sscanf(params, "s[32]d", weaponchoice, slot)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /storegun [weapon] [slot]");
- for(new i; i < MAX_HOUSES; i++)
- {
- if(GetPlayerSQLId(playerid) == HouseInfo[i][hOwnerID] && IsPlayerInRangeOfPoint(playerid, 50, HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hIntVW] && GetPlayerInterior(playerid) == HouseInfo[i][hIntIW])
- {
- if (GetPVarInt(playerid, "GiveWeaponTimer") > 0)
- {
- format(string, sizeof(string), " You must wait %d seconds before depositing another weapon.", GetPVarInt(playerid, "GiveWeaponTimer"));
- SendClientMessageEx(playerid,COLOR_GREY,string);
- return 1;
- }
- new maxslots = HouseInfo[i][hGLUpgrade];
- if(slot > maxslots)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "Invalid slot.");
- return 1;
- }
- if( HouseInfo[i][hWeapons][slot-1] != 0)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You have a weapon stored in that slot already.");
- return 1;
- }
- new weapon, ammo;
- if(strcmp(weaponchoice, "sdpistol", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][2] == 23 && PlayerInfo[playerid][pAGuns][2] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a silenced pistol into your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][2];
- ammo = PlayerInfo[playerid][pGunsAmmo][2];
- format(string,sizeof(string), "* %s deposited their silenced pistol in their house safe.", CheckMask(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);
- }
- }
- else if(strcmp(weaponchoice, "deagle", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][2] == 24 && PlayerInfo[playerid][pAGuns][2] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a Desert Eagle in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][2];
- ammo = PlayerInfo[playerid][pGunsAmmo][2];
- format(string,sizeof(string), "* %s deposited their Desert Eagle in their house safe.", CheckMask(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);
- }
- }
- else if(strcmp(weaponchoice, "shotgun", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][3] == 25 && PlayerInfo[playerid][pAGuns][3] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a shotgun in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][3];
- ammo = PlayerInfo[playerid][pGunsAmmo][3];
- format(string,sizeof(string), "* %s deposited their Shotgun in their house safe.", CheckMask(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);
- }
- }
- else if(strcmp(weaponchoice, "spas12", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][3] == 27 && PlayerInfo[playerid][pAGuns][3] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a combat shotgun in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][3];
- ammo = PlayerInfo[playerid][pGunsAmmo][3];
- format(string,sizeof(string), "* %s deposited their Combat Shotgun in their house safe.", CheckMask(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);
- }
- }
- else if(strcmp(weaponchoice, "mp5", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][4] == 29 && PlayerInfo[playerid][pAGuns][4] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an MP5 in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][4];
- ammo = PlayerInfo[playerid][pGunsAmmo][4];
- format(string,sizeof(string), "* %s deposited their MP5 in their house safe.", CheckMask(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);
- }
- }
- else if(strcmp(weaponchoice, "ak47", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][5] == 30 && PlayerInfo[playerid][pAGuns][5] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an AK-47 in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][5];
- ammo = PlayerInfo[playerid][pGunsAmmo][5];
- format(string,sizeof(string), "* %s deposited their AK-47 in their house safe.", CheckMask(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);
- }
- }
- else if(strcmp(weaponchoice, "m4", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][5] == 31 && PlayerInfo[playerid][pAGuns][5] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an M4 in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][5];
- ammo = PlayerInfo[playerid][pGunsAmmo][5];
- format(string,sizeof(string), "* %s deposited their M4 in their house safe.", CheckMask(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);
- }
- }
- else if(strcmp(weaponchoice, "rifle", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][6] == 33 && PlayerInfo[playerid][pAGuns][6] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a rifle in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][6];
- ammo = PlayerInfo[playerid][pGunsAmmo][6];
- format(string,sizeof(string), "* %s deposited their rifle in their house safe.", CheckMask(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);
- }
- }
- else if(strcmp(weaponchoice, "sniper", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][6] == 34 && PlayerInfo[playerid][pAGuns][6] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a sniper rifle in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][6];
- ammo = PlayerInfo[playerid][pGunsAmmo][6];
- format(string,sizeof(string), "* %s deposited their sniper rifle in their house safe.", CheckMask(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);
- }
- }
- else if(strcmp(weaponchoice, "uzi", true, strlen(weaponchoice)) == 0)
- {
- if( PlayerInfo[playerid][pGuns][4] == 28 && PlayerInfo[playerid][pAGuns][4] == 0 )
- {
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an uzi in your gun locker.");
- weapon = PlayerInfo[playerid][pGuns][4];
- ammo = PlayerInfo[playerid][pGunsAmmo][4];
- format(string,sizeof(string), "* %s deposited their uzi in their house safe.", CheckMask(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);
- }
- }
- 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][pGunsAmmo][4];
- format(string,sizeof(string), "* %s deposited their tec9 in their house safe.", CheckMask(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[i][hWeapons][slot-1] == 0)
- {
- HouseInfo[i][hWeapons][slot-1] = weapon;
- HouseInfo[i][hAmmo][slot-1] = ammo;
- RemovePlayerWeapon(playerid, weapon);
- SaveHouse(i);
- return 1;
- }
- else { SendClientMessageEx(playerid,COLOR_GREY," Invalid weapon name!"); return 1; }
- }
- }
- SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
- }
- else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement