Help With Pickups.
#2

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

#define MAX_GIFTS (500)

new Iterator:GiftPickup<MAX_GIFTS>;

new RandomModel[5][1] = {
    {19054},
    {19055},
    {19056},
    {19057},
    {19058}
};  

public OnPlayerDeath(playerid,killerid,reason)
{
    new Float:X, Float:Y, Float:Z;
    if(Iter_Count(GiftPickup)==MAX_GIFTS)return 1;
    new Rand = random(sizeof(RandomModel));
    GetPlayerPos(playerid, X,Y,Z);
    Iter_Add(GiftPickup,CreatePickup(RandomModel[Rand][0], 1, X, Y, Z, GetPlayerVirtualWorld(playerid)));
    return 1;
}
public OnPlayerPickupPickup(playerid,pickupid)
{
    foreach(new id:GiftPickup)
    {
        if(id == pickupid)
        {
            GiveGifts(playerid);
            SendClientMessage(playerid,-1,""RED"M"GREEN2"E"RED"R"GREEN2"R"RED"Y  "GREEN2"C"RED"H"GREEN2"R"RED"I"GREEN2"S"RED"T"GREEN2"M"RED"A"GREEN2"S!");
            format(string, sizeof(string), "Recieved ''%s'' From The Gift Box.",GiftName);
            SendClientMessage(playerid,COLOR_SERVER_HELP_MSG,string);
            DestroyPickup(id);
            new next;
            Iter_SafeRemove(GiftPickup, id, next);
            id = next;
        }
    }

    return 1;
}
Reply


Messages In This Thread
Help With Pickups. - by danish007 - 15.12.2014, 21:04
Re: Help With Pickups. - by Quickie - 16.12.2014, 02:16
Re: Help With Pickups. - by danish007 - 16.12.2014, 07:23
Re: Help With Pickups. - by Quickie - 16.12.2014, 08:11
Re: Help With Pickups. - by danish007 - 16.12.2014, 08:13
Re: Help With Pickups. - by danish007 - 16.12.2014, 08:29

Forum Jump:


Users browsing this thread: 2 Guest(s)