SA-MP Forums Archive
loot system - 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: loot system (/showthread.php?tid=458130)



loot system - Legend_Of_War - 15.08.2013

How to code a dynamic looting system I know the basics and that I need to make objects pos and so on but uow to make the inv system


Re: loot system - Lyksus - 15.08.2013

This section of the forums is not the section looking for personal scripters, if that being the case please use the freelancer topic


Re: loot system - Tayab - 15.08.2013

This is the general starter of what you want.

pawn Код:
#include <a_samp>
#include <zcmd>

new BRobbery[MAX_PLAYERS];
new string[128];

#define COLOR_WHITE     0xFFFFFFFF
#define COLOR_RED       0xFF0000AA
#define COLOR_YELLOW    0xFF4000FF

public OnPlayerConnect(playerid)
{
    BRobbery[playerid] = 0;
    return 1;
}
CMD:robbank(playerid,params[])
{
    new pName[MAX_PLAYER_NAME];
    for(new i = 0; i<MAX_PLAYERS; i++)
    {
        BRobbery[i] = 1;
    }
    format(string,sizeof(string),"[BREAKING NEWS]%s has started robbing bank!",GetPlayerName(playerid,pName,sizeof(pName)));
        SendClientMessage(playerid,COLOR_RED,string);

}
CMD:loot(playerid,params[])
{
    new LootMax;
    if(LootMax == 10) return SendClientMessage(playerid,COLOR_WHITE,"Enough robbery mate!");
    if(!IsPlayerInRangeOfPoint(playerid,5,0.0,0.0,0.0))  return SendClientMessage(playerid,COLOR_RED,"You're not in the vault!");
    if(BRobbery[playerid] != 1) return SendClientMessage(playerid,COLOR_WHITE,"The bank robbery isn't started yet!");
    new money = random(1000);
    format(string,sizeof(string),"Your loot bought up $%d in your bag!",money);
    SendClientMessage(playerid,COLOR_YELLOW,string);
    LootMax++;
    return 1;
}