SA-MP Forums Archive
[HELP]House sale cmd - 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: [HELP]House sale cmd (/showthread.php?tid=280467)



[HELP]House sale cmd - [Aka]Dragonu - 01.09.2011

Hello. I have this command :
pawn Код:
if(strcmp(cmd, "/asellallhouses", true) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
            for(new h; h < sizeof(HouseInfo); h++)
            {
                format(string, sizeof(string), "Server :  You have successfully sold house id %d", h);
                SendClientMessage(playerid, COLOR_YELLOW, string);
                SellHouse(h);
            }
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            OnHouseUpdate();
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use this command.");
        }
        return 1;
    }
Ok, and I want when I tipe /asellallhouses a message to appear on the main chat like : Admin %s has sold all the houses in the game. Can someone do it for me ?

P.S : the colour to be COLOR_RED


Re: [HELP]House sale cmd - TTJJ - 01.09.2011

Hi Dragonu,

Try this:
pawn Код:
if(strcmp(cmd, "/asellallhouses", true) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
            for(new h; h < sizeof(HouseInfo); h++)
            {
                format(string, sizeof(string), "Server :  You have successfully sold house id %d", h);
                SendClientMessage(playerid, COLOR_YELLOW, string);
                SellHouse(h);
            }
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,name,sizeof(name));
            format(string,sizeof(string),"Admin %s has sold all houses in the game.",name);
            SendClientMessageToAll(COLOR_RED,string);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            OnHouseUpdate();
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use this command.");
        }
        return 1;
    }
Cheers,

TJ


Re: [HELP]House sale cmd - [Aka]Dragonu - 01.09.2011

Thanks.