SA-MP Forums Archive
Locking system possible flaw - 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: Locking system possible flaw (/showthread.php?tid=377278)



Locking system possible flaw - Deal-or-die - 13.09.2012

Hey
When I was scripting this is was confusing myself with this locking system.. When I set the house too locked (House[playerid][hLocked] = 1) Wouldn't that only lock the house for the player that locked it? and everyone else would still be able to enter the house?

Here is my locking system
pawn Код:
//Mind the missing brackets, I'm still working on this :P
    if(IsPlayerInRangeOfAnyHouse(playerid,2))
    {
        if(House[playerid][hLinked] == Player[playerid][pAccountID])
        {
            if(House[playerid][hLocked] == 0)
            {
                House[playerid][hLocked] = 1);
                SendClientMessage(playerid,COLOR_GREY, "You have locked your house.");
            }
            if(House[playerid][hLocked] == 1)
            {
                House[playerid][hLocked] = 1);
                SendClientMessage(playerid, COLOR_GREY, "You have unlocked your house.);
            }

        return 1;
    }



AW: Locking system possible flaw - BiosMarcel - 13.09.2012

Only for you i think


Re: Locking system possible flaw - Ronaldo_raul™ - 13.09.2012

For you obv, and you created the house variables for players ?

pawn Код:
if(House[playerid][hLocked] == 0)
,___,
[O.o]
/)__)
-"--"-


Re: Locking system possible flaw - Deal-or-die - 13.09.2012

Quote:
Originally Posted by Ronaldo_raul™
Посмотреть сообщение
For you obv
Yea that's what I thought. Bugger... Nah I gotta stuff around trying to get IDs -.-

Quote:
Originally Posted by Ronaldo_raul™
Посмотреть сообщение
and you created the house variables for players ?

pawn Код:
if(House[playerid][hLocked] == 0)
,___,
[O.o]
/)__)
-"--"-
Ahhh... Now that you make me think of it..... I suppose not.... -.- FML.