House System giving rep
#1

i had a house system and it was with exterior and... and name tag and u choose the interior and i changed it to:
pawn Код:
if(strcmp(cmd, "/house", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pLevel] < 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You must be atleast level 1 to buy a house !");
                return 1;
            }
            new x_nr[32];
            x_nr = strtok(cmdtext, idx);
            if(!strlen(x_nr))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /house [name]");
                SendClientMessage(playerid, COLOR_GRAD1, "Available names: Entrance , Confirm(if You have set all the details)");
                return 1;
            }
            if(strcmp(x_nr,"entrance",true) == 0)
            {
                if(GetPlayerInterior(playerid) != 0) { SendClientMessage(playerid, COLOR_GREY, "   That can't use that while inside."); return 1; }
                if(PlayerInfo[playerid][pHouseEntrance] == 0)
                {
                    GetPlayerPos(playerid,PlayerInfo[playerid][pHouseX],PlayerInfo[playerid][pHouseY],PlayerInfo[playerid][pHouseZ]);
                    if(HousePickupIDTemp[playerid] == 0) //has not placed a house pickup yet
                    {
                        //pickup
                        SendClientMessage(playerid, COLOR_YELLOW, "You have successfully placed your house entrance.");
                        PlayerInfo[playerid][pHouseEntrance] = 1;
                    }
                }
            }
            if(strcmp(x_nr,"confirm",true) == 0)
            {
                if(PlayerInfo[playerid][pHouseEntrance] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You have not chosen a house entrance yet !");
                    return 1;
                }
                if(IsPlayerConnected(giveplayerid))
                {
                    giveplayerid = ReturnUser(tmp);
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        new cost = HousePriceTemp[giveplayerid];
                        if(PlayerInfo[giveplayerid][pCash] < 50000 && PlayerInfo[giveplayerid][hTicket] == 0)
                        {
                            RejectHouse(giveplayerid);
                            format(string, sizeof(string), "Your house request has been auto-rejected due to not being able to afford the price.");
                            SendClientMessage(giveplayerid, COLOR_YELLOW, string);
                            OnPlayerSave(giveplayerid);
                            PlayerInfo[playerid][pHouseEntrance] = 0;
                            return 1;
                        }
                        if(PlayerInfo[playerid][pHouseEntrance] == 1)
                        {
                            if(PlayerInfo[giveplayerid][hTicket] == 0)
                            {
                                PlayerInfo[giveplayerid][pCash] = PlayerInfo[giveplayerid][pCash]-50000;
                                GivePlayerMoney(giveplayerid, -50000);
                            }
                            PlayerInfo[giveplayerid][hValue] = 50000;
                            PlayerInfo[giveplayerid][hTicket] = 0;
                            PlayerInfo[giveplayerid][pHouseAccepted] = 1;
                            PlayerInfo[giveplayerid][pHouseLocked] = 0;
                            PlayerInfo[giveplayerid][pHouseLevel] = 1;
                            if(PlayerInfo[giveplayerid][hTicket] == 1)
                            {
                                format(string, sizeof(string), "Congratulations! you have used your free house ticket.");
                            }
                            SendClientMessage(giveplayerid, COLOR_YELLOW, "HINT: Type /househelp to review the property help section.");
                            PlayerPlaySound(giveplayerid, Songs[1][0], 0.0, 0.0, 0.0);
                            SetTimerEx("StopSongTimer", 5000, false, "i", giveplayerid);
                            OnPlayerSave(giveplayerid);
                        }
                    }
                }
            }
        }
        return 1;
    }
and when i do /house confirm after i set the entrance up it doesnt make the owner and doesnt show anything,why?
Reply
#2

help?
Reply
#3

can someone help?
Reply
#4

....
Reply
#5

Any one can help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)