SA-MP Forums Archive
I'm Stumped..... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I'm Stumped..... (/showthread.php?tid=300773)



I'm Stumped..... - Dokins - 01.12.2011

This wont set the string(players name) or the set integer. I know they both work as they're used elsewhere.
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", GetName(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;
}