SA-MP Forums Archive
Problem with house lock. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with house lock. (/showthread.php?tid=270753)



Problem with house lock. - budelis - 21.07.2011

Hi all.Maybe somebody can help my.This is my house lock script:

COMMAND:hlock(playerid, params[])
{
if(!strcmp(houseDB[GetPlayerVirtualWorld(playerid)][owner_name],"no",true))
{
SendClientMessage(playerid,COLOR_GREY,"* This is not your house");
return 1;
}
if(houseDB[playerid][hkey] == false)
{
SendClientMessage(playerid,COLOR_GREY,"* house already locked");
return 1;
}
houseDB[playerid][hkey] = false;
SendClientMessage(playerid,COLOR_GREY,"* house locked");
return 1;
}

COMMAND:hunlock(playerid, params[])
{
if(!strcmp(houseDB[GetPlayerVirtualWorld(playerid)][owner_name],"no",true))
{
SendClientMessage(playerid,COLOR_GREY,"* This is not your house");
return 1;
}
if(houseDB[playerid][hkey] == true)
{
SendClientMessage(playerid,COLOR_GREY,"* house already unlocked");
return 1;
}
houseDB[playerid][hkey] = true;
SendClientMessage(playerid,COLOR_GREY,"* house unlocked");
return 1;
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>houseDB[playerid][hkey] = false;<<<<<<<<<<<<<<<<<<<<<<<<<

And how to do this not for player id,but for player house,I don't know how to say it correctly,and then when somebody go on house pickup and if he unlocked he can go to the house.


Re: Problem with house lock. - budelis - 21.07.2011

any help?