SA-MP Forums Archive
/housestore money. Will not work. - 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: /housestore money. Will not work. (/showthread.php?tid=312258)



/housestore money. Will not work. - Dokins - 20.01.2012

The command doesn't work if executed, the function GetPlayerHouseID does work. It's to do with the strcmp.. I can't figure it out,it displays the syntax for /housestore money amount but when I actually type the money, it doesnt work.


pawn Код:
CMD:housestore(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");

    new function[16], cashamount;
    new houseid = GetPlayerHouseID(playerid);
    if(sscanf(params, "s[16]", function)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /housestore [function] Available functions: weapon(coming soon), money");

    if(strcmp(function, "money", true) == 0)
    {
        if(sscanf(function, "d", cashamount)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /housestore money [amount]"); // this displays..
        if(cashamount < 1 || cashamount > 500000) return SendClientMessage(playerid, COLOUR_GREY, "The amount must be between $0 and $500,000.");
        if(cashamount > PlayerMoney[playerid]) return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much to store.");// the bit below this doesn't execute.
        if(HouseOwned[playerid] == houseid)
        {
            MySQL_SetInteger(houseid, "HouseMoney", cashamount, "houses");
        }
        new string[128];
        format(string, sizeof(string), "You have stored $%d in your house.", cashamount);
        GivePlayerMoney(playerid, -cashamount);
        SendClientMessage(playerid, COLOUR_ORANGE, string);

    }
    return 1;
}



Re: /housestore money. Will not work. - Dokins - 20.01.2012

bump, it's not that hard...


Re: /housestore money. Will not work. - Snowman12 - 20.01.2012

What MySQL are you using as I have never seen yours ?


Re: /housestore money. Will not work. - Dokins - 20.01.2012

It's a custom function, the actual issue is that the money wont store, it's to do with sscanf cos if I do (!(sscanf... then it works but it wont return the syntax. It's deeply annoying.