15.12.2014, 21:04
Hello im making Gifts OnPlayerDeath..
so its done when player dies it give a gift with pickup. but there is a problem.
when im killing someone and picking the giftpickup it gives me gift. but when i kill a player and i dont pick his giftpickup and i call him and kill him again to make 2 gifts and to pick 2 gifts but when i pick new made pickup it gives me a gift but when i pick old one pickup it dosen't give me gift.
Here is my code.
On Top
Under OnPlayerDeath
Under OnPlayerPickupPickup
so its done when player dies it give a gift with pickup. but there is a problem.
when im killing someone and picking the giftpickup it gives me gift. but when i kill a player and i dont pick his giftpickup and i call him and kill him again to make 2 gifts and to pick 2 gifts but when i pick new made pickup it gives me a gift but when i pick old one pickup it dosen't give me gift.
Here is my code.
On Top
PHP код:
#define MAX_GIFTS (500)
new GiftPickupCount;
new GiftPickup[MAX_GIFTS];
new RandomModel[5][1] = {
{19054},
{19055},
{19056},
{19057},
{19058}
};
PHP код:
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new Rand = random(sizeof(RandomModel));
if (GiftPickupCount < MAX_GIFTS)
{
GiftPickupCount ++;
}else{
GiftPickupCount = 0;
}
GiftPickup[GiftPickupCount] = CreatePickup(RandomModel[Rand][0], 1, X, Y, Z, GetPlayerVirtualWorld(playerid))
PHP код:
for(new i = 0; i < MAX_GIFTS; i++)
{
if(!IsPlayerConnected(i) || i == playerid) continue;
if(pickupid != GiftPickup[i])continue;
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(GiftPickup[i]);
break;
}