SA-MP Forums Archive
/lock house, in interior - 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: /lock house, in interior (/showthread.php?tid=336007)



/lock house, in interior - thebwgg - 20.04.2012

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;
}



Re: /lock house, in interior - Face9000 - 21.04.2012

https://sampwiki.blast.hk/wiki/GetPlayerInterior


Re: /lock house, in interior - Ainseri - 21.04.2012

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.


Re: /lock house, in interior - thebwgg - 21.04.2012

Thanks.

Problem solved.