Help With Pickups.
#1

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
PHP код:
#define MAX_GIFTS (500)
new GiftPickupCount;
new 
GiftPickup[MAX_GIFTS];
new 
RandomModel[5][1] = {
    {
19054},
    {
19055},
    {
19056},
    {
19057},
    {
19058}
}; 
Under OnPlayerDeath
PHP код:
new Float:XFloat:YFloat:Z;
GetPlayerPos(playeridX,Y,Z);
new 
Rand random(sizeof(RandomModel));
    
if (
GiftPickupCount MAX_GIFTS)
{
GiftPickupCount ++;
}else{
GiftPickupCount 0;
}
GiftPickup[GiftPickupCount] = CreatePickup(RandomModel[Rand][0], 1XYZGetPlayerVirtualWorld(playerid)) 
Under OnPlayerPickupPickup
PHP код:
for(new 0MAX_GIFTSi++) 
{
    
if(!
IsPlayerConnected(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(stringsizeof(string), "Recieved ''%s'' From The Gift Box.",GiftName);
SendClientMessage(playerid,COLOR_SERVER_HELP_MSG,string);
DestroyPickup(GiftPickup[i]);
break;

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: 1 Guest(s)