Can someone have a look at this, Uncertain as to why it wont work.
#1

I know for a fact MySQL_SetString and MySQL_SetInteger work.

The problem is: It won't set the string OR the integer, yet I use them elsewhere and it works. I get the clientmessage but it wont actually set the string or integer.


pawn Код:
CMD:buyhouse(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
    if(GetPlayerHouseID(playerid) >= 1) return SendClientMessage(playerid, COLOUR_GREY, "You already own a house");
    for(new x = 0; x < MAX_HOUSES; x++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 5, HouseEntX[x], HouseEntY[x], HouseEntZ[x]))
        {
        if(PlayerMoney[playerid] >= HousePrice[x])
                {
                        PlayerMoney[playerid] -= HousePrice[x];
                        GivePlayerMoney(playerid, -HousePrice[x]);
                }
        if(!(strcmp(HouseOwner[x], "nobody", true)))
                {
                        HouseSQLID[x] = MySQL_GetValue(HouseSQLID[x], "id", "houses");
                        MySQL_SetString(HouseSQLID[x], "HouseOwner", NormalName[playerid], "houses");
                        MySQL_SetInteger(HouseSQLID[x], "HousePrice", 0, "houses");
                        new string[100];
                        format(string, sizeof(string), "Congratulations, you have purchased Address: %s, You are now the owner!", HouseName[x]);
                        SendClientMessage(playerid, COLOUR_ORANGE, string);
                       

                    }
                }
            }
    return 1;
}
GetPlayerHouseID
pawn Код:
stock GetPlayerHouseID(playerid)
{
    for(new x = 0; x < MAX_HOUSES; x++)
        {
        if(!(strcmp(HouseOwner[x],NormalName[playerid], true)))
            {
                return x;
                }
            }
    return 0;
}
Reply
#2

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)