About houses
#1

Hey! I created part in my script which allows players to plant weed in their house, and I want to add feature which allows cops to search house for drugs. I dont know how to search if weed is planted inside of house where player is standing. This is my script:
Код:
enum houseInfo
{
      hWeedP,
.
other house info
.
Код:
CMD:checkhouse(playerid, params[])
{
    new string[128];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsACop(playerid) && !IsFBI(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSPD Oficer/FBI Agent.");
	if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
	for(new idx=1; idx<MAX_HOUSES; idx++) 
		{
	            if(PlayerInfo[i][pHouse] == idx)
		        {
	                if(HouseInfo[idx][hWeedP] == 1)    // I should add someting somewhere here but I dont know what
	                {
						format(string, sizeof(string), "%s searches the house and finds weed inside.", RPN(playerid));
						SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
					}
					//if(HouseInfo[PlayerInfo[i][pHouse]][hWeedP] == 0)
                    if(HouseInfo[idx][hWeedP] == 0)
					{
						format(string, sizeof(string), "%s searches the house and doesn't find any weed.", RPN(playerid));
						SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
					}
				}
		}
	return 1;
}
Please if someone knows what should I add so my system will work, please write here
btw if I plant weed in my house, when I type /checkweed in any house, it will show that weed is inside
Reply
#2

please does anyone knows what should I do?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)