30.11.2013, 18:23
Alright, is the house lock variable either 0 or 1?
Have you tried debugging the code? (check which number doesn't get called)
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;
}