30.11.2013, 17:43
Hello again !
I am trying to make a command to lock/unlock a house, but for some reason nothing happends.
Thanks
I am trying to make a command to lock/unlock a house, but for some reason nothing happends.
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];
GetPlayerName(playerid, pName, 24);
if(strcmp(pName, HouseInfo[i][Owner], true))
{
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);
}
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);
}
}
}
return 1;
}