SA-MP Forums Archive
Lockdoor from inside - 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: Lockdoor from inside (/showthread.php?tid=452396)



Lockdoor from inside - Lorenzosdm - 21.07.2013

I wanna lock my house from the inside(interior) , but when im trying to do this its says im not near my house, Can someone find the problem.

Already thanks for help!

pawn Код:
CMD:lockdoor(playerid, params[], help)
{
        #pragma unused params
        #pragma unused help
        new h = Player[playerid][Houseid];
        if(h == 999) return SCM(playerid,-1,"{FF8000}[House]:{FFFFFF} You don't have a house.");
        if(House[h][Lock] == 1) return SCM(playerid,-1,"{FF8000}[House]:{FFFFFF} House is already locked.");
        if(!IsPlayerInRangeOfPoint(playerid,3.0,House[h][EnterX],House[h][EnterY],House[h][EnterZ])) return SCM(playerid,-1,"{FF8000}[House]:{FFFFFF} You are not near your house");
        if(!IsPlayerInRangeOfPoint(playerid,3.0,House[h][ExitX],House[h][ExitY],House[h][ExitZ])) return SCM(playerid,-1,"{FF8000}[House]:{FFFFFF} You are not near your house");
        Choose[playerid] = 1;
        House[h][Lock] = 1;
        SendClientMessage(playerid,-1,"{FF8000}[House]:{FFFFFF} Door has been locked!");
        return 1;
}