16.12.2014, 02:16
(
Последний раз редактировалось Quickie; 16.12.2014 в 08:09.
)
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;
}