SA-MP Forums Archive
how to make /houserob 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: how to make /houserob cmd (/showthread.php?tid=369427)



how to make /houserob cmd - andrewgrob - 17.08.2012

how to make /houserob cmd

im using PPC_Housing system


Re: how to make /houserob cmd - Anak - 17.08.2012

mean you want if some one /houserob in house he get money or some thing else ?


Re: how to make /houserob cmd - Dare Devil..... - 17.08.2012

I dont know the exact function of it but try this one and instead of my codes put your own .
pawn Код:
#define SCM SendClientMessage
CMD:robhouse(playerid, params[])
{
    for(new i = 0; i < MAX_HOUSES;i++)
    {
        if(IsPlayerInRangeOfPoint(playerid,2.5,HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos]))
        {
            if(HInfo[i][locked] == 0)
            {
                GivePlayerMoney(playerid,3000);
                If(playerinfo[playerid][criminal]);
                SCM(playerid,-1,"You have sucessfully robbed the house.");
            }
        }
        return 1;
    }
    return 0;
}
pawn Код:
If(playerinfo[playerid][criminal]);
Change this to your crimianl like I just gave a example you can choose 1 I guess it should be in your Gamemode.

pawn Код:
if(HInfo[i][locked] == 0)
//and
HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos]
Change this for your house format otherwise it will not work.

When you robhouse you get $3000 you can change it to any thing you want by changing this.

pawn Код:
GivePlayerMoney(playerid,3000);
Change 3000 to any thing you want

I think I helped you I didnt knew the exact function so sorry for that what I understanded was this.