30.01.2012, 19:18
So, I have a bug.
my /lock and /enterhouse are almost exactly the same, but.. /lock works.
/enterhouse gives me the error "You are not near an unlocked house!"
The code for my /enterhouse is:
while my code for /lock:
(ps: The You are not banned thing is just cause I left space to make it a different if(blablabla)
anyone sees the problem?
my /lock and /enterhouse are almost exactly the same, but.. /lock works.
/enterhouse gives me the error "You are not near an unlocked house!"
The code for my /enterhouse is:
pawn Код:
CMD:enterhouse(playerid, params[])
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(PlayerInfo[playerid][Banned] != 9999)
{
for(new h = 0; h < sizeof(House); h++)
{
if(IsPlayerInRangeOfPoint(playerid, 10, House[h][henx], House[h][heny], House[h][henz]) && House[h][hlocked] == 0)
{
if(IsInHouse[playerid] == 0)
{
GetPlayerPos(playerid, PP, PP2, PP3);
SetPlayerPos(playerid, House[h][hexx], House[h][hexy], House[h][hexz]);
SetPlayerInterior(playerid, House[h][hint]);
SetPlayerVirtualWorld(playerid, House[h][hvw]);
IsInHouse[playerid] = 1;
}
else return SendClientMessage(playerid, COLOR_GREY, "You are already in a house!");
}
else return SendClientMessage(playerid, COLOR_GREY, "You are not near any unlocked houses!");
}
return 1;
}
else return SendClientMessage(playerid, COLOR_GREY, "You are not banned:D");
}
pawn Код:
CMD:lockhouse(playerid, params[])
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(PlayerInfo[playerid][Banned] != 9999)
{
for(new h = 0; h < sizeof(House); h++)
{
if(IsPlayerInRangeOfPoint(playerid, 10, House[h][henx], House[h][heny], House[h][henz]) && PlayerInfo[playerid][Housekey] == h)
{
if(House[h][hlocked] == 0)
{
House[h][hlocked] = 1;
GameTextForPlayer(playerid, "House Locked!!", 4000, 5);
}
else
{
House[h][hlocked] = 0;
GameTextForPlayer(playerid, "House UnLocked!!", 4000, 5);
}
}
}
return 1;
}
else return SendClientMessage(playerid, COLOR_GREY, "You are not banned:D");
}
anyone sees the problem?