[HELP]: Lock house
#6

Alright, is the house lock variable either 0 or 1?
Have you tried debugging the code? (check which number doesn't get called)

pawn Код:
CMD:lockh(playerid, params[])
{
    for(new i = 0; i < MAX_HOUSES; i ++)
    {
        if(!IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[i][posX], HouseInfo[i][posY], HouseInfo[i][posZ])) continue;
        new pName[24]; new string[70];
        print("1");
        GetPlayerName(playerid, pName, 24);
        print("2");
        if(strcmp(pName, HouseInfo[i][Owner], true))
        {
            print("3");
            if(HouseInfo[i][hLock] == 0)
            {
                HouseInfo[i][hLock] = 1;
                format(string, sizeof(string), "* %s has locked his house !", GetName(playerid));
                ProxDetector(30, playerid, string, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~w~house ~r~locked", 3000, 5);
                print("4");
            }
            if(HouseInfo[i][hLock] == 1)
            {
                HouseInfo[i][hLock] = 0;
                format(string, sizeof(string), "* %s has unlocked his house !", GetName(playerid));
                ProxDetector(30, playerid, string, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~w~house ~g~unlocked", 3000, 5);
                print("5");
            }
            print("6");
        }
        print("6");
    }
    return 1;
}
Reply


Messages In This Thread
[HELP]: Lock house - by Areax - 30.11.2013, 17:43
Re: [HELP]: Lock house - by Loot - 30.11.2013, 18:09
Re: [HELP]: Lock house - by Areax - 30.11.2013, 18:11
Re: [HELP]: Lock house - by Loot - 30.11.2013, 18:13
Re: [HELP]: Lock house - by Areax - 30.11.2013, 18:18
Re: [HELP]: Lock house - by Loot - 30.11.2013, 18:23
Re: [HELP]: Lock house - by Areax - 30.11.2013, 18:29
Re: [HELP]: Lock house - by Loot - 30.11.2013, 18:41
Re: [HELP]: Lock house - by Areax - 30.11.2013, 18:53

Forum Jump:


Users browsing this thread: 4 Guest(s)