20.07.2011, 14:22
I'm starting creating a house system, now i'm at 27% of it.
But this code has bug:
Even if i put
it doesn't work.
Sorry i'm noob in house system scripting.
EDIT:
the problem is that i don't own yet the house, i can enter... :\
but if i changed "if(strcmp(...))" to "if(!strcmp(.....))" still have same problem but /buy it works fine.
Please help
But this code has bug:
pawn Код:
if(HouseInfo[J][Owned] == 0)
{
format(str, sizeof(str), "~b~Owner: ~w~%s~n~~b~Value: ~w~$%d ~n~~n~~p~House CMDs~n~~w~/buy", HouseNoOwnerName, HouseInfo[J][HouseValue]);
}
TextDrawSetString(Text:hInfo, str);
TextDrawShowForPlayer(playerid, Text:hBox);
TextDrawShowForPlayer(playerid, Text:hInfo);
new Pname[24]; GetPlayerName(playerid, Pname, 24);
if(strcmp(Pname, HouseInfo[J][Owner]) == 0) return 0;
if(strcmp(Pname, HouseInfo[J][Owner]) == 1)
{
SetPlayerPos(playerid, HouseInfo[J][TeleX], HouseInfo[J][TeleY], HouseInfo[J][TeleZ]);
SetPlayerInterior(playerid, HouseInfo[J][Interior]);
InHouse[playerid] = J;
SetPlayerVirtualWorld(playerid, HouseInfo[J][Virtual]);
TextDrawSetString(Text:hInfo, "~w~You have entered in your ~n~~g~house~n~~n~type ~y~/hinfo~w~ for info");
TextDrawShowForPlayer(playerid, Text:hInfo);
TextDrawShowForPlayer(playerid, Text:hBox);
return 1;
}
pawn Код:
if(!strcmp(......))
Sorry i'm noob in house system scripting.

EDIT:
the problem is that i don't own yet the house, i can enter... :\
but if i changed "if(strcmp(...))" to "if(!strcmp(.....))" still have same problem but /buy it works fine.
Please help