About houses - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: About houses (
/showthread.php?tid=446616)
About houses -
dominik523 - 26.06.2013
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
Re: About houses -
dominik523 - 26.06.2013
please does anyone knows what should I do?