How does a loot system works?
#1

Hi guys,
Could someone explain how a simple loot system works. I actually doesn't know so much about it, so i thought i would ask here.
Could someone also put a little snippet of a very basic loot system, or atleast give some help, on how to do it?

Thanks
-CaptainShy
Reply
#2

What do you mean a loot system? explain us
Reply
#3

Loot is mostly like treasure or wealth that is found or stolen, but in my case i want them to be placed in some special cordinates and when player run into them a dialog will be posted, but i actually don't know how to :/
Reply
#4

you mean something like moneybag? Huh?
and just wondering were you a player of lvrcr ,godcat's brother?
Reply
#5

Just save tons of positions in a array..

make a random and find one of this tons of positions

create a pickup or whatever you want to create in this positions..

maybe set a timer for disappear

some variables for check if is here and if is taken

and the callback for player pickup with the reward

pawn Код:
Float:Positions[2][3] = {
    {0.0,0.0,0.1719},
    {0.0,0.0,0.1719}
};
new bool:IsPickupCreated,PickupID;



/commandforcreate {
    if(IsPickupCreated == true) return .. the pickup is already created
    new rando = random(sizeof(Positions));
    PickupID = createsomepickup(someid,Positions[rando][0],Positions[rando][1],Positions[rando][2]);
    IsPickupCreated = true;
    SetTimer("PickupDisappear",10000,0);
}



public PickupDisappear()
{
    DestroyPickup(PickupID);
    IsPickupCreated = false;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == PickupID)
    {
        GivePlayerMoney(playerid, 2342354);
        IsPickupCreated = false;
        //sendclientmessage for announce the winner
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Abhishek.
Посмотреть сообщение
you mean something like moneybag? Huh?
and just wondering were you a player of lvrcr ,godcat's brother?
Yeah, i were a lvrcr player , but not godcat's brother :P, I also remember you

Quote:
Originally Posted by iJumbo
Посмотреть сообщение
Just save tons of positions in a array..

make a random and find one of this tons of positions

create a pickup or whatever you want to create in this positions..

maybe set a timer for disappear

some variables for check if is here and if is taken

and the callback for player pickup with the reward

pawn Код:
Float:Positions[2][3] = {
    {0.0,0.0,0.1719},
    {0.0,0.0,0.1719}
};
new bool:IsPickupCreated,PickupID;



/commandforcreate {
    if(IsPickupCreated == true) return .. the pickup is already created
    new rando = random(sizeof(Positions));
    PickupID = createsomepickup(someid,Positions[rando][0],Positions[rando][1],Positions[rando][2]);
    IsPickupCreated = true;
    SetTimer("PickupDisappear",10000,0);
}



public PickupDisappear()
{
    DestroyPickup(PickupID);
    IsPickupCreated = false;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == PickupID)
    {
        GivePlayerMoney(playerid, 2342354);
        IsPickupCreated = false;
        //sendclientmessage for announce the winner
    }
    return 1;
}
Thanks for the basic snippet, I am already trying to modify your code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)