/lock house, in interior
#1

How i can to lock my house when i am in interior ?

This is /lock command :
pawn Код:
dcmd_lock(playerid,params[])
{
    #pragma unused params
    new str1[256],pname[24],housenumber;
    housenumber = GetHouseID(playerid);
    GetPlayerName(playerid, pname, 24);
    format(str1, sizeof(str1), "Houses/houseid%d", housenumber);
    if(strcmp(hInfo[housenumber][Name],pname,true)==0)
    {
        SendClientMessage(playerid, c_y, "{FFFFFF}You have locked your house.");
        dini_IntSet(str1,"Locked",1);
        hInfo[housenumber][Locked] = 1;
    }
    else if(strcmp(hInfo[housenumber][Renter],pname,true)==0)
    {
        SendClientMessage(playerid, c_y, "{FFFFFF}You have locked your house.");
        dini_IntSet(str1,"Locked",1);
        hInfo[housenumber][Locked] = 1;
    }
    else
    {
        SendClientMessage(playerid, c_r, "{FFFFFF}This house isn't your.");
    }
    return 1;
}
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerInterior
Reply
#3

Use GetPlayerInterior, have /lock toggle a boolean for that interior ID (or virtual world ID/house ID) and then check the boolean on your /enter command. If the lock boolean is true, deny them entry.
Reply
#4

Thanks.

Problem solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)