[HELP]OnPlayerEnterDynamicCP problem
#1

I'm starting creating a house system, now i'm at 27% of it.
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;
            }
Even if i put
pawn Код:
if(!strcmp(......))
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
Reply
#2

pawn Код:
if(strcmp(Pname, HouseInfo[J][Owner]) == 1)
Is WRONG! strcmp returns 0 on success (i.e. when the two names are the same), not 1.
Reply
#3

Then, i will remove it or change?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)